Skip to content

Quick Guide


Already completed Getting Started? Skip to Step 3: Generate a Baseline.
  1. macOS includes Python 3 and Ruby. You just need to install the packages:

    Python packages (required):

    Terminal window
    pip3 install pyyaml xlwt --user

    Ruby gems (optional — only needed for PDF output):

    Terminal window
    gem install asciidoctor asciidoctor-pdf rouge --user-install
    Want isolated installs? Click to expand

    A virtual environment keeps packages separate from your system Python — useful if you don’t want to install packages globally or need to avoid conflicts.

    Python virtual environment:

    Terminal window
    # Create environment (once)
    python3 -m venv venv
    # Activate before running scripts
    source venv/bin/activate
    # Install packages inside the environment
    pip3 install -r requirements.txt
    # When done, deactivate
    deactivate

    Ruby local bundle:

    Terminal window
    bundle install --path vendor/bundle
  2. Terminal window
    git clone https://github.com/usnistgov/macos_security.git
    cd macos_security
    git checkout sequoia

    Replace sequoia with your target macOS version.

  3. List baselines: ./scripts/generate_baseline.py -l

    Generate: ./scripts/generate_baseline.py -k BASELINE_NAME

    With tailoring: ./scripts/generate_baseline.py -k BASELINE_NAME -t

    Terminal window
    # Example: Generate NIST 800-53 Moderate baseline
    ./scripts/generate_baseline.py -k 800-53r5_moderate
  4. Run generate_guidance.py with the flags you need:

    Terminal window
    ./scripts/generate_guidance.py [flags] baselines/BASELINE_NAME.yaml
    FlagOutput
    (none)Guidance docs (.adoc, .html, .pdf)
    -sCompliance script
    -pConfiguration profiles (one per payload)
    -PSingle consolidated profile
    -DDDM components
    -xExcel spreadsheet

    Example — Generate all common outputs:

    Terminal window
    ./scripts/generate_guidance.py -s -p -x baselines/800-53r5_moderate.yaml
  5. Everything goes to build/BASELINE_NAME/:

    build/800-53r5_moderate/
    ├── 800-53r5_moderate.adoc
    ├── 800-53r5_moderate.html
    ├── 800-53r5_moderate.pdf
    ├── 800-53r5_moderate_compliance.sh
    ├── mobileconfigs/
    ├── preferences/
    ├── activations/ ← DDM (if -D used)
    ├── assets/
    └── configurations/

Interactive mode:

Terminal window
sudo ./build/800-53r5_moderate/800-53r5_moderate_compliance.sh

Automated mode:

FlagWhat it does
--checkRun checks only
--fixRun fixes only
--cfcCheck → Fix → Check
--statsShow last run statistics
--compliantReport compliant count
--non_compliantReport non-compliant count
--resetClear results for this baseline
--reset-allClear results for all baselines
--quiet=1Show failed/exempt only
--quiet=2Minimal output
Terminal window
# Quick check
sudo ./build/800-53r5_moderate/800-53r5_moderate_compliance.sh --check
# Full remediation
sudo ./build/800-53r5_moderate/800-53r5_moderate_compliance.sh --cfc --quiet=2

Example baselines (may vary by branch):

FrameworkBaseline Name
NIST 800-53 Rev 5800-53r5_high, 800-53r5_moderate, 800-53r5_low
NIST 800-171800-171
DISA STIGDISA-STIG
CIS Benchmarkscis_lvl1, cis_lvl2, cisv8
CMMC 2.0cmmc_lvl1, cmmc_lvl2
CNSSI 1253cnssi-1253_high, cnssi-1253_moderate, cnssi-1253_low
All Rulesall_rules

Creates the baseline YAML file.

FlagPurpose
-lList available baselines
-k NAMEGenerate baseline
-tInteractive tailoring
-cShow 800-53 controls

Generates all outputs from a baseline.

FlagPurpose
-sCompliance script
-pConfig profiles
-PConsolidated profile
-DDDM components
-xExcel file
-l LOGOCustom logo
-H HASHSign profiles
-a NAMECustom audit name
-r REFCustom reference ID

Generates SCAP/OVAL content for compliance scanning tools.

FlagPurpose
-xXCCDF file
-oOVAL file
-b NAMESpecific baseline
-d FILEInclude DISA STIG references from file
-lList tags

Scan a Mac for compliance issues:

Terminal window
./scripts/generate_baseline.py -k 800-53r5_moderate
./scripts/generate_guidance.py -s baselines/800-53r5_moderate.yaml
sudo ./build/800-53r5_moderate/800-53r5_moderate_compliance.sh --check

Generate profiles and DDM for device management:

Terminal window
./scripts/generate_baseline.py -k DISA-STIG -t
./scripts/generate_guidance.py -p -D -s build/baselines/DISA-STIG.yaml

Create all outputs for documentation and audit:

Terminal window
./scripts/generate_baseline.py -k cis_lvl2
./scripts/generate_guidance.py -s -p -x baselines/cis_lvl2.yaml

OptionDescriptionLink
Tailor BaselineSelect rules and set Organization Defined ValuesLearn more →
Customize RulesModify rules in custom/rules/ folderLearn more →
Exempt RulesMark rules as approved exceptionsLearn more →
Sign ProfilesSign with your certificate using -H HASHLearn more →