Why Zero Trust Architecture Is Vital in DevSecOps
Apply NIST zero trust tenets to the delivery pipeline: OIDC for CI, signed images and SLSA provenance, workload identity, mTLS and policy as code.
Zero trust is becoming vital in DevSecOps because the delivery pipeline is now a prime target: CI runners, deploy credentials and build artifacts can all reach production. Zero trust removes standing trust from that path. Every workload, job and person proves its identity per request, gets short-lived least-privilege access, and every artifact is verified before it runs.
Most zero trust writing focuses on employee access to corporate apps. This article applies the NIST zero trust tenets to the software delivery pipeline and the clusters it deploys to, step by step. For a list of products, see our 14 zero trust security tools for DevOps teams; for the organisational hurdles, see the biggest challenges in implementing zero trust networking.
Key takeaways
- NIST SP 800-207 (August 2020) defines zero trust as removing implicit trust based on network location and making per-request access decisions. SP 800-207A (September 2023) applies it to cloud-native, multi-cloud applications.
- In DevSecOps the "users" include pipelines, runners, service accounts and workloads, not only people.
- Replace long-lived CI secrets with OIDC federation: the cloud issues short-lived credentials only to a specific repo, branch or environment.
- Treat artifacts as untrusted until verified: sign images, record provenance (SLSA), and verify signatures at admission.
- Inside clusters, use workload identity and mTLS (SPIFFE, service mesh) plus default-deny network policy.
- Policy as code makes these rules testable, reviewable and consistent across environments.
Why the pipeline needs zero trust now
Classic security drew a line around the network and trusted what was inside. DevOps erased that line. Code moves from laptops to SaaS Git hosting, through hosted or self-hosted runners, into registries and onto clusters in several clouds. Each hop is a place where an attacker can insert code or steal credentials.
Public incidents show this. In the 2020 SolarWinds compromise, attackers modified the build process so signed releases carried a backdoor. Between January and April 2021 the Codecov Bash Uploader script was altered to send CI environment variables, including credentials, to an outside server. In both cases the pipeline itself was trusted by default. Zero trust is the design response: nothing in the chain is trusted because of where it sits.
The NIST tenets, translated for DevSecOps
SP 800-207 lists seven tenets. The table maps each to pipeline and platform practice.
| NIST tenet (paraphrased) | What it means in DevSecOps | Example control |
|---|---|---|
| All data sources and computing services are resources | Runners, registries, clusters and secret stores are protected resources | Inventory of runners and deploy targets with owners |
| All communication is secured regardless of network location | No plain traffic inside clusters or between pipeline tools | mTLS between services; TLS to registries |
| Access is granted per session | Each pipeline job gets its own short-lived credential | OIDC federation instead of stored cloud keys |
| Access is decided by dynamic policy | Decisions use repo, branch, environment, workload identity and signals | Cloud trust policies on OIDC claims; admission policies |
| Integrity and security posture of assets is monitored | Runners, images and nodes are scanned and patched | Ephemeral runners; image scanning; node hardening |
| Authentication and authorization are dynamic and strictly enforced | Re-check identity on every request, not once per day | Short token lifetimes; per-request mesh authorization |
| Collect information to improve security posture | Log every deploy, policy decision and credential issue | Audit logs from Git host, cloud and cluster in one place |
Step 1: Identity for people
Start where most breaches start. Require single sign-on with strong multi-factor authentication for the Git host, CI system, cloud consoles and cluster access. Use phishing-resistant factors (FIDO2 security keys or platform passkeys) for administrators. Remove shared accounts.
- Map Git host teams to SSO groups so leaving the company removes access everywhere.
- Protect main branches: required reviews, required status checks, no force pushes.
- Use just-in-time elevation for production access instead of permanent admin roles.
Step 2: Identity for pipelines (no more stored cloud keys)
A long-lived cloud access key stored as a CI secret is the opposite of zero trust: anyone who can read it can use it, from anywhere, until someone rotates it. OIDC federation replaces it.
With GitHub Actions, each job can request a signed JWT from GitHub's OIDC provider. The cloud provider checks the token's claims, such as the sub claim that names the repository and environment, against a trust policy, and returns credentials that last only for the job. GitHub's documentation states that without the id-token: write permission the job cannot request the token.
name: deploy
on:
push:
branches: [main]
permissions:
id-token: write
contents: read
jobs:
deploy:
runs-on: ubuntu-latest
environment: prod
steps:
- uses: actions/checkout@v7
- uses: aws-actions/[email protected]
with:
role-to-assume: arn:aws:iam::123456789012:role/deploy-prod
aws-region: ap-south-1
- run: aws sts get-caller-identity
On the AWS side, the IAM role's trust policy should accept only tokens whose sub matches this repository and the prod environment, for example repo:my-org/payments:environment:prod. A fork, another branch or another repository gets nothing. GitLab CI, Azure DevOps and Google Cloud support the same federation pattern.
Harden the runners too
- Prefer ephemeral runners that are destroyed after one job, so a compromised job cannot persist.
- Never run untrusted pull requests from forks on self-hosted runners with access to secrets.
- Pin third-party actions to a full commit SHA rather than a moving tag.
- Set default workflow token permissions to read-only and grant more per job.
Our article on secret scanning tools covers catching credentials that still slip into repos.
Step 3: Verify artifacts, not just people
Zero trust applies to what you deploy as much as to who deploys it. An image in your registry is not trustworthy just because it is there.
- Generate an SBOM for each image so you know what is inside.
- Sign the image in CI. Sigstore's cosign supports keyless signing tied to the CI job's OIDC identity, so there is no signing key to steal.
- Record build provenance describing which source, workflow and builder produced the artifact. The SLSA framework (specification v1.2 is current) defines build levels for this.
- Verify at deploy time. An admission controller rejects images that are unsigned or signed by the wrong identity.
Verifying a keyless signature checks both who signed and which OIDC issuer vouched for them:
cosign verify ghcr.io/my-org/payments:1.4.2 \
--certificate-identity-regexp='^https://github.com/my-org/payments/' \
--certificate-oidc-issuer=https://token.actions.githubusercontent.com
In the cluster, Kyverno's image verification policies or Sigstore's policy-controller enforce the same check on every pod. See container registry security practices for the registry side.
Step 4: Workload identity and mTLS inside the cluster
Inside Kubernetes, IP addresses change constantly, so they make poor identities. Zero trust uses cryptographic workload identity instead.
- SPIFFE and SPIRE (both CNCF graduated) issue short-lived identity documents to workloads, so services can authenticate each other across clusters and clouds.
- Service meshes such as Istio and Linkerd give each workload a certificate and encrypt traffic with mTLS automatically. Mesh authorization policies then allow calls only between named service accounts.
- Kubernetes service account tokens are projected, audience-bound and time-limited. Cloud workload identity features map them to cloud roles, so pods do not need stored cloud keys either.
A default-deny NetworkPolicy adds a second layer underneath the mesh:
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: default-deny
namespace: payments
spec:
podSelector: {}
policyTypes:
- Ingress
- Egress
Then add narrow allow rules for each real dependency, including DNS. SP 800-207A recommends combining identity-based policies at the application layer with network-level segmentation, which is exactly this pairing. Our post on sidecar containers in service mesh deployments covers the mesh trade-offs.
Step 5: Policy as code as the decision point
NIST describes a policy decision point and policy enforcement points. In a DevSecOps stack those map well to policy engines:
| Decision | Where enforced | Tool examples |
|---|---|---|
| Can this job assume this cloud role? | Cloud IAM trust policy | AWS IAM, Azure federated credentials, Google Workload Identity Federation |
| Is this IaC change allowed? | CI and Terraform run | Checkov, Conftest, Sentinel |
| Can this pod run? | Kubernetes admission | Kyverno, OPA Gatekeeper, ValidatingAdmissionPolicy |
| Can service A call service B? | Service mesh proxy | Istio AuthorizationPolicy, Linkerd authorization policy |
Our comparison of policy-as-code tools by enforcement point helps choose between them.
Step 6: Secrets that expire
Where secrets cannot be removed, make them short-lived. Secret managers such as HashiCorp Vault can issue dynamic database credentials per workload with a lease, and revoke them when the lease ends. Cloud secret managers support automatic rotation. Store references to secrets in Git, never values.
Step 7: Log, detect and keep improving
The last tenet is continuous improvement from collected data. Send these to one place and alert on anomalies:
- Git host audit logs: permission changes, branch protection changes, new deploy keys.
- Cloud audit logs: role assumptions by pipelines, especially from unexpected repos or regions.
- Kubernetes audit logs and admission denials.
- Runtime detection (for example Falco) for unexpected processes or network connections in containers.
Why regulated industries push hardest
Finance, healthcare and government buyers ask vendors to show how software is built and who can change it. US Executive Order 14028 (May 2021) directed federal agencies toward zero trust architectures and software supply chain security, and the controls above produce the evidence auditors ask for: signed artifacts, provenance, access logs and policy decisions. Indian organisations working with regulated customers face similar questionnaires, so these controls are increasingly part of vendor due diligence.
A practical rollout order
- SSO and MFA everywhere; branch protection on main.
- OIDC federation for all cloud deploys; delete stored cloud keys.
- Ephemeral runners and read-only default tokens.
- Image signing and admission verification, starting in audit mode.
- Default-deny network policy per namespace, then mTLS.
- Central audit logging and alerting.
Our DevSecOps training in Pune covers OIDC, signing and admission policy with labs, and the CKS course covers cluster hardening. Both run in our Kharadi classroom and live online.
Frequently asked questions
What is zero trust in DevSecOps?
It is applying "never trust, always verify" to the delivery pipeline: every person, job, workload and artifact is authenticated and authorised per request with least privilege.
Which standard defines zero trust architecture?
NIST SP 800-207, published in August 2020. SP 800-207A, published in September 2023, covers cloud-native applications in multi-cloud environments.
How does OIDC help CI/CD security?
It replaces stored cloud keys with short-lived credentials that the cloud issues only when a job's token matches a trust policy for a specific repo, branch or environment.
Is a service mesh required for zero trust?
No, but it is a common way to add workload identity and mTLS inside Kubernetes. SPIFFE/SPIRE or application-level TLS are alternatives.
How do signed images support zero trust?
Admission controllers verify the signature and signer identity before a pod runs, so images that were tampered with or built outside the trusted pipeline are rejected.
Where should a team start?
With SSO and MFA for all tools, branch protection, and replacing long-lived CI cloud keys with OIDC federation. These give the largest risk reduction for the effort.
Does zero trust slow down delivery?
Done well, it removes manual approvals by automating checks. Start new policies in audit mode so teams can fix issues before enforcement.
References
What's Your Reaction?
Like
0
Dislike
0
Love
0
Funny
0
Angry
0
Sad
0
Wow
0