Use this when scanning configs against security baselines automatically.
Configuration Compliance
Configuration compliance automation scans systems against security baselines on a schedule and reports or fixes deviations, such as weak TLS settings or disabled logging.
1. Configuration compliance automation: scans, drift detection, remediation.
2. Policy as code.
3. Report per system.
4. Auto-fix safe items; ticket the rest.
5. Track trends.
baseline → scan → report → remediate
Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
git diff --exit-code <baseline-ref> -- <managed-path>Primary Commands
Configuration and operational commands for this Topic.
Verification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 Verify compliance with direct security-control read-back Verify boundary
After a security compliance change, read the exact control from the target or authoritative management plane and compare observed and expected values under the same baseline rule version. Run the compliance check again with a fresh collection timestamp, confirm any exception is still valid and inspect runtime enforcement when the control requires it. Repeat the original security validation or access test where safe. A passing compliance rule shows the evaluated control on that captured asset state, but it does not show the complete host, identity, network or application security posture.
Step 2 Command read-back and what it shows Verify boundary
For Security Automation → Configuration Compliance, read back with git diff --exit-code <baseline-ref> -- <managed-path>. Success is discriminated by fresh observed state for the correct target is evaluated against the approved baseline, each material delta has a compliant/not-applicable/approved-exception outcome, and required controls read back as enforced; failure remains when unexplained required-control deltas, stale observation, mismatched baseline/platform or an approved-looking report whose direct control read-back contradicts it. The Git diff shows differences between selected baseline and observed text artifacts, but it does not show scanner completeness, control effectiveness or risk acceptance.
Step 3 Localize security compliance disagreement before remediation Narrow the fault
If a security compliance result looks wrong, verify the asset is in the intended baseline scope and that inventory tags/role are current. Then confirm collection reached the authoritative security control and was not blocked by permissions or an unsupported API. Compare raw control state with parser/evaluator input before changing the rule. An exception should be checked for control, asset and expiry; it changes disposition, not the observed configuration. If configured policy matches but enforcement differs, move to the security technology that owns runtime enforcement rather than repeatedly rewriting the same setting.
Step 4 Common mistakes Narrow the fault
- Checks that only report and never ticket.
Step 5 Observation-driven branch and next-check logic Narrow the fault
Start Security Automation → Configuration Compliance from one identified target/request/artifact and timestamp. Decision path: if baseline revision/scope is wrong, fix policy selection; if observation is stale/partial, recollect; if both are valid and delta remains, evaluate control semantics and exception ownership before remediation.
- Scan configurations against baselines on a schedule.
- Report or fix deviations.
- Track trends.
oscap xccdf eval --profile <p> --report r.html <ds.xml>— scanansible-playbook harden.yml --check— drift- Auto-remediation for low-risk findings — fix
ReferenceWhy it matters1 section · depth on demand
Security configuration compliance is baseline plus scoped effective control
Security Automation Configuration Compliance compares a versioned security baseline with effective control state on assets that are actually in scope. Asset role, platform/version, environment and exception status affect applicability; a baseline item should not be evaluated blindly against every host or device. The automation must distinguish configured intent from enforcement where the platform has separate runtime state. Findings therefore need control/rule identity, asset identity, observed value, expected value, evidence timestamp and any approved exception so remediation can target the correct boundary.
ReferenceHow it works1 section · depth on demand
How it works
Security Automation → Configuration Compliance owns security baseline revision, target-specific exceptions, observed configuration and the policy evaluator that maps individual controls to compliant/non-compliant/not-applicable state. Configuration compliance normalizes an observed target state and compares relevant controls with a versioned security baseline; exceptions and not-applicable decisions must be explicit so a textual mismatch is not automatically a failed control. Keep these adjacent boundaries separate: scanner freshness, target identity, platform version, policy scope and compensating controls are independent things to check. A key diagnostic distinction is that a clean diff may be false assurance when the collection is incomplete, while a difference may be an approved exception or platform-specific equivalent control.
ReferenceImportant terms & boundaries1 section · depth on demand
Method
Configuration compliance automation checks systems against a security baseline (CIS, DISA STIG, internal standard), reports deviations and optionally remediates them.
1. Choose and version the baseline; document approved exceptions.
2. Scan systems on a schedule (OpenSCAP, Microsoft Defender/Intune baselines, Ansible check mode, InSpec).
3. Store results centrally with trends per system and rule.
4. Prioritise high-severity failures; open tickets or auto-remediate low-risk rules.
5. Rescan to confirm remediation.
oscap xccdf eval --profile xccdf_org.ssgproject.content_profile_cis \
--results results.xml --report report.html /usr/share/xml/scap/ssg/content/ssg-rhel9-ds.xml
Remediate in test first — some hardening rules break applications.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in Security Automation > Configuration Compliance. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://docs.oasis-open.org/cacao/security-playbooks/v2.0/security-playbooks-v2.0.html · confidence 94%