Subscribe to the Non-Human & AI Identity Journal

How should security teams measure whether infrastructure is actually governed by IaC?

Start by measuring coverage, drift, and exception volume together. A single coverage percentage is not enough if unmanaged resources still exist or if live infrastructure has drifted from Terraform. The practical test is whether every production resource can be traced back to code, policy, and an approved delivery path.

Why This Matters for Security Teams

Measuring whether infrastructure is actually governed by IaC is less about reporting a high adoption number and more about proving control over change. A team can have broad Terraform coverage and still be exposed if unmanaged resources exist, manual console edits are common, or exceptions bypass the delivery path. That is why governance must be measured across code, policy, and runtime state, not just repository presence. The NIST Cybersecurity Framework 2.0 reinforces this kind of outcome-based thinking, while NHIMG’s Ultimate Guide to NHIs — Regulatory and Audit Perspectives frames governance as evidence, not assumption. In practice, many security teams discover their weakest controls only after a drift event, a failed audit, or a production change that never passed through code review.

The practical risk is that IaC becomes a label rather than an operating model. If live infrastructure can diverge from source control without detection, then the environment is only partially governed. That is especially true when cloud teams rely on emergency fixes, ad hoc exceptions, or separate tooling for policy enforcement. The right question is not whether IaC exists, but whether it is the authoritative path for creation, change, and deletion.

How It Works in Practice

Strong IaC governance starts with three measurements that need to be reviewed together: coverage, drift, and exceptions. Coverage answers how much of production is represented in approved code. Drift shows whether runtime resources still match the declared baseline. Exception volume shows how often teams bypass the intended process, which is often where the real governance failures hide. NHIMG’s Top 10 NHI Issues is useful here because unmanaged identities and unmanaged infrastructure tend to appear together when lifecycle discipline is weak.

A practical measurement model usually includes:

  • Resource inventory reconciliation: every production asset should map to a code file, module, or approved exception.
  • Drift detection: detect changes made outside the pipeline, then classify them as benign, risky, or policy-breaking.
  • Policy coverage: verify that guardrails are enforced in CI, plan review, and runtime, not only in documentation.
  • Exception tracking: measure how many resources rely on manual approval, how long exceptions remain open, and who can grant them.
  • Change provenance: confirm that a resource can be traced to a commit, reviewer, approver, and deployment event.

This is where policy-as-code and platform controls matter. Tools and standards such as the NIST Cybersecurity Framework 2.0 support the idea that governance should be observable and repeatable, while the operational discipline described in the Ultimate Guide to NHIs — Lifecycle Processes for Managing NHIs reinforces the need to tie identity, approvals, and lifecycle events to a controlled path. Teams should also compare intended coverage by environment, because development may be almost fully codified while production still has console-built exceptions. These controls tend to break down in fast-moving multi-account cloud environments because resource ownership, drift detection, and approval history are often fragmented across separate systems.

Common Variations and Edge Cases

Tighter IaC governance often increases operational overhead, so organisations have to balance stronger control against deployment speed and exception handling. That tradeoff becomes visible in environments with legacy infrastructure, acquisition sprawl, or mixed ownership between platform and application teams. In those settings, best practice is evolving rather than settled, and there is no universal standard for how much drift is acceptable.

One common edge case is “mostly IaC” environments where foundational services are codified but application teams still create resources manually. Another is break-glass access, which may be justified for resilience but should be rare, logged, time-bound, and reviewed. A third is generated infrastructure, where templates are produced by internal platforms or agents before human approval. In those cases, the governance question shifts from “was Terraform used?” to “was the approved control path preserved?”

Leadership should also avoid treating exception count as a simple badness score. A low number of exceptions can still hide poor governance if exceptions never expire or if teams routinely re-open the same ticket. For audit and oversight purposes, what matters is whether every deviation has an owner, a reason, and a retirement date. NHIMG’s State of Non-Human Identity Security is a reminder that weak visibility and weak rotation habits often show up together, and the same pattern applies to infrastructure control. Governance is real only when the organisation can prove that unmanaged change is exceptional, not normal.

Standards & Framework Alignment

This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.

OWASP Non-Human Identity Top 10 address the attack and risk surface, while NIST CSF 2.0 and NIST CSF 2.0 set the governance and control requirements practitioners need to meet.

Framework Control / Reference Relevance
NIST CSF 2.0 GV.OC-01 Governance requires proving who owns infrastructure and how it is controlled.
NIST CSF 2.0 DE.CM-08 Drift detection is a monitoring control for unauthorized infrastructure change.
OWASP Non-Human Identity Top 10 NHI-03 IaC governance fails when unmanaged secrets or identities bypass the delivery path.

Bind infrastructure change to managed identity, rotation, and approved deployment workflows.