← all work

Zero-trust CI/CD: no stored keys, only signed images ship

GitHub Actions hardened with OIDC federation to AWS and Azure, 15-minute credentials scoped to one repository and environment, CycloneDX SBOMs, and Sigstore Cosign signatures verified before deployment.

Role
Pipeline design, Terraform and supply-chain security
Period
2026
Status
Public reference implementation
  • GitHub Actions
  • OIDC
  • AWS IAM / STS
  • Entra ID
  • Terraform
  • Sigstore Cosign
  • CycloneDX SBOM
  • GHCR
Problem
Long-lived cloud credentials in CI secrets leak through pull-request injection, debug logs and compromised runners, and carry broad privileges.
Key decision
Federate GitHub OIDC tokens with AWS and Entra ID trust policies that match the exact repository and protected environment, and gate deployment on a verified Cosign signature.
Result
No static cloud secrets in the pipeline, credentials that expire after 15 minutes, and images that cannot be deployed unless their signature verifies.

Architecture

Zero-trust CI/CD architecturePROTECTED PRODUCTION ENVIRONMENTCLIDeveloperpush / tagCIGitHub Actionssecure-deploy.ymlEXTGitHub OIDC issuertoken.actions.githubuserc…SECAWS STS / Entra IDtrust: exact repo + envir…DBGHCR + Sigstoresigned digest · CycloneDX…SVCCloud targetleast-privilege deployer…Zero-trust CI/CD architectureCLIDeveloperpush / tagEXTGitHub OIDC issuertoken.actions.githubusercontent.comCIGitHub Actionssecure-deploy.ymlSECAWS STS / Entra IDtrust: exact repo + environmentDBGHCR + Sigstoresigned digest · CycloneDX SBOMSVCCloud targetleast-privilege deployer role
The runner never holds a cloud key. It exchanges a GitHub OIDC token for 15-minute credentials, and only images that are scanned, given an SBOM and signed with Cosign are deployed. Hover, tap or tab through the components; control flows are dashed.
Components and flows as text
ComponentKindTechnologyFlows out
Developerclientpush / tag⇢ GitHub Actions: commit
GitHub Actionspipelinesecure-deploy.yml⇢ GitHub OIDC issuer: request JWT; ⇢ AWS STS / Entra ID: exchange JWT; → GHCR + Sigstore: push signed image; ⇢ Cloud target: deploy after verify
GitHub OIDC issuerexternal servicetoken.actions.githubusercontent.com—
AWS STS / Entra IDsecret storetrust: exact repo + environment⇢ GitHub Actions: 15-min credentials
GHCR + Sigstoredatastoresigned digest · CycloneDX SBOM—
Cloud targetserviceleast-privilege deployer role—

Trust boundaries: Protected production environment (GitHub Actions).

Decisions

  1. D-01accepted

    OIDC federation instead of access keys

    The runner requests a GitHub-signed JWT and exchanges it with AWS STS or Entra ID for short-lived credentials. The trust policy requires the exact repository and the protected production environment.

    Options considered

    • Access keys in repository secrets: simple, long-lived, and readable by any compromised step.
    • Federated identity scoped by claims.

    Trade-off accepted

    Trust policies must be maintained per repository and environment.

    terraform/ ↗

  2. D-02accepted

    Sign, attest and verify before deploy

    Each build produces a CycloneDX SBOM; the image digest is signed and attested keylessly with Cosign and verified against the workflow identity before the deploy step runs.

    Options considered

    • Trust the registry: anyone with push access can ship.
    • Verify provenance cryptographically.

    Trade-off accepted

    Adds steps and a dependency on Sigstore infrastructure.

    secure-deploy.yml ↗

Failure modes

FailureDetectionHandlingEvidence
A fork or another branch tries to assume the deploy roleSTS rejects the token because the subject claim does not matchTrust is bound to repository and environmentterraform/
A tampered image is pushed to the registrycosign verify failsThe deploy step never runssecure-deploy.yml

What I would change next

  • Enforce signature verification in-cluster with an admission controller.

Evidence index

Links point to the public repository.