Automate Fleet Audits and CIS Specification Sync¶
Read Reference Index before you start.
Prerequisites¶
- Make sure that Python
3.8+exists on the controller. - Make sure that
conf/cis_manifest.jsonexists in the repository. - Confirm Docker Engine access before you run
--auto-detect.
Safety Instructions¶
CAUTION: Always run --sync-cis with --dry-run before a live sync.
Live sync writes files to CIS_DATA/ and overwrites local edits.
CAUTION: Never use --force unless a SHA-256 check fails.
Forced sync replaces verified specification files from the remote source.
CAUTION: Never run --all or --auto-detect inside read-only MCP calls.
Bulk flags break read-only boundaries and overload shared hosts.
Procedure¶
- Verify
SHA-256checksums for local specification files inCIS_DATA/:
- Preview updates with
--sync-cis,--dry-run, and--cis-types:
python3 audit_cis.py --sync-cis --dry-run --cis-types md,pdf
python3 audit_cis.py --sync-cis --dry-run -t postgresql16 --cis-types md
- Run container discovery and local audits with
--auto-detect:
- Run sequential audits across all 18 targets with
--all:
- Export all five formats (
html,json,xml,txt,sarif):
python3 audit_cis.py -t rhel9 --local -f html -o reports/rhel9.html
python3 audit_cis.py -t rhel9 --local -f json -o reports/rhel9.json
python3 audit_cis.py -t rhel9 --local -f xml -o reports/rhel9.xml
python3 audit_cis.py -t rhel9 --local -f txt -o reports/rhel9.txt
python3 audit_cis.py -t rhel9 --local -f sarif -o reports/rhel9.sarif
- Run parallel fleet audits across all five formats with
audit_orchestrator.py:
NOTE: --verify-cis exits with code 1 if any checked file is missing
or corrupt.
Verification¶
- Confirm exit code
0andCorrupted: 0from--verify-cis. - Confirm that
--sync-cis --dry-runprintsDownloaded: 0andFailed: 0. - Confirm that all five format files exist in
reports/(ls -lh reports/rhel9.*). - Validate the generated SARIF document:
python3 -c "import json, sarif_exporter as s; ok, m = s.validate_sarif_document(json.load(open('reports/rhel9.sarif', encoding='utf-8'))); print(m); assert ok"
Rollback¶
- Stop any active
audit_cis.pyoraudit_orchestrator.pyprocess. - Delete partial report files from
reports/andreports/fleet/. - Delete incomplete
.partfiles insideCIS_DATA/. - Re-run
--verify-cis --cis-types mdto confirm specification integrity.