Pipeline Hardening for DevSecOpss
Pipeline hardening secures the CI/CD system itself, since it holds credentials and can deploy to production. It means isolating and updating runners, giving jobs short-lived least-privilege credentials, protecting secrets, requiring reviews for pipeline changes and expressing rules as policy as code with tools such as Open Policy Agent.
Stage: Pipeline and Supply Chain · Part of the DevSecOps roadmap · Last reviewed 19 November 2026
What to learn in Pipeline Hardening
- Use ephemeral runners and limit what each job can access
- Replace long-lived keys with short-lived OIDC credentials
- Pin third-party actions or plugins to a commit hash
- Protect secrets from exposure in logs and forks
- Write an OPA or Conftest policy that blocks a risky configuration
- Require approvals for pipeline definition changes
Pipeline Hardening interview questions
Why is the CI system a high-value target?
It holds secrets, builds the code that ships and often has rights to deploy to production. Compromising it lets an attacker insert malicious code or steal credentials, so it needs isolation, least privilege and strong change control.
What is policy as code?
Policy as code writes rules, such as no public storage buckets or no privileged containers, in a machine-readable language like Rego. Tools evaluate them automatically in pipelines or admission controllers, so rules are versioned, tested and consistently enforced.
Where Pipeline Hardening fits in the DevSecOps roadmap
Pipeline Hardening belongs to the Pipeline and Supply Chain stage (intermediate level), which takes about 6 hours. Trust what you build.
Other units in this stage
Back to the full DevSecOps roadmap