
Key takeaways
|
The CI/CD pipeline is the most trusted path in a software organization. It takes code from a developer’s laptop to production without a human reviewing every step. Attackers have understood this longer than most security teams have. A credential that lives in a pipeline environment variable, a build log, or a hardcoded configuration file is not just a credential. It is a key to production infrastructure that can be retrieved by anyone who can read the repository, the log output, or the artifact.
IBM’s 2026 X-Force Threat Intelligence Index documents a nearly 4x increase in large supply chain or third-party compromises since 2020, driven primarily by attackers exploiting trust relationships and CI/CD automation across development workflows and SaaS integrations. X-Force also notes that AI-powered coding tools are occasionally introducing unvetted code, increasing pressure on pipelines and supply chain integrity. The attack surface has expanded while the average developer’s mental model of where credentials can leak has not kept pace.
This post maps the four primary ways secrets escape CI/CD pipelines, the controls that close each vector, and the pipeline architecture decisions that determine whether a supply chain compromise stays contained or cascades across everything the pipeline touches.
| Building a DevSecOps pipeline and need to scope the security architecture? WebOsmotic builds CI/CD pipelines with secrets management, pipeline hardening, and supply chain security controls embedded from day one. We work with fintech, healthcare, and SaaS teams across India and the US. |
Microsoft’s Cloud Security Benchmark v2 DevOps Security guidance identifies four primary CI/CD attack vectors. Understanding the taxonomy before addressing any individual control prevents the partial remediation trap, fixing one vector while leaving the others open.
| Vulnerability | Control | Implementation priority |
| Hardcoded credentials in code | Secrets scanning at commit time (GitHub Secret Scanning, TruffleHog, Gitleaks). Pre-commit hooks that block commits with known credential patterns | High, implement before any other pipeline security control |
| Secrets in build logs | Log sanitization configuration. Register all secrets as platform secret store entries (not environment variables). Audit pipeline logs for credential patterns quarterly | High, requires both configuration and periodic audit |
| Over-permissive pipeline tokens | Apply least privilege to every pipeline token. Use per-job permission scoping in GitHub Actions. Audit token permissions against the actual operations each pipeline step performs | High, reduces blast radius of any pipeline compromise |
| Supply chain via dependencies | Pin dependencies to specific versions and verify checksums. Pin GitHub Actions to commit SHAs. Run SCA scanning on every pull request | Medium-high, required for any regulated industry or high-value target |
| Pipeline definition modification | Require PR approval for changes to pipeline definition files. Separate pipeline configuration permissions from application code permissions | Medium, reduces insider threat and compromised developer account risk |
| Insufficient environment isolation | Separate runner environments for dev, test, and production. Production secrets never accessible from non-production pipeline stages | High, prevents test environment compromise from cascading to production |
GitHub Actions is the most widely deployed CI/CD platform and the most frequently targeted. The following controls apply specifically to GitHub Actions but have equivalents in Jenkins, CircleCI, GitLab CI, and other platforms.
WebOsmotic’s DevSecOps engineering practice implements these controls as part of the initial CI/CD pipeline design for clients in fintech, healthcare, and SaaS. Secrets management architecture is scoped before the first pipeline is written, not added as a remediation after a security review.
| Ready to harden your CI/CD pipeline against the attack vectors IBM and Microsoft document? WebOsmotic builds DevSecOps pipelines with secrets management, least-privilege tokens, pipeline hardening, and supply chain security controls. We scope the security architecture before the first workflow file is written. |
What are the most common ways secrets leak from CI/CD pipelines?
Microsoft’s Cloud Security Benchmark identifies four primary vectors: exposed secrets in build logs and artifacts, compromised pipeline credentials, unauthorized pipeline modifications, and insufficient access controls. The most common initial access point documented by security researchers is hardcoded credentials in source code or configuration files committed to version control. Git history is permanent, a credential committed and deleted is still accessible in the git log. The second most common vector is secrets printed to build log output through verbose logging or debugging statements. IBM X-Force 2026 documents that attackers are exploiting these basic security gaps at dramatically higher rates, now accelerated by AI tools that identify weaknesses faster.
What is a CI/CD supply chain attack?
A CI/CD supply chain attack compromises the build or deployment pipeline rather than the application itself, allowing attackers to inject malicious code or steal credentials that affect all downstream consumers of the pipeline’s output. IBM X-Force 2026 documents a nearly 4x increase in large supply chain or third-party compromises since 2020, driven by attackers exploiting trust relationships in CI/CD automation. Microsoft’s analysis of the Trivy compromise documents the specific pattern: stolen NPM tokens are used to inject malicious preinstall hooks into legitimate packages, which republish with bumped version numbers. Teams that pin dependencies to commit SHAs and verify checksums break this attack chain.
What is secrets scanning and which tools do it?
Secrets scanning tools analyze code commits, pull requests, and repository history for known credential patterns such as AWS access key formats, API key prefixes, private key file formats, and connection string templates. GitHub’s native secret scanning runs on every push to a GitHub repository and can be configured to block pushes that contain detected patterns. TruffleHog and Gitleaks are open-source alternatives that can be integrated as pre-commit hooks or pipeline stages. Microsoft’s CI/CD pipeline guide documents secret scanning as a baseline security control alongside SAST and dependency scanning. These tools reduce the likelihood of credentials reaching version control, but they require configuration, they do not block all secrets by default.
How should GitHub Actions tokens be secured?
GitHub Actions GITHUB_TOKEN permissions should be scoped to the minimum required for each workflow using the permissions key in the workflow YAML. The default token permissions are broader than most workflows require. Per-job permission declarations reduce blast radius when a workflow is compromised. Third-party actions should be pinned to specific commit SHAs rather than mutable tags. Production deployments should use GitHub Environments with required reviewers. Cloud provider credentials should use OIDC short-lived tokens rather than long-lived access keys stored in the secrets store, OIDC eliminates the entire class of leaked long-lived credential attacks for AWS, Azure, and GCP.
What is the principle of least privilege in CI/CD pipelines?
Least privilege in CI/CD means that every pipeline token, service account, and IAM role is provisioned with only the permissions required for its specific pipeline stage, no more. The token that runs unit tests should not be able to push to a container registry. The token that builds images should not be able to modify production infrastructure. Microsoft’s Cloud Security Benchmark identifies over-permissive role assignments as one of the four primary CI/CD attack vectors, specifically because they enable lateral movement and privilege escalation when a pipeline step is compromised. Applying least privilege to pipeline tokens reduces the blast radius of a compromise from all infrastructure the pipeline can reach to only the infrastructure the compromised step requires.
How does WebOsmotic approach CI/CD security?
WebOsmotic designs the secrets management architecture before the first pipeline is written, as part of the initial infrastructure design phase. This includes: selecting the secrets store (AWS Secrets Manager, HashiCorp Vault, or platform-native), configuring secrets scanning as a pre-commit control, designing per-job token permissions for GitHub Actions or equivalent, implementing environment isolation between dev, test, and production, and documenting the dependency pinning and SCA scanning requirements. For fintech and healthcare clients, the pipeline security architecture is included in the compliance documentation alongside application-level security controls.