Certificates as Code is the operational model where certificate configuration, issuance rules, and renewal logic are defined in version-controlled code and managed through APIs. It treats certificates like infrastructure assets, enabling repeatable governance, automated deployment, and continuous monitoring across cloud, container, and pipeline environments.
Expanded Definition
Certificates as Code applies software delivery discipline to certificate lifecycle management: issuance profiles, policy constraints, renewal triggers, trust anchors, and revocation handling are expressed in version-controlled code and executed through APIs. In NHI security, that matters because certificates are not just encryption artefacts; they are machine identities that authenticate workloads, pipelines, and service-to-service connections. The model overlaps with infrastructure as code, but it is narrower in scope and more operationally sensitive because certificate drift can break trust at runtime.
Industry usage is still evolving. Some teams use the phrase to mean only automated renewal, while others include policy-as-code, inventory, and observability for every certificate chain. NHI Management Group treats the broader interpretation as the safer one because certificate control failures often begin upstream in code review, template management, or hidden defaults. For governance, this approach aligns well with NIST Cybersecurity Framework 2.0 by making identity-related controls repeatable and auditable across environments.
The most common misapplication is treating certificate renewal as the whole problem, which occurs when teams automate expiry dates but leave issuance policy, ownership, and revocation logic unmanaged.
Examples and Use Cases
Implementing Certificates as Code rigorously often introduces stricter change control and tighter coupling between security and delivery pipelines, requiring organisations to weigh repeatability and auditability against reduced ad hoc flexibility.
- A platform team stores certificate templates in Git, then uses pull requests to approve changes to validity periods, key sizes, and subject naming rules.
- A CI/CD pipeline requests short-lived certificates automatically for build agents, reducing manual issuance and lowering the chance of stale credentials.
- A Kubernetes environment uses declarative manifests to renew service certificates before expiry, preventing outages caused by expired trust material.
- An enterprise compares certificate ownership records against its machine identity inventory, using the Ultimate Guide to NHIs — What are Non-Human Identities as a baseline for lifecycle governance.
- A security team investigates a failure pattern similar to the Sisense breach, where weak machine identity controls made certificate and secret exposure materially more dangerous.
For implementation guidance, many teams map the operational flow to certificate lifecycle expectations in NIST Cybersecurity Framework 2.0, then enforce the same rules across cloud, container, and pipeline estates.
Why It Matters in NHI Security
Certificates are one of the most failure-prone forms of machine identity because they expire, proliferate quickly, and are often owned by multiple teams with inconsistent processes. When they are not managed as code, organisations inherit hidden drift: one certificate may be renewed manually, another may be embedded in a pipeline, and a third may be provisioned outside formal inventory. That fragmentation increases outage risk, weakens revocation readiness, and makes audit evidence difficult to assemble. It also undermines zero trust by allowing trust relationships to persist without a clear policy source of truth.
NHI Management Group research shows how serious the operational gap can be: 57% of organisations lack a complete inventory of their machine identities, and 53% have experienced a security incident directly related to machine identity management failures. Those numbers explain why certificate governance cannot be an afterthought. They also show why automated renewal alone is insufficient when ownership, revocation, and visibility remain manual. Organisations typically encounter the cost only after an expired certificate or compromised workload causes a service outage or security incident, at which point Certificates as Code becomes operationally unavoidable to address.
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 and OWASP Agentic AI Top 10 address the attack and risk surface, while NIST CSF 2.0, NIST Zero Trust (SP 800-207) and NIST SP 800-63 set the governance and control requirements practitioners need to meet.
| Framework | Control / Reference | Relevance |
|---|---|---|
| OWASP Non-Human Identity Top 10 | NHI-02 | Covers machine identity and secret lifecycle weaknesses that Certificates as Code is meant to reduce. |
| NIST CSF 2.0 | PR.AC-1 | Identity and access controls depend on trustworthy certificate issuance and lifecycle management. |
| NIST Zero Trust (SP 800-207) | SP 800-207 core principle | Zero trust requires continuous verification of machine identities backed by controlled certificates. |
| NIST SP 800-63 | AAL2 | Assurance concepts help frame certificate strength, binding, and lifecycle rigor for NHI authentication. |
| OWASP Agentic AI Top 10 | A08 | Agentic and automated systems often consume certificates through pipelines and tool access paths. |
Version-control certificate policy, automate renewal, and audit ownership to prevent unmanaged machine identity drift.
Related resources from NHI Mgmt Group
- What breaks when code signing certificates are left to manual renewal?
- Why do code-signing certificates need stricter lifecycle controls than ordinary certificates?
- How should organisations govern code signing certificates for software releases?
- What breaks when code-signing certificates are resold or reused by attackers?