devops / devsecops
DevSecOps: Securing the Pipeline and the Software Supply Chain
A guide for the engineer who owns the pipeline: which scanner belongs at which stage, how a CI workflow itself gets attacked, and what signing, SBOMs and SLSA add. Licenses and free-tier limits were checked on each project's own pages in October 2026.
DevSecOps is often described as "shifting security left", meaning problems are caught while the code is still being written instead of after release. This page takes the platform engineer's view of that idea. You do not write the application, but you own the pipeline that builds and ships it, which gives you two jobs. First, put the right automated checks at the right stage so findings reach developers fast. Second, protect the pipeline itself, because a CI system holds deploy credentials and runs code from many sources, which makes it an attractive target. If your goal is to test an application's behavior for security bugs by hand, that is a different discipline, covered on the QA security testing page.
01 · SCANNER PLACEMENT
Which scan runs where, and what it can and cannot find
| Stage | Scan type | Looks for | Free options |
|---|---|---|---|
| Before commit and on every push | Secret detection | Passwords, API keys and tokens in code and git history | Gitleaks (MIT license), which also ships a pre-commit hook; GitHub secret scanning, which runs automatically for free on public repositories |
| On pull request | Static analysis (SAST) | Bug patterns in your own source code | CodeQL, available on public GitHub repositories; Semgrep (LGPL-2.1) |
| On pull request and on a schedule | Dependency analysis (SCA) | Known, publicly disclosed vulnerabilities in the libraries you use | Dependabot alerts; OWASP Dependency-Check |
| After the image build | Container and config scan | Vulnerable packages in the image, plus misconfigurations and secrets | Trivy (Apache-2.0), which lists containers, Kubernetes, repositories and clouds as targets |
| Against a deployed test environment | Dynamic scan (DAST) | Missing headers, insecure cookies and similar issues in a running app | ZAP baseline scan (Apache License 2.0), a passive scan that its docs say is designed for CI |
Two limits are worth stating. Scanners report possibilities, not proof: SAST tools produce false positives, and SCA reports a vulnerable library even when your code never calls the vulnerable function. Also, none of these replaces a person thinking about how the application can be abused. Start with secret detection and dependency alerts, because they have the highest signal and the lowest noise, then add SAST once the team will actually triage results.
CodeQL's availability is narrower than it looks. GitHub's documentation lists public repositories on GitHub.com, and organization-owned repositories on Team or Enterprise plans with GitHub Code Security enabled. Private repositories on a personal free account are not on that list.
02 · ATTACKS ON THE PIPELINE
A workflow is code with credentials: three failure modes
Mutable action references. In March 2025 the third-party action tj-actions/changed-files was compromised (CVE-2025-30066). CISA's alert says the compromise allowed disclosure of secrets including access keys, personal access tokens, npm tokens and private RSA keys, and that a compromise of reviewdog/action-setup (CVE-2025-30154) may have enabled it. GitHub's secure-use guide recommends pinning actions to a full-length commit SHA, noting that an attacker would need a SHA-1 collision to forge a valid object. The same page now says a workflow dependency lockfile is the strongest protection and supersedes SHA pinning for repositories that adopt it.
# In the workflow: a full commit SHA, with the version as a comment - uses: actions/checkout@<full-length-commit-sha> # v7.0.1 # .github/dependabot.yml: let Dependabot propose action updates version: 2 updates: - package-ecosystem: github-actions directory: / schedule: interval: weekly
GitHub's guide describes Dependabot version updates as the way to keep action references current, which removes the usual objection that pinned SHAs go stale.
Script injection. If a workflow pastes untrusted text, such as a pull request title, straight into a shell script, the author of that text can run commands on your runner. GitHub's guidance is to pass the value through an intermediate environment variable instead of expanding it in the script:
# Risky: the expression is expanded into the shell script itself - run: echo "Title: ${{ github.event.pull_request.title }}" # Safer: the value arrives as data in an environment variable - env: TITLE: ${{ github.event.pull_request.title }} run: echo "Title: $TITLE"
Untrusted code with trusted permissions. The same guide warns that the pull_request_target and workflow_run triggers, combined with checking out untrusted pull request code, expose a repository to security risks, because those triggers run with more privileges than a normal pull_request run. Avoid combining them unless you have read the linked guidance.
03 · CREDENTIAL HYGIENE
Fewer long-lived keys: tokens, OIDC and the leaked-secret drill
The cheapest security win in most pipelines is deleting standing credentials. GitHub's OpenID Connect support lets a workflow exchange a short-lived token directly with a cloud provider, so you no longer duplicate cloud credentials as long-lived GitHub secrets. Set up the trust relationship on the cloud side, then have the workflow request a token at run time. Pair that with a read-only default for GITHUB_TOKEN, which GitHub's guide recommends, and raise permissions for individual jobs only where needed.
gitleaks git to find others.04 · SUPPLY CHAIN
Signing, SBOMs and SLSA in plain terms
| Term | What it is | Practical use |
|---|---|---|
| SBOM | A software bill of materials: a list of the components inside a build. CycloneDX and SPDX are the two best-known formats. | When a new vulnerability is announced, search your SBOMs to learn which products contain the library |
| Sigstore | An open source project for signing and verifying software artifacts such as container images and SBOMs, using ephemeral signing keys so there are no long-term keys to manage | Sign images in CI; verify before deploy |
| SLSA | "Supply-chain Levels for Software Artifacts": incrementally adoptable guidelines for supply chain security, set by industry consensus | A maturity ladder for build integrity and provenance |
| NIST SSDF (SP 800-218) | The Secure Software Development Framework from NIST | A catalog of secure-development practices to map your pipeline controls against |
You do not need all four on day one. A realistic order is: pin and update actions, add secret detection, turn on dependency alerts, scan the built image, then generate an SBOM and sign images. Each step is useful alone, and you can describe the one you stopped at honestly in an interview.
05 · FREE LEARNING
Guides and official documentation
- OWASP DevSecOps Guideline ↗A vendor-neutral guide to security controls across a delivery pipeline, aimed at teams of any size.owasp.org
- GitHub Actions secure use reference ↗Pinning, token permissions, script injection and untrusted-input guidance from the platform vendor.docs.github.com
- OpenID Connect in GitHub Actions ↗How short-lived cloud tokens replace stored secrets.docs.github.com
- CISA alert: tj-actions/changed-files compromise ↗A government write-up of a real pipeline supply-chain attack and what leaked.cisa.gov
- OpenSSF Scorecard ↗An automated check of a repository's security practices, including pinned dependencies and token permissions.github.com
- About SLSA ↗What the supply-chain levels are and why they exist.slsa.dev
- Sigstore overview ↗How signing and verification with ephemeral keys works for images and binaries.docs.sigstore.dev
- Gitleaks ↗The secret scanner used in the table above, with pre-commit setup instructions.github.com
- Snyk Learn ↗Interactive secure-development lessons on individual vulnerability types.learn.snyk.io
06 · PRACTICE
Audit a workflow you already have
uses: line that points at a tag instead of a SHA. Add the Dependabot configuration above. Search the files for ${{#123;{ inside run: blocks and move anything that comes from user input into an env: variable. Then run gitleaks git against the repository history. Write down what you found; that list is the start of a real security backlog.07 · FAQ
Frequently asked questions
What is DevSecOps?
DevSecOps builds security checks into the same automated pipeline that builds and ships software, so vulnerabilities are found while code is being written and reviewed rather than after release. It also covers securing the pipeline itself, since CI systems hold deploy credentials.
What does shift left mean in security?
Shift left means moving security checks earlier in the development timeline, toward the developer's keyboard and the pull request, instead of leaving them to a late audit. Findings are cheaper to fix when the author still remembers the code.
Which security scanners should I add to a pipeline first?
Start with secret detection and dependency vulnerability alerts, which give the most useful findings with the least noise. Add container image scanning after the build, then static analysis once the team will triage the results.
Should I pin GitHub Actions to a commit SHA?
For third-party actions, yes. GitHub recommends a full-length commit SHA because tags can be moved, and Dependabot can keep the pinned versions up to date. GitHub now also describes workflow dependency lockfiles as the strongest option.
What is an SBOM?
A software bill of materials is a list of the components inside a piece of software. When a new library vulnerability is announced, SBOMs let you find which of your products include it. CycloneDX and SPDX are two common formats.