An infrastructure as code platform can rewrite every cloud account it manages, and its controls decay quietly: state files collect readers, platform tokens outlive the people who created them, apply identities gain scope one exception at a time and engineers start fixing production by hand. This health check is a recurring, measurable review of a live infrastructure as code (IaC) platform: the orchestration service or self-hosted server that plans and applies changes, its state backends, its runners, its policy engine and the cloud identities it applies with. It turns the questions an auditor or platform security lead would ask into twelve metrics with formulas, thresholds and evidence, so each quarter can be compared with the last. It is written for cloud platform owners, DevSecOps leads, internal audit and the CISO's office.
This page measures; it does not explain how to configure the platform. For hardening of admin roles, service accounts, keys, logs and lifecycle, read Securing the infrastructure as code platform itself; for the discipline as a whole (state, secrets, scanning, drift), read the Infrastructure as Code Security Guide. Return to them for every finding this review raises.
What this health check covers
The review covers one IaC platform end to end: workspaces or stacks, the remote state backend, stored variables and credentials, runner pools, the policy engine, the module and provider sources it trusts, and the cloud identities that carry out applies. Pipelines that call the platform are reviewed in the CI/CD server health check, and the cloud accounts themselves in the CNAPP and CSPM platform health check; they appear here only where the IaC platform depends on them.
- Who runs it: the IaC platform owner collects the figures; the cloud security or DevSecOps lead reviews them; the head of cloud engineering and the CISO or delegate sign off red items.
- How it differs from the securing guide: that page explains what to set. This check asks, with numbers, whether those settings still hold across every workspace this quarter: how many people can read state, how many apply identities reach more than one environment, how many production changes bypassed the platform.
- Why the identity angle matters: most metrics measure non-human identities: platform API tokens, runner identities and the cloud roles used to apply. See the IaC credential security guide and IaC identity policy checks.
- Common questions it answers: "IaC platform security audit checklist", "how to audit infrastructure as code state access", "IaC security KPIs" and "how do we prove production changes go through the pipeline".
Key takeaways
- State is the crown jewel. Count who can read it, whether it is encrypted, versioned and recoverable, and whether it holds plaintext secrets. A state reader often learns every credential the configuration ever touched.
- Measure apply identity blast radius. The share of workspaces whose apply role can write to more than one environment is the clearest single indicator of how far one compromised run could reach.
- Out-of-band changes undo the model. Track production write events from identities that are not platform apply roles or break-glass; every one is either drift, an emergency or an intruder.
- Overrides and drift show real behaviour. Policy overrides and stale drift reveal where the guardrails are being bypassed, not where they are documented.
- Thresholds are a starting point. The bands are NHI Mgmt Group recommendations; agree your own once and keep them stable so trends mean something.
How to use this template
Copy the metrics table and the findings log into your own tracker and run this infrastructure as code platform health check at the cadence below. Collect each figure from the data source types described, score it against the green, amber and red bands, and log every amber or red result as a finding with an owner and a due date. Keep each completed review with its raw exports: the quarter-on-quarter trend is as important as any single score, and auditors will ask how a figure was produced.
Cadence and sign-off
| Review | Frequency | Owner | Approver | Evidence kept |
|---|---|---|---|---|
| Platform API token and stored credential review | Monthly | IaC platform owner | NHI or secrets management lead | Token and variable metadata export (never values), expiry dates, owners |
| Out-of-band production write review | Monthly | Cloud security lead | Head of cloud engineering | Cloud audit log extract filtered to non-apply identities, explanation per event |
| Full metrics review (this page) | Quarterly | IaC platform owner | Head of cloud engineering and CISO or delegate | Completed metrics table, raw exports, findings log |
| State backend access and recovery test | Quarterly access review; restore test twice a year | IaC platform owner | Security risk or GRC | Backend access policy export, restore test record with timings |
| Independent sample test | Annually | Internal audit or second line risk | Audit committee | Sample of production changes traced from merge request to cloud audit event |
| Event-driven review | After a platform compromise advisory, a provider or module supply chain alert, or a platform migration | Cloud security lead | CISO or delegate | Affected workspaces, credentials rotated, state integrity check |
The engineers who administer the platform should not be the only people approving figures about their own access; this applies the separation of duties principle in NIST SP 800-53 Rev. 5 AC-5. The NSA and CISA guidance on defending CI/CD environments also calls for regular audits of administrative accounts and logs that record who committed, reviewed and deployed each change, which this scorecard evidences.
Metrics
NHI Mgmt Group recommended thresholds; adjust to your risk appetite. Record the numerator, denominator and data source the first time and reuse them every quarter. "Workspace" means the unit the platform plans and applies (workspace, stack, project or environment), and "apply identity" means the cloud role or service account a run uses to make changes.
| ID | Metric | Formula | Data source type | Green | Amber | Red |
|---|---|---|---|---|---|---|
| IAC-01 | State readers on the approved list | Human and machine principals able to read production state who are on the approved list ÷ all principals able to read production state | State backend access policy export, platform workspace permission export | 100% | None (no amber band) | Below 100% |
| IAC-02 | Protected state backends | State backends with encryption at rest, object versioning or equivalent history, and deletion protection all enabled ÷ all state backends | Storage configuration export, backend settings in platform configuration | 100% | 90% to below 100% | Below 90% |
| IAC-03 | Plaintext secrets in state | Workspaces whose current state contains a confirmed plaintext credential ÷ workspaces scanned | Secrets scanner results over state snapshots | 0% | Above 0% to 5%, all rotated within 7 days | Above 5%, or any production credential not rotated within 7 days |
| IAC-04 | Platform API tokens with expiry | Organisation, team and user API tokens for the platform that have an expiry of 90 days or less ÷ all active platform API tokens | Platform token inventory export | 95% or more | 80% to below 95% | Below 80%, or any organisation-wide token with no expiry |
| IAC-05 | Single-environment apply identities | Workspaces whose apply identity can write to exactly one environment or account ÷ all workspaces | Workspace to apply identity mapping, cloud IAM policy analysis | 95% or more | 80% to below 95% | Below 80%, or any non-production workspace that can write to production |
| IAC-06 | Stored credentials marked sensitive | Workspace variables holding credentials that are flagged sensitive or write-only, so the platform never displays them after entry ÷ all workspace variables holding credentials | Workspace variable metadata export | 100% | 95% to below 100% | Below 95% |
| IAC-07 | Out-of-band production writes | Count of write events in production accounts by identities that are neither platform apply identities nor approved break-glass roles, per month | Cloud provider audit logs joined to the apply identity register | 0 unexplained | 1 to 5, each explained and reconciled | Above 5, or any unexplained event |
| IAC-08 | Production applies with independent approval | Production applies approved by someone other than the author of the change ÷ all production applies | Platform run history with approver, merge request records | 100% | 98% to below 100% | Below 98% |
| IAC-09 | Mandatory policy overrides | Production applies that proceeded after overriding a mandatory policy check ÷ all production applies | Policy engine decision logs, platform run history | Below 1% | 1% to 5% | Above 5%, or any override without a recorded reason |
| IAC-10 | Stale drift | Production workspaces with detected drift unreconciled for more than 14 days ÷ all production workspaces | Drift detection results, scheduled plan output | Below 2% | 2% to 10% | Above 10% |
| IAC-11 | Pinned and approved dependencies | Workspaces with a committed dependency lock file and every module sourced from the approved registry at a fixed version ÷ all workspaces | Repository scan of root configurations, module registry source list | 95% or more | 80% to below 95% | Below 80% |
| IAC-12 | Runner pool isolation | Runner pools that serve exactly one environment tier and hold network routes and credentials for that tier only ÷ all runner pools | Runner pool configuration, run history with runner identifiers | 100% | 80% to below 100% | Below 80%, or any pool shared by production and non-production |
Report the absolute count beside every percentage. One privileged red item (an unapproved reader of production state, a non-expiring organisation token, a development workspace that can write to production) makes the line red whatever the percentage says.
Interpreting the metrics together
- IAC-05 and IAC-12: a narrowly scoped apply identity on a runner pool shared with production still exposes production. Read scope and runner isolation together.
- IAC-07 and IAC-10: rising drift with out-of-band writes usually means engineers are fixing production by hand because the platform is slow. Treat it as a process finding as well as a security one.
- IAC-08 and IAC-09: high approval rates mean little if overrides are routine. Read them as a pair.
- IAC-01 and IAC-03: plaintext secrets in state turn every state reader into a credential holder, so a red IAC-03 raises the severity of any IAC-01 gap.
How to collect the data
Export raw rows rather than dashboard percentages. Store the exports with the findings log and record the query or report used, so the next review is calculated the same way.
- Freeze the date: agree the measurement date and take every export within one working day of it.
- Build the workspace register: list every workspace with its environment tier, owning team, apply identity, runner pool and state backend location. Most later metrics join to this register.
- Read the state backend: export the storage access policy and the platform's workspace permissions, then resolve groups to members for IAC-01. Export storage settings (encryption, versioning, deletion protection) for IAC-02.
- Scan state: run a secrets scanner over the current state snapshot of every workspace for IAC-03, in a controlled environment, keeping findings metadata only. See how to find secrets in IaC state files.
- Export platform tokens and variables: token type, scope, creator, created date and expiry for IAC-04; the sensitive or write-only flag on every credential variable for IAC-06. Never export values.
- Analyse apply identity scope: for each apply identity, list the accounts or projects where it holds write permissions, using the cloud provider's IAM policy analysis or access reports, for IAC-05.
- Query cloud audit logs: filter production write events and exclude the apply identity register and approved break-glass roles. Every remaining event goes into IAC-07 with an explanation from the team that made it.
- Pull run and policy history: production applies with author, approver and policy decision, for IAC-08 and IAC-09; scheduled plan or drift detection output for IAC-10.
- Scan repositories and runner configuration: check root configurations for committed lock files and module sources for IAC-11, and runner pool assignments, network routes and attached credentials for IAC-12.
- Sample the reds: for every red metric, check five to ten records directly in the platform or cloud console to confirm the figure is real before it reaches a report.
Red flags that need action now
- A principal reading production state who is not on the approved list, or a state backend open to all authenticated users of the cloud account.
- A production credential found in plaintext in state and not yet rotated.
- An organisation-wide platform API token with no expiry, or one belonging to a person who has left.
- A non-production workspace or runner pool that can write to production accounts.
- An unexplained write to a production account by an identity outside the apply identity register: treat it as a possible compromise (MITRE ATT&CK T1078.004 Cloud Accounts, T1578 Modify Cloud Compute Infrastructure) and follow the IaC platform compromise playbook.
- A mandatory policy override on a production apply with no recorded reason or approver.
- A state backend with versioning or deletion protection switched off, or a failed restore test.
- A module or provider sourced from an unapproved registry or an unpinned branch in a production workspace. See the IaC module and provider supply chain guide.
- Platform audit logging disabled, or platform audit events missing from the SIEM for more than 24 hours. The OWASP Top 10 CI/CD Security Risks lists insufficient logging and visibility as CICD-SEC-10.
Findings log
Keep one running log across quarters so repeat findings stay visible. Escalate a finding that is red for two consecutive quarters to the CISO, and one that recurs three times to the risk register.
| ID | Finding | Metric | Severity | Owner | Due date | Status |
|---|---|---|---|---|---|---|
| HC-IAC-01 | [n] principals outside the approved list can read production state in [backend] | IAC-01 | [Red] | [IaC platform owner] | [Date] | [Open / In progress / Closed] |
| HC-IAC-02 | [n] workspaces with plaintext credentials in state, including [n] production | IAC-03 | [Severity] | [Workspace owning team] | [Date] | [Status] |
| HC-IAC-03 | [n] apply identities with write access to more than one environment | IAC-05 | [Severity] | [Cloud IAM lead] | [Date] | [Status] |
| HC-IAC-04 | [n] unexplained production writes by [identity] | IAC-07 | [Severity] | [Cloud security lead] | [Date] | [Status] |
| HC-IAC-05 | [Finding] | [Metric ID] | [Severity] | [Owner] | [Date] | [Status] |
Remediation map
| Finding type | Where to fix it |
|---|---|
| Excess state readers, unprotected backends, platform admin sprawl | Securing the infrastructure as code platform itself |
| Plaintext secrets in state | How to find secrets in IaC state files; Secrets Management Guide |
| Non-expiring platform tokens, stored cloud keys | IaC credential security guide; Workload Identity Federation Guide |
| Cross-environment apply identities | IaC identity policy checks; Infrastructure as code platform rollout playbook |
| Out-of-band writes and stale drift | Configuration Drift and Baseline Enforcement Guide |
| Routine policy overrides | Checkov and IaC Scanners Guide (policy gate design) |
| Unpinned modules and providers | IaC module and provider supply chain guide |
| Shared or persistent runner pools | Self-hosted CI/CD Runners and Build Agents |
Related guides
- Securing the infrastructure as code platform itself: the hardening this check measures.
- Infrastructure as Code Security Guide: the discipline overview.
- IaC platform compromise playbook: response when a red flag turns out to be an attack.
- Cloud Security Maturity Model: the wider programme view.
- Cloud Security Metrics: programme-level measures that complement these platform metrics.
References
- NSA and CISA: Defending Continuous Integration/Continuous Delivery (CI/CD) Environments
- OWASP: Top 10 CI/CD Security Risks (CICD-SEC-6 Insufficient Credential Hygiene, CICD-SEC-7 Insecure System Configuration, CICD-SEC-10 Insufficient Logging and Visibility)
- NIST: SP 800-204D Strategies for the Integration of Software Supply Chain Security in DevSecOps CI/CD Pipelines
- NIST: SP 800-218 Secure Software Development Framework (SSDF) Version 1.1
- NIST: SP 800-53 Rev. 5 Security and Privacy Controls (AC-5 Separation of Duties, AC-6 Least Privilege, CM-3 Configuration Change Control, IA-5 Authenticator Management, SC-28 Protection of Information at Rest, CP-9 System Backup)
- NIST: Cybersecurity Framework 2.0 (PR.AA-05, PR.PS-01, PR.DS-01, DE.CM-09)
- CIS: Critical Security Controls v8.1 (Control 4 Secure Configuration, Control 5 Account Management, Control 6 Access Control Management, Control 8 Audit Log Management)
- MITRE ATT&CK: Modify Cloud Compute Infrastructure (T1578)
Related NHI Mgmt Group resources: Securing the infrastructure as code platform itself, Infrastructure as Code Security Guide, Workload Identity Federation Guide, CI/CD server health check.