Use this when writing automated checks that compare configuration with rules.
Compliance Checks
Compliance checks are automated tests that compare a system's configuration with a required rule, such as password policy or disabled services, returning pass or fail with details.
1. Automated compliance checks on schedule and on change.
2. Per-control results.
3. Integrate with ticketing.
4. Track pass rates.
5. Fix failures.
systems → checks → results
Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
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 Verification path Verify boundary
The primary procedure is: Evaluate compliant, noncompliant and missing-field fixtures against the pinned policy bundle; capture the decision object and then verify any enforcement target independently. Exercise failure-oriented cases such as schema drift, undefined values, stale policy bundles, broad deny rules, tests lacking negative cases, policy exceptions bypassing ownership and enforcement failure reported as policy pass so the test covers failure cases, not only the happy path.
Step 2 Common mistakes Narrow the fault
- Checks that only look for presence of a line, not its value.
Step 3 Where it fails Narrow the fault
Failure analysis for Compliance Automation → Compliance Checks should follow the path through the components: resource/input collection → schema normalization → policy/data load → rule evaluation → decision → enforcement/remediation → target read-back. Tests should include edge cases such as schema drift, undefined values, stale policy bundles, broad deny rules, tests lacking negative cases, policy exceptions bypassing ownership and enforcement failure reported as policy pass. Recovery should preserve input and policy bundle revision, reproduce the decision offline, repair policy/data/schema, rerun tests including negative fixtures, then separately verify enforcement if configured.
Evidence · 1 on this Topic
Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.
- Each check returns pass or fail with detail.
- Checks must be versioned.
- Run them on a schedule.
- Scheduled compliance scans — coverage
- Results per control — detail
- Pass rate trend — progress
ReferenceWhy it matters1 section · depth on demand
In depth
Compliance checks are the individual automated tests that verify a system meets one requirement — a setting present, a service disabled, a version approved. Each check should produce pass/fail with evidence.
# InSpec example
describe sshd_config do
its('PermitRootLogin') { should cmp 'no' }
its('PasswordAuthentication') { should cmp 'no' }
end
| Good check property | Reason |
|---|---|
| Tests one requirement | Clear failures |
| Reads actual state | Not the intended config |
| Includes evidence in output | Audit trail |
| Mapped to a control ID | Reporting |
ReferenceImportant terms & boundaries1 section · depth on demand
Mechanics
Compliance Checks in Compliance Automation is owned at runtime by the policy evaluation engine that combines versioned policy/data with a structured input document to produce explicit decisions. The durable intent is policy bundle/rule version, input schema, data dependencies, severity and enforcement/remediation mapping. Reliable automation must carry stable identity across the path: policy package/rule, bundle revision, input object/resource ID and evaluation/correlation ID. The consumer-visible target is a decision/finding for a specific resource state, with enforcement handled by a separate documented boundary. The key invariants are evaluation is deterministic for the same policy+data+input, unknown/missing input cannot silently become compliant, rule versions are attributable and policy decision is distinct from enforcement result.
ReferenceConfiguration & state1 section · depth on demand
Lifecycle
Store and review policy bundle/rule version, input schema, data dependencies, severity and enforcement/remediation mapping; pin or at least record implementation/model versions and keep environment-specific identity outside reusable logic where possible. The stable identity contract is policy package/rule, bundle revision, input object/resource ID and evaluation/correlation ID.
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 Compliance Automation > Compliance Checks. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://www.openpolicyagent.org/docs/policy-language · confidence 94%Quick lookup tables
Compliance Automation → Compliance Checks · operational reference
Context-specific ownership, verification, output and failure-boundary lookup for Compliance Automation → Compliance Checks.
| Layer | Compliance Automation → Compliance Checks operational reference |
|---|---|
| Runtime/ownership | policy-as-code compliance checks · the policy evaluation engine that combines versioned policy/data with a structured input document to produce explicit decisions |
| Persistent intent | policy bundle/rule version, input schema, data dependencies, severity and enforcement/remediation mapping |
| Verification | Evaluate compliant, noncompliant and missing-field fixtures against the pinned policy bundle; capture the decision object and then verify any enforcement target independently. |
| Expected interpretation | Each decision is reproducible from recorded policy/data/input versions, missing or invalid input is explicit, and enforcement status is not conflated with policy evaluation success. |
| Recovery boundary | preserve input and policy bundle revision, reproduce the decision offline, repair policy/data/schema, rerun tests including negative fixtures, then separately verify enforcement if configured |
Deep reference
Healthy vs suspicious evidence
Output interpretation
At minimum retain evaluation ID, policy package/rule, bundle revision, input resource ID/schema version, decision/result, explanation/failing path, exception ID and enforcement/read-back status. The useful output makes ambiguity visible, links to the target identity from policy package/rule, bundle revision, input object/resource ID and evaluation/correlation ID, and provides enough context to safely decide whether a retry is permitted.