Azure Policy Compliance Review
Review Azure Policy assignments and non-compliance data to identify gaps in governance coverage.
Tested against az cli 2.x · claude-code-1.8+ · windsurf-1.6+
You are an Azure governance engineer. Your task is to review policy assignments and compliance data, then highlight coverage gaps and over- or under-triggering policies. Context: - You have read access to list policy assignments and state. - You will not create or edit policy assignments. Steps: 1. List all assignments at the relevant scopes: az policy assignment list, noting the scope, policyDefinitionId, and enforcementMode for each. 2. Pull compliance: az policy state list --resource? per assignment, or use az policy assignment list --show-compliance, and record compliant vs noncompliant counts. 3. Find non-enforcing assignments: flag assignments with enforcementMode = DoNotEnforce (they are effectively decorative). 4. Detect gaps: compare the assignments to the key security baselines (enforce HTTPS, ensure encryption, TLS version, tagging), and list which are missing. 5. Identify noisy or silent policies: a policy with many noncompliant resources that is rarely remediated, versus one with zero findings that may not be covering anything. Output format: - Table: assignment, scope, enforcementMode, compliant count, noncompliant count, verdict. - Short gap list of baseline policies not present. Constraints: - Read-only; never mutate assignments or initiative memberships. - Do not interpret partial policy state as full coverage; use the IsCompliant field carefully. - Focus on enforceable policies, not informational ones, when identifying gaps. Example: Input: assignment asegure-https in sub-1, DoNotEnforce, 0 noncompliant; no encryption policy assigned anywhere. Output: asegure-https -> DoNotEnforce (gap, high) suggest flipping to Enforce; encryption baseline missing at sub scope (gap).
Why this directive matters
Azure Policy looks busy until you check whether the assignments actually do anything. The two silent failure modes are a policy left in DoNotEnforce while it accumulates findings nobody sees, and a security baseline that was planned but never assigned to any scope. This directive makes the agent read the assignment list, pull the compliance state per assignment, and separate real enforcement from decoration. It flags non-enforcing assignments, compares the present set against a small list of baseline governance policies anyone should have, and watches for polics that either generate a pile of unresolved noncompliance or zero findings because they cover nothing. The output is a per-assignment verdict table plus a short gap list, which gives a governance team the exact set of policies to enforce or remove. It is read-only and runs cleanly as a periodic posture review.
Test Command
az policy assignment list --show-compliance --output tablePrerequisites
- az cli with policy read access
- Policy.State read permissions
Expected Outputs
- Assignment verdict table
- Baseline gap list
- Enforcement mode findings
References
- Kubernetes Documentation | Concepts: authoritative concepts for cluster, RBAC, and workload audits.
- Terraform Documentation: plan, state, and provider reference for IaC directives.
- AWS Documentation: IAM, Cost Explorer, and service reference for cloud directives.
- CNCF Landscape: cloud-native tooling context for multi-cloud directives.
Automate it past the prompt.
This intermediate directive is a manual, read-only run. Devopsify can run the same check continuously across your estate, with policy gates, approvals, and a retained audit trail.