A stage-by-stage blueprint for a secure CI/CD pipeline, mapped to the OWASP Top 10 CI/CD Security Risks, with the controls to add first and a rollout order.
Agix International
Agix International

A secure CI/CD pipeline does two jobs: it checks the code it ships, and it protects itself from being used as an attack path. In practice, that means protected branches and reviews, short-lived credentials, isolated build runners, security scans that block only high-confidence risks, signed artifacts, and logs of everything the pipeline does.
Many security conversations about pipelines focus on what the pipeline scans: code, dependencies, containers. That matters. But the pipeline is also one of the most privileged systems in any engineering organization. It holds cloud credentials, signing keys, and the ability to deploy to production. An attacker who controls it does not need to break into production; the pipeline will deploy their code for them.
This blueprint covers both sides. It is part of our DevSecOps guide, and it assumes you have read why DevSecOps differs from DevOps.
The OWASP Top 10 CI/CD Security Risks is a useful starting point for pipeline threat modeling. The ten risks are:
| ID | Risk | What it means in practice |
|---|---|---|
| CICD-SEC-1 | Insufficient Flow Control Mechanisms | Code can reach production without review or approval |
| CICD-SEC-2 | Inadequate Identity and Access Management | Too many people and service accounts have too much access |
| CICD-SEC-3 | Dependency Chain Abuse | Malicious or confused packages enter the build |
| CICD-SEC-4 | Poisoned Pipeline Execution (PPE) | An attacker changes pipeline steps by modifying code or configuration |
| CICD-SEC-5 | Insufficient PBAC (Pipeline-Based Access Controls) | Pipeline jobs can reach secrets and systems they do not need |
| CICD-SEC-6 | Insufficient Credential Hygiene | Secrets are hardcoded, long-lived, or exposed in logs |
| CICD-SEC-7 | Insecure System Configuration | CI servers and runners are misconfigured or unpatched |
| CICD-SEC-8 | Ungoverned Usage of 3rd Party Services | Third-party apps and plug-ins get broad access unchecked |
| CICD-SEC-9 | Improper Artifact Integrity Validation | Nobody verifies that what is deployed is what was built |
| CICD-SEC-10 | Insufficient Logging and Visibility | Pipeline activity cannot be investigated after an incident |
The blueprint below is organized by pipeline stage, with the relevant risks noted for each.
Risks addressed: CICD-SEC-1, CICD-SEC-2, CICD-SEC-4
Risks addressed: CICD-SEC-3, CICD-SEC-5, CICD-SEC-7
Risks addressed: CICD-SEC-3, CICD-SEC-6
Which scanner catches what is often misunderstood. We compare them in SAST vs. DAST vs. IAST vs. SCA, and explain how to keep findings manageable in our article on shift-left security.
Risks addressed: CICD-SEC-9
Risks addressed: CICD-SEC-5, CICD-SEC-6, CICD-SEC-9
Risks addressed: CICD-SEC-8, CICD-SEC-10
If you are starting from an unsecured pipeline, this order tackles the highest-risk gaps first:
A secure pipeline enforces review before code reaches production, uses short-lived and narrowly scoped credentials, runs builds in isolation, scans code and dependencies, signs what it builds, and logs everything it does.
It is an attack in which someone changes what a pipeline runs, for example by editing a build script in a pull request, so the pipeline executes their code with its own privileges.
OIDC lets the pipeline request short-lived credentials for each job, so there are no long-lived keys to leak or rotate.
Start by blocking exposed secrets and critical vulnerabilities that are reachable or known to be exploited. Report everything else until the team trusts the findings.
Agix International builds cloud, DevOps, and cybersecurity foundations for growing businesses in India and the GCC. If you want an outside review of your pipeline and a prioritized fix list, book a consultation.