Join our Newsletter — 33% off our NHI Course
Home› Guides› Securing the infrastructure as code platform itself: admin…
Guide Cloud Security

Securing the infrastructure as code platform itself: admin roles, runner identities, state and logs

PDF for newsletter subscribers · free to read online

← All guides
By NHI Mgmt Group, under the editorial direction of Lalit Choda Updated 14 November 2026 14 min read
On this page

An infrastructure as code platform holds standing permission to create, change and destroy your cloud estate, so whoever controls it can rewrite networks, open storage to the internet or delete production without touching a cloud console. A central IaC platform is the service that runs plan and apply on behalf of teams: a control plane with workspaces or projects, runners that execute the tool, state storage, a policy engine, module and provider sources, and the cloud identities that every apply uses. This guide is for platform engineers, cloud security architects and the owners of that service. It treats the platform as a high-value system in its own right and covers admin roles, the machine identities it holds, keys and state, its own logs, hardening and lifecycle. It does not repeat how to write secure templates or scan them; that is in the Infrastructure as Code Security Guide. It is vendor-neutral and applies to self-hosted orchestrators, managed IaC services and pipeline-based setups alike: confirm exact setting names in your own product's documentation.

Key takeaways

  • The platform is tier 0 for the cloud. Its apply identities can change everything they deploy, so its administrators and tokens deserve the same treatment as cloud organisation administrators.
  • Separate the people who write policy from the people who apply. Whoever can edit policy sets, runner pools or workspace credentials can bypass every gate the platform enforces.
  • State is a secret store. State files and plan outputs routinely contain resource attributes, connection strings and generated passwords; protect, encrypt and audit them as secrets.
  • Runners are where credentials live. A shared, long-lived runner turns one malicious module into access to every workspace that runs there.
  • Logs must leave the platform. Platform admins can change platform settings; the evidence of who approved and applied what has to be held somewhere they cannot edit.

Why the IaC platform is a high-value target

The NSA and CISA guidance Defending Continuous Integration/Continuous Delivery (CI/CD) Environments (June 2023) treats the delivery pipeline as an attack path in its own right and calls for least privilege, two-person review, short-lived credentials, signed configuration and code, and audit logs that record who committed, reviewed and deployed each change. It also warns specifically against hardcoding secrets in IaC templates. An IaC platform concentrates all of those concerns at the infrastructure layer, where a single apply can change identity policy, networking and data stores together.

The OWASP Top 10 CI/CD Security Risks gives a useful vocabulary for what goes wrong. Applied to an IaC platform:

OWASP riskHow it shows up on an IaC platformControl in this guide
CICD-SEC-1 Insufficient Flow Control MechanismsProduction applies without approval, or auto-apply on unreviewed branchesApproval and apply rules
CICD-SEC-2 Inadequate Identity and Access ManagementToo many platform admins, local accounts, no MFAAdmin roles and separation of duties
CICD-SEC-3 Dependency Chain AbuseUnpinned modules or providers pulled from public sources at run timeModule and provider sources
CICD-SEC-4 Poisoned Pipeline Execution (PPE)A pull request changes code that runs during plan with real credentialsPlan and apply identity split, runner isolation
CICD-SEC-5 Insufficient PBAC (Pipeline-Based Access Controls)Every workspace's run can reach every cloud accountPer-workspace federated identities
CICD-SEC-6 Insufficient Credential HygieneStatic cloud keys stored as workspace variablesMachine identities and keys
CICD-SEC-7 Insecure System ConfigurationOutdated control plane, public admin interface, default settingsHardening the platform
CICD-SEC-9 Improper Artifact Integrity ValidationPlan reviewed, but a different plan appliedSaved plan integrity
CICD-SEC-10 Insufficient Logging and VisibilityPlatform audit events never reach the SIEMThe platform's own logs

In MITRE ATT&CK terms, attackers most often reach the platform through valid accounts (T1078.004 Cloud Accounts) or credentials left in files (T1552.001 Credentials In Files), and a poisoned module or provider is a form of T1195.002 Compromise Software Supply Chain.

Admin roles and separation of duties

Most IaC platforms offer organisation, team and workspace or project scopes. Design the roles before onboarding teams, because unwinding broad grants later is slow.

RoleCan doShould not be able to doTypical holders
Platform ownerOrganisation settings, SSO, runner pools, audit configurationApprove production applies in team workspaces day to day2 to 3 named engineers, phishing-resistant MFA, privileged access workstation
Policy authorChange policy sets through a reviewed repositoryChange workspace credentials or runner assignmentCloud security team
Workspace maintainerWorkspace variables (non-secret), triggers, team membershipEdit policy sets, override mandatory policiesTeam leads
Applier or approverApprove and apply a reviewed plan in named workspacesApprove their own change in productionEngineers in the owning team
ReaderView runs and plansView sensitive outputs or state where the product allows separationWider engineering, auditors
  • Federate all human access: sign in only through the corporate identity provider, disable local password accounts except one sealed break-glass account, and provision team membership through groups. See the Break-Glass Account Guide.
  • Protect policy as code: keep policy sets in their own repository with branch protection and a second reviewer from the security team; the platform should load policy only from that repository. Treat a mandatory policy override as a privileged action with its own approval and an alert.
  • Two-person rule for production: the person who merges a change should not be the only approver of its production apply. The NSA and CISA guidance makes two-person review its baseline control against a single compromised account.
  • Recertify quarterly: platform owner, policy author and production approver grants, plus every API token. The Infrastructure as code platform health check gives the metrics.

Machine identities: runners, apply identities and tokens

The platform is mostly operated by non-human identities. List them explicitly, because each is a credential an attacker can use.

IdentityPurposePreferred formMain risk if mishandled
Plan identity (per workspace)Read cloud state to calculate a planFederated, short-lived, read-onlyPull requests run untrusted code with write rights (PPE)
Apply identity (per workspace)Make the changesFederated, short-lived, scoped to the workspace's accounts and resource typesOne workspace can change another team's estate
Runner registration credentialJoin a runner to a poolSingle-use or short-lived, stored in a secrets managerA rogue runner receives jobs and their credentials
Platform API tokensAutomation that creates workspaces or triggers runsTeam or service scoped, expiring, ownedLong-lived organisation token equals full platform control
Source control integrationRead repositories, post plan resultsApp installation scoped to named repositoriesRead access to all code, or write access to merge
State backend accessRead and write statePer-workspace path or bucket permissionsRead every environment's secrets in state

Keys, state and plan integrity

State is the platform's most sensitive data. It maps the whole estate and often contains values the template marked sensitive, because the tool needs them to compare desired and actual state.

  • Encrypt state at rest with a customer-managed key held in your key management service, with key use logged and the key policy limited to the platform's state service role. See Securing the cloud key management service (KMS) itself.
  • Separate state per environment and per workspace, so a non-production identity can never read production state. Turn on object versioning and locking so state can be restored and concurrent writes are refused.
  • Restrict state readers: humans should not need routine raw state access; treat each read as a sensitive event in the logs.
  • Keep secrets out of state where you can: have resources fetch secrets at run time from a secrets manager instead of passing values through variables. See the Secrets Management Guide.
  • Apply only the reviewed plan: store the saved plan as a run artefact, record its hash, and apply that artefact rather than re-planning at apply time. A change in hash between approval and apply should stop the run.
  • Pin modules and providers: mirror them into an internal registry, pin versions and verify checksums or signatures. The Software Supply Chain Security Guide covers dependency controls in depth.

Runner isolation

Runners execute provider code and any local scripts a module calls, with the apply identity loaded. NIST SP 800-204D, Strategies for the Integration of Software Supply Chain Security in DevSecOps CI/CD Pipelines, treats build and deployment stages as part of the software supply chain to be secured. For IaC runners that means:

  • Ephemeral by default: a fresh runner per job, destroyed afterwards, so nothing survives from one workspace's run to the next. The NSA and CISA guidance also calls for removing temporary resources after pipeline runs.
  • Pools per trust level: production and non-production never share a runner pool, and tier 0 workspaces (identity, organisation policy, logging accounts) get their own.
  • Egress control: runners reach the cloud APIs, the internal module registry and the state backend, not the open internet.
  • No instance-level credentials: runners on cloud instances should not carry a powerful instance role that every job inherits; block or restrict metadata service access from job processes (ATT&CK T1552.005 Cloud Instance Metadata API describes the abuse).

The Self-hosted CI/CD Runners and Build Agents guide gives host-level hardening.

The platform's own logs

Collect three layers and forward them to a SIEM the platform's administrators cannot alter:

LayerEvents to keepHigh-value alert
Platform control planeSign-ins, role and team changes, token creation, workspace variable changes, policy set changes, policy overrides, run approvals and appliesNew organisation token or platform owner; mandatory policy override; apply with no recorded approval
RunnersJob start and end, workspace, image version, outbound connectionsJob on a runner outside its assigned pool; unexpected outbound destination
Cloud audit logsEvery write by apply identities, and every write by any other identity to platform-managed accountsChange in a managed account by an identity that is not an apply identity or break-glass role

Retain platform audit events for at least as long as your cloud audit logs so an apply can be traced from commit to approval to API call. The NSA and CISA top ten misconfigurations advisory lists inadequate internal network monitoring and poor credential hygiene among the most common weaknesses its teams find; both show up on IaC platforms as missing platform logs and unrotated tokens.

Hardening the platform: a phased approach

  1. Inventory (week 1 to 2): list admins, tokens, workspaces, runner pools, state locations, cloud identities and integrations. Mark tier 0 workspaces. Do not change anything yet.
  2. Close the front door (weeks 2 to 4): enforce SSO and phishing-resistant MFA, remove local accounts except break-glass, cut platform owners to a named few, expire unowned API tokens. Test break-glass sign-in before removing anything else.
  3. Log out (weeks 3 to 5): forward control plane, runner and cloud audit logs and build the alerts above, so the next phases are observed.
  4. Replace static credentials (weeks 4 to 10): move workspaces to federated plan and apply identities in waves, non-production first. Keep the old key disabled, not deleted, for one release cycle so a failed migration can be rolled back, then delete it.
  5. Isolate runners and protect state (weeks 6 to 12): move to ephemeral pools by trust level, encrypt state with customer-managed keys, split state access per environment.
  6. Lock policy and plan integrity (weeks 8 to 14): move policy sets into a protected repository, start new mandatory policies in advisory mode for two weeks, then enforce; turn on saved plan apply.
  7. Measure and recertify (ongoing): run the health check quarterly.

Decision guidance

  • Managed service or self-hosted control plane: a managed service moves patching and availability of the control plane to the provider, but your state, tokens and audit export settings stay yours. Self-hosting gives network isolation and key custody at the cost of running and patching the control plane yourself. Either way, keep runners for tier 0 workspaces inside your own network.
  • Central platform or pipelines per team: a central platform gives one place to enforce policy and log, but becomes a single high-value target; team pipelines spread the risk but multiply the credentials to govern. Most organisations above a few teams centralise and invest in isolation.
  • Small organisations: one platform owner plus a deputy, federated identities from day one, a single protected policy repository and separate production runners is a sound minimum.
  • Large organisations: separate platform instances or organisations for tier 0 infrastructure, dedicated policy authors, and automated token expiry.

Lifecycle: buy, run, retire

  • Selection: ask for SSO and group-based roles, audit log export, short-lived federated credentials, customer-managed state encryption, policy enforcement with override logging and self-hosted runner options.
  • Operation: patch the control plane and runner images on your normal schedule; rebuild runner images regularly rather than patching in place.
  • Migration and retirement: when moving platforms, export and archive audit history, move state with integrity checks, revoke every token, federation trust and runner registration credential of the old platform, and remove its trust relationships from each cloud account. The Infrastructure as code platform rollout playbook covers onboarding on the new side.

Detection and measurement

  • Federation coverage: share of workspaces using only federated, short-lived cloud identities (target 100% in production).
  • Out-of-band writes: writes to managed accounts by identities other than apply identities or break-glass roles (target zero).
  • Policy overrides: mandatory policy overrides per 100 production applies, each with an approval.
  • Privileged population: number of platform owners and organisation-scoped tokens, trending down to the agreed minimum.
  • Runner reuse: share of production runs on fresh runners (target 100%).

Framework mapping

Control areaNIST SP 800-53 Rev. 5NIST CSF 2.0CIS Controls v8.1
Admin roles, separation of dutiesAC-2, AC-5, AC-6PR.AA-05Control 5, Control 6
Machine identities and tokensIA-5, AC-6PR.AA-01Control 5
Change approval and policy as codeCM-3, CM-5PR.PS-01Control 4, Control 16
State encryption and key managementSC-12, SC-28PR.DS-01Control 3
Module, provider and plan integrityCM-14, SI-7, SR-4PR.PS-01Control 16
Logging and monitoringAU-2, AU-6, AU-9PR.PS-04, DE.CM-09Control 8

Common failure patterns

  • Policy authors who can also apply: a single engineer able to relax a policy and apply the change it was blocking.
  • Plans with write credentials: pull request plans running with the apply identity, so any contributor can run code with production rights.
  • One organisation token in a script: created for a migration, never expired, stored in a pipeline variable.
  • Shared state bucket: every environment in one location with one access role, so a test workspace can read production secrets.
  • Long-lived shared runners: files, caches and credentials persisting between jobs from different workspaces.
  • Audit log left in the product: no export, short retention, and no way to prove who approved a damaging apply. If the platform is already suspected of misuse, follow If your infrastructure as code platform is compromised.

Practitioner checklist

  • SSO and phishing-resistant MFA enforced; only one sealed break-glass local account.
  • Platform owners limited to a named few; policy authors and production approvers are different people.
  • Policy sets loaded only from a protected, reviewed repository; overrides logged and alerted.
  • Every workspace uses federated, short-lived plan and apply identities; no stored cloud keys.
  • API tokens scoped, expiring and owned; organisation-scoped tokens reviewed quarterly.
  • State encrypted with a customer-managed key, split per environment, versioned and locked.
  • Saved plan applied with hash check; modules and providers pinned and mirrored.
  • Ephemeral runners in pools by trust level, with egress control.
  • Control plane, runner and cloud audit logs in a SIEM outside the platform admins' control.
  • Quarterly health check run and findings tracked.

Standards and references

Related NHI Mgmt Group resources: Infrastructure as Code Security Guide, Infrastructure as code platform health check, Workload Identity Federation Guide, If your infrastructure as code platform is compromised.

PDF for subscribers

Take this guide with you

Every section, table and checklist in one PDF, with links to the sources and related guides. Subscribe to our weekly NHI & AI Identity Journal and we’ll email you a download link.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

PDF Downloads for Newsletter Subscribers

Get the guide

Enter your details and we’ll email you a download link.

The full guide is free to read online. The PDF is a thank you for subscribing.

Fill in all fields marked * and tick both boxes to continue.