Skip to content

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.


  1. Generate unsigned profiles

    Terminal window
    ./scripts/generate_guidance.py -p baselines/BASELINE_NAME.yaml

    Example:

    Terminal window
    ./scripts/generate_guidance.py -p baselines/800-53r5_moderate.yaml
  2. Find your files

    Profiles are saved to build/BASELINE_NAME/mobileconfigs/:

    • Directorybuild/
      • Directory800-53r5_moderate/
        • Directorymobileconfigs/
          • Directoryunsigned/ - Unsigned profiles (.mobileconfig)
          • Directorypreferences/ - Preference plists (.plist)

Signed profiles verify authenticity and prevent tampering. You need a signing certificate installed in your keychain.

  1. 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 OFFSET with 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.

  2. Generate signed profiles

    Terminal window
    ./scripts/generate_guidance.py -p -H SUBJECT_KEY_ID baselines/BASELINE_NAME.yaml

    Example:

    Terminal window
    ./scripts/generate_guidance.py -p -H ABC123DEF456 baselines/800-53r5_moderate.yaml
  3. Find your signed files

    • Directorybuild/
      • Directory800-53r5_moderate/
        • Directorymobileconfigs/
          • Directoryunsigned/ - Unsigned profiles
          • Directorysigned/ - Signed profiles
          • Directorypreferences/ - Preference plists

FlagDescription
-pGenerate individual profiles (one per payload type)
-PGenerate a single consolidated profile
-H HASHSign profiles with your certificate’s Subject Key ID

TypeFlagBest For
Individual-pFlexibility - deploy only the profiles you need
Consolidated-PSimplicity - one profile with all settings

Most organizations prefer individual profiles (-p) for easier management and troubleshooting.