What is DevSecOps?
DevSecOps means treating security as part of building and running software every day, with automated checks in the same pipeline that tests and deploys the code.
What changed from older ways of working?
Security moved from a gate at the end to a set of checks throughout. When a separate team reviewed software just before release, problems surfaced late, fixes were expensive and releases waited. With frequent deployment, that model breaks. DevSecOps puts fast automated checks where developers already work, in the editor, the pull request and the pipeline, and keeps human review for design decisions and high-risk changes.
Which checks belong in the pipeline?
| Stage | Check | Open-source tools |
|---|---|---|
| Commit | Secrets accidentally committed | gitleaks, trufflehog |
| Build | Dangerous code patterns | Semgrep, Bandit, gosec |
| Build | Vulnerable dependencies | OSV-Scanner, pip-audit, npm audit |
| Package | Image contents and base OS packages | Trivy, Grype |
| Infrastructure | Misconfigured IaC templates | Checkov, tfsec, ansible-lint |
| Test environment | Live probing of the running app | OWASP ZAP baseline scan |
How do I keep the checks from slowing everyone down?
Run the fast ones on every change and the slow ones on a schedule, and fail builds only on findings worth stopping for. Secret detection and dependency scans finish in seconds. Full dynamic scans can run nightly. Tune rules to cut false positives, because a pipeline that cries wolf gets bypassed. Report findings in the pull request where the author will see them, not in a separate dashboard nobody opens.
# a pipeline step that fails only on high or critical issues
gitleaks detect --no-banner --redact --source .
osv-scanner scan --recursive --format table .
trivy image --severity HIGH,CRITICAL --exit-code 1 --ignore-unfixed registry.example.net/api:${CI_COMMIT_SHA}
How should secrets be handled?
Out of the repository, out of images and out of logs. Store them in a secrets manager such as OpenBao or Vault, or at minimum in encrypted files with SOPS and age keys, and inject them at deploy time. Give each service its own credentials with the narrowest permissions it needs, and rotate them on a schedule and immediately after anyone leaves. If a secret ever lands in Git, treat it as public: rotate first, then clean the history.
Where does infrastructure fit?
Infrastructure code gets the same review and scanning as application code. Ansible roles that configure your servers, Terraform for DNS records, Kubernetes manifests and Dockerfiles all encode security decisions such as open ports, users and privileges. Linting them in the pipeline catches a world-readable key or a container running privileged before it reaches a machine. Our Infrastructure as code article covers managing servers this way.
What does a self-hosted pipeline need?
A build server, a registry and somewhere for scan databases. Running the pipeline on your own dedicated hardware keeps source code and secrets on machines you control and avoids per-minute build charges. Self-hosted runners for common Git platforms, or a full Gitea or Forgejo instance with Woodpecker, run well on ESSENTIAL-L, whose 16 make parallel builds and scans quick. Keep production on separate machines so a compromised build job cannot reach live data. Our CI runners and build farms page sizes build hosts.
Does DevSecOps cover running systems too?
Yes. Operations feed security as much as development does: patching the host and images on a schedule, collecting logs centrally, alerting on suspicious logins or new listening ports, and rehearsing incident response. Automated host checks such as Lynis, or CIS benchmark scans, catch configuration drift. Our Hardening a new dedicated server article lists the host settings to check and Incident management covers the response side.
How do I start in a small team?
With three steps that pay off quickly: secret scanning on every commit, dependency and image scanning that fails on critical issues, and automatic security updates on every server. Add the others once those run quietly. Measure progress by how quickly known vulnerabilities are fixed, not by how many findings tools report. Our Application security article covers the coding practices that reduce findings in the first place.
Who owns security in a DevSecOps team?
Everyone shares it, with clear owners for each control. Developers fix findings in the code they write, operators keep hosts and pipelines patched, and one named person curates the scanner rules, tracks exceptions and reports progress. Exceptions should expire: an accepted risk without a review date tends to become permanent. A short monthly meeting that looks at open critical findings, overdue rotations and recent incidents keeps the practice alive without turning it into paperwork.
Related pages
Application security
Keeping the software you deploy safe: common vulnerability classes, secure coding habits, dependency hygiene, testing and runtime defences on your own server.
Read moreInfrastructure as code
Describing servers, networks and services in versioned files: declarative against imperative tools, state, review workflows, drift and where rented machines fit.
Read moreCI runners and build farms
High clock Ryzen and many-core EPYC machines for CI runners, container builds and compile farms that finish faster.
Read moreHardening a new dedicated server
The first hour on a fresh machine: SSH keys, a firewall, automatic updates, brute force blocking and a habit of checking what listens.
Read moreQuestions and answers
How does DevSecOps extend DevOps?
DevSecOps adds security checks and responsibility to the DevOps practice of frequent, automated delivery, so security is handled continuously instead of at the end.
Which security check should a team add first?
Secret scanning on every commit, since leaked credentials are easy to detect and very damaging. Dependency scanning is a close second.
Can I run a CI/CD pipeline on a dedicated server?
Yes. Self-hosted runners or a Gitea or Forgejo instance run well on a multi-core server, keeping source code and secrets on hardware you control.
Where should application secrets be stored?
In a secrets manager or encrypted files, injected at deploy time. Never in the Git repository, in container images or in logs.
How do I avoid false positives blocking builds?
Fail builds only on high or critical findings, tune scanner rules for your code base, and run slower, noisier scans on a schedule instead of every commit.