Skip to content

Automate Fleet Audits and CIS Specification Sync

Read Reference Index before you start.

Prerequisites

  1. Make sure that Python 3.8+ exists on the controller.
  2. Make sure that conf/cis_manifest.json exists in the repository.
  3. 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

  1. Verify SHA-256 checksums for local specification files in CIS_DATA/:
python3 audit_cis.py --verify-cis --cis-types md
  1. 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
  1. Run container discovery and local audits with --auto-detect:
python3 audit_cis.py --auto-detect
  1. Run sequential audits across all 18 targets with --all:
python3 audit_cis.py --all --local -f json -l en
  1. 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
  1. Run parallel fleet audits across all five formats with audit_orchestrator.py:
python3 audit_orchestrator.py --all -j 4 -f html,json,xml,txt,sarif -o reports/fleet

NOTE: --verify-cis exits with code 1 if any checked file is missing or corrupt.

Verification

  1. Confirm exit code 0 and Corrupted: 0 from --verify-cis.
  2. Confirm that --sync-cis --dry-run prints Downloaded: 0 and Failed: 0.
  3. Confirm that all five format files exist in reports/ (ls -lh reports/rhel9.*).
  4. 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

  1. Stop any active audit_cis.py or audit_orchestrator.py process.
  2. Delete partial report files from reports/ and reports/fleet/.
  3. Delete incomplete .part files inside CIS_DATA/.
  4. Re-run --verify-cis --cis-types md to confirm specification integrity.