Cloud VPS from $1.98/mo · pay with Bitcoin, Ethereum, Monero, USDT or Solana · paid in crypto
Security

DevSecOps for small teams: add security checks to CI

Add security checks to CI without a security team: secret scanning, dependency and image scans, static analysis, IaC checks, SBOMs and a locked-down pipeline.

CloudSat teamNovember 18, 20266 min read
Abstract illustration of a conveyor of glowing code blocks passing through a series of small scanning arches
On this pageThe checks, in pipeline order

DevSecOps means building security into the way software is delivered instead of adding a security gate at the very end. For a team without a dedicated security engineer, it comes down to two things: a handful of automated checks that run on every change and fail the build on serious findings, and a few rules that keep the pipeline itself from becoming the way in. 2025 made the second part hard to ignore. In March, a compromised version of the widely used tj-actions/changed-files GitHub Action dumped CI secrets into workflow logs. In September, the self-propagating Shai-Hulud malware spread through npm packages by stealing maintainers' publishing tokens.

The checks, in pipeline order

Stage Check Open-source tools Fail the build when
Before commit Secret scanning gitleaks, TruffleHog Any secret is found
Build Dependency scanning OSV-Scanner, Trivy A high or critical vulnerability has a fix available
Build Static analysis (SAST) Semgrep, Opengrep, CodeQL A high-confidence finding appears in new code
Build Infrastructure as code Trivy, Checkov A rule such as "container runs as root" fails
Package Image scanning Trivy, Grype A critical vulnerability with a fix is in the image
Package SBOM Syft, Trivy Never: store it with the release
Release Signing Sigstore cosign An unsigned artifact reaches deployment
Staging Dynamic scan ZAP baseline scan A new high-risk alert appears

You do not need all eight on day one. Secrets, dependencies and images catch the most for the least effort, so start there.

Start with secrets

A leaked credential is the quickest route from a repository to production. Run gitleaks before commits reach the server and again in CI, because hooks can be skipped:

gitleaks git --redact -v .
gitleaks dir --redact ./config

The git mode scans commit history and the dir mode scans files on disk; --redact keeps the secret itself out of the output and the CI log. When a real secret is found in a pushed commit, rotate it first and clean the history second. Once a secret has left a laptop, treat it as known to others.

Dependencies: the biggest attack surface

Most of the code you ship was written by someone else. Scan the lockfiles on every build:

osv-scanner scan source -r .

Then make installs reproducible and less exposed:

  • Commit lockfiles and install exactly what they list: npm ci, pip install --require-hashes -r requirements.txt, or your ecosystem's equivalent.
  • Add --ignore-scripts to npm ci where the project allows it. Install-time scripts are a favorite entry point for malicious packages.
  • Automate updates with Dependabot or Renovate, and give new releases a short waiting period before adoption. Renovate's minimumReleaseAge setting does this, which gives the registry and the community time to catch and remove a hijacked version before it reaches you.

Static analysis without drowning in noise

SAST tools read your source for injection flaws, unsafe deserialization and similar patterns. The risk is noise: a first scan on an old codebase can report hundreds of findings, and a team that sees hundreds of warnings ignores all of them. Scan only what changed:

semgrep scan --config p/default --baseline-commit "$(git merge-base origin/main HEAD)" --error

--baseline-commit reports only findings introduced since the branch point, and --error turns them into a failing exit code. Opengrep is a community fork of the Semgrep engine with the same rule format, and GitHub's CodeQL is free for public repositories. Whichever you use, start with a small rule set and add rules once the first ones run clean.

Containers and infrastructure code

Scan the image you are about to ship, not just the source:

trivy image --severity HIGH,CRITICAL --ignore-unfixed --exit-code 1 registry.example.com/app:1.4.2
trivy config --exit-code 1 ./deploy
syft registry.example.com/app:1.4.2 -o cyclonedx-json > sbom.cdx.json

The first command fails on serious vulnerabilities that already have a fix, which keeps the build actionable. The second checks Dockerfiles, Compose files, Kubernetes manifests and Terraform for risky settings. The third writes a software bill of materials (SBOM), an inventory of every package in the image. When the next widely exploited library flaw is announced, the SBOM tells you in minutes whether you ship it.

Build on small base images, pin them by digest, and run containers as a non-root user. Each removes a whole class of findings before any scanner runs.

Lock down the pipeline itself

The CI system holds deploy keys and cloud credentials, which makes it a target in its own right.

  • Pin third-party actions to a full commit SHA, not a tag. Tags can be moved to malicious code, which is exactly what happened with tj-actions/changed-files. Dependabot can keep SHA pins current.
  • Grant the workflow token read-only access by default and raise it per job only where needed:
permissions:
  contents: read
  • Protect the main branch. Require passing checks and an approving review before merge, and block direct pushes.
  • Scope secrets to environments, so a pull-request build cannot read production credentials. Where your cloud supports it, exchange a short-lived OpenID Connect token for access instead of storing long-lived keys.
  • Keep self-hosted runners away from public repositories. A pull request from a fork could run arbitrary code on them.

If you run your own forge or runners, for example GitLab or Gitea on a CloudSat server, treat that server like production: it holds the keys to everything you deploy.

A rollout plan that sticks

Turning everything on at once produces a red pipeline and a team that learns to ignore it. Spread the work over a month:

  1. Week one: secret scanning in pre-commit hooks and CI, plus read-only workflow tokens.
  2. Week two: dependency scanning that blocks only on fixable critical issues, and automated update pull requests.
  3. Week three: image scanning and SBOM generation in the release job, with actions pinned to commit SHAs.
  4. Week four: incremental static analysis on new code, and a nightly full scan that opens tickets instead of failing builds.

Raise the bar only when the current checks pass on most builds.

Rules for the humans

Tools only help when the team agrees what a finding means. Write down three rules:

  1. What blocks a merge: for example, any secret, and any critical or high vulnerability with an available fix.
  2. How fast the rest gets fixed: a target per severity, tracked like any other bug.
  3. How exceptions work: an ignore entry needs a reason, an owner and an expiry date, written next to it in the ignore file.

Track two numbers over time: how long critical findings stay open, and how many high findings are open today. If both fall, the program works.

FAQ

Do we need a commercial security platform?

Not to start. The open-source tools above cover secrets, dependencies, code, images and infrastructure. Commercial platforms add dashboards, triage workflows and support, which become worth paying for as the number of repositories grows.

Will these scans slow down every build?

Secret, dependency and incremental SAST scans usually take seconds to a few minutes. Run those on every push, and schedule full-history scans and dynamic tests nightly.

Why bother with an SBOM if nothing reads it?

Because the day a critical vulnerability is announced in a popular library, someone will ask whether you are affected. With SBOMs stored for every release, the answer is a search instead of an investigation.

Run it on CloudSat. Cloud VPS on AMD EPYC and NVMe from $1.98/mo in 13 regions, delivered in under 5 minutes and paid in crypto. See plans or deploy a server.