Pcornel
Browse topics
Options
Recent
Favorites
Automation · Technical reference

Compliance Checks

Direct answer

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.

When to use this

Use this when writing automated checks that compare configuration with rules.

First 30 seconds

1. Automated compliance checks on schedule and on change.

2. Per-control results.

3. Integrate with ticketing.

4. Track pass rates.

5. Fix failures.

Operational verification

systems → checks → results

Context & applicabilityCommon mistakes · platform/version boundaries
Platform / version applicability
policy-as-code compliance checks
applies
Structured applicability is explicit Topic metadata; it does not infer compatibility beyond the stored rows.
At a glance

Operational reference

Fast context before you go deeper.

Platformpolicy-as-code compliance checks · Automation implementations are tool and platform specific. Use the adjacent Domain for the technology being automated and this Domain for automation behavior.
Scope / prerequisiteUse this when writing automated checks that compare configuration with rules.
What next?3 suggested next steps
Evidence1
On this pageJump to a specific section
Operational workflow

Verification & Troubleshooting

Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.

3 steps Observe → verify → isolate → change minimally → repeat the original test.
ObservedRecord what the original test actually shows

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 references

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.

observation · 1
Key points
  • Each check returns pass or fail with detail.
  • Checks must be versioned.
  • Run them on a schedule.
Key checks
  • 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 propertyReason
Tests one requirementClear failures
Reads actual stateNot the intended config
Includes evidence in outputAudit trail
Mapped to a control IDReporting
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.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.
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
Technical verification history

Verification history & basis

When and against what this Topic was checked. Later text edits do not count as a new check.

2026-09-14 · vendor docpolicy-as-code compliance checks OPA/Rego current concepts

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%
Embedded reference data

Quick lookup tables

Compliance Automation → Compliance Checks · operational reference

Context-specific ownership, verification, output and failure-boundary lookup for Compliance Automation → Compliance Checks.

LayerCompliance Automation → Compliance Checks operational reference
Runtime/ownershippolicy-as-code compliance checks · the policy evaluation engine that combines versioned policy/data with a structured input document to produce explicit decisions
Persistent intentpolicy bundle/rule version, input schema, data dependencies, severity and enforcement/remediation mapping
VerificationEvaluate compliant, noncompliant and missing-field fixtures against the pinned policy bundle; capture the decision object and then verify any enforcement target independently.
Expected interpretationEach 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 boundarypreserve input and policy bundle revision, reproduce the decision offline, repair policy/data/schema, rerun tests including negative fixtures, then separately verify enforcement if configured
Depth when you need it

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.

Confirmation

Confirm action

Continue?