How to Generate Configuration Profiles
Configuration profiles are generated using the generate_guidance.py script with the -p flag. The script reads your baseline and creates .mobileconfig files ready for MDM deployment.
Generate Configuration Profiles
Section titled “Generate Configuration Profiles”-
Generate unsigned profiles
Terminal window ./scripts/generate_guidance.py -p baselines/BASELINE_NAME.yamlExample:
Terminal window ./scripts/generate_guidance.py -p baselines/800-53r5_moderate.yaml -
Find your files
Profiles are saved to
build/BASELINE_NAME/mobileconfigs/:Directorybuild/
Directory800-53r5_moderate/
Directorymobileconfigs/
Directoryunsigned/ - Unsigned profiles (.mobileconfig)
- …
Directorypreferences/ - Preference plists (.plist)
- …
Generate Signed Profiles
Section titled “Generate Signed Profiles”Signed profiles verify authenticity and prevent tampering. You need a signing certificate installed in your keychain.
-
Get your certificate’s Subject Key ID
First, find the offset:
Terminal window security find-certificate -c "Your Certificate Name" -p | \openssl asn1parse | \awk -F: '/X509v3 Subject Key Identifier/ {getline; print $1}'Then extract the hash using that offset (replace
OFFSETwith the number from above):Terminal window security find-certificate -c "Your Certificate Name" -p | \openssl asn1parse -strparse OFFSET | \awk -F: '/HEX DUMP/{print $4}'Replace
"Your Certificate Name"with your signing certificate’s common name. -
Generate signed profiles
Terminal window ./scripts/generate_guidance.py -p -H SUBJECT_KEY_ID baselines/BASELINE_NAME.yamlExample:
Terminal window ./scripts/generate_guidance.py -p -H ABC123DEF456 baselines/800-53r5_moderate.yaml -
Find your signed files
Directorybuild/
Directory800-53r5_moderate/
Directorymobileconfigs/
Directoryunsigned/ - Unsigned profiles
- …
Directorysigned/ - Signed profiles
- …
Directorypreferences/ - Preference plists
- …
Command Reference
Section titled “Command Reference”| Flag | Description |
|---|---|
-p | Generate individual profiles (one per payload type) |
-P | Generate a single consolidated profile |
-H HASH | Sign profiles with your certificate’s Subject Key ID |
Individual vs Consolidated Profiles
Section titled “Individual vs Consolidated Profiles”| Type | Flag | Best For |
|---|---|---|
| Individual | -p | Flexibility - deploy only the profiles you need |
| Consolidated | -P | Simplicity - one profile with all settings |
Most organizations prefer individual profiles (-p) for easier management and troubleshooting.
Next Steps
Section titled “Next Steps”- Configuration Profile Layout - Understand the file structure
- How to Generate Guidance - Generate all outputs at once