Silent DevSecOps: stopping secrets and critical vulnerabilities without turning security into a bottleneck
How to build secret, dependency, code, and infrastructure scanning into the developer workflow with high signal and little noise: what to block, what to only flag, exceptions with expiration dates, and metrics.
CI/CD$ trivy fs --severity CRITICAL --exit-code 1 .▍Every team knows the two extremes. On one side, security that only shows up at the end: a manual review before launch, a 300-page vulnerability report, and a slipping deadline. On the other, “automated” security that blocks every PR with dozens of medium-severity alerts — until someone turns the tool off or everyone learns to ignore it.
Silent DevSecOps is the middle ground: checks that run in the developer’s normal workflow, stop what is truly serious, stay quiet the rest of the time, and don’t require someone from the security team to approve every merge.
The principles
- Fast: security can’t double the pipeline time. Goal: a few minutes, running in parallel with everything else.
- High signal: block only what is critical and actionable. One false positive a week destroys trust in the tool.
- On what changed: the PR should show the problems it introduced, not the historical debt of the whole repository.
- In the right place: the alert shows up in the editor, on the commit, or on the PR — not in a dashboard nobody opens.
- With a way out: every rule has a documented exception path, with an owner and an expiration date.
Layer 1: secrets — stop them before the push
A secret that reaches the repository has already leaked: even if deleted later, it lives on in the history, in clones, and in caches. That’s why secrets are the only category that deserves blocking before the code leaves the machine:
# .pre-commit-config.yaml
repos:
- repo: https://github.com/gitleaks/gitleaks
rev: v8.21.2
hooks:
- id: gitleaks
Since local hooks can be skipped, add two safety nets:
- Push protection from your Git provider (such as GitHub’s push protection), which rejects pushes containing known secret patterns;
- Scanning in CI as the last filter.
And when a secret leaks anyway: revoke it first, clean up the history afterward. Rotating the credential is what closes the door.
The most effective prevention, though, is eliminating static secrets: cloud credentials via OIDC in CI, and application secrets in a vault (Vault, Secrets Manager) injected at runtime.
Layer 2: dependencies and images — block what’s critical and fixable
Most vulnerabilities come from third-party dependencies. The policy that works in practice:
| Severity | Fix available? | Action on the PR |
|---|---|---|
| Critical | Yes | Block |
| Critical | No | Warn + ticket with a deadline; monitor |
| High | Yes | Warn + ticket with a 30-day deadline |
| Medium/Low | — | Tracking dashboard only |
With Trivy, this fits in one command for the code and another for the image:
# dependencies, secrets and misconfigurations in the repository
trivy fs --scanners vuln,secret,misconfig \
--severity CRITICAL --ignore-unfixed --exit-code 1 .
# final image, before the push
trivy image --severity CRITICAL --ignore-unfixed --exit-code 1 \
ghcr.io/your-org/api:${GITHUB_SHA}
--ignore-unfixed is what makes the rule actionable: there’s no point blocking a PR over something the developer has no way to fix.
Important complements:
- Automatic updates (Dependabot or Renovate) with auto-merge for patches that pass the tests — the best way to avoid piling up vulnerabilities;
- Minimal base images, which drastically reduce the number of vulnerable packages;
- Reachability analysis, when available, to prioritize vulnerabilities in code that actually runs.
Layer 3: static code analysis — only high-confidence rules block
SAST tools (Semgrep, CodeQL, and others) produce a lot of results. To keep them from becoming noise:
- Run them only on the PR diff, compared against the main branch:
semgrep scan --config p/default --baseline-commit origin/main --error
- Split the rules into two lists: blocking (SQL injection, insecure deserialization, secrets, broken cryptography) and informational (everything else).
- Publish the results in SARIF format so they appear as annotations on the code lines in the PR.
Layer 4: infrastructure as code
Dangerous configurations — a public bucket, an unencrypted database, a security group open to the internet — are cheap to fix in the PR and expensive in production. Checkov, Trivy (misconfig), and OPA/Conftest policies cover this, the same way we use cost policies in shift-left governance.
Exceptions with expiration dates
Every policy needs an escape valve — otherwise the team builds its own (by turning the tool off). What matters is that the exception is explicit, reviewed, and temporary. In Trivy, the exceptions file accepts an expiration date:
# .trivyignore
# No impact: the vulnerable function is not used. Owner: payments-team. Ticket SEC-142.
CVE-2026-12345 exp:2027-01-31
When the date passes, the vulnerability blocks again — and the conversation happens again. Exceptions should be reviewed by someone from security (via CODEOWNERS on the exceptions file), but without blocking the rest of the PR.
The security team’s role changes
In the silent model, the security team stops being an approver and becomes a platform owner:
- Maintains rules and policies as code, in a central repository reused by every pipeline;
- Tunes rules to reduce false positives;
- Trains security champions on the product teams;
- Steps in on the truly critical cases — instead of reviewing every PR.
Metrics that show whether it’s working
- Time added to the pipeline by security checks (goal: a few minutes, in parallel);
- False positive rate of blocking rules;
- Secrets stopped before the push versus secrets found afterward;
- Mean time to remediate critical vulnerabilities;
- Active exceptions and how many expired without being addressed;
- How many times someone tried to disable or bypass the checks (a great indicator of noise).
Putting it all together in the pipeline
The checks run in parallel with the build and tests — developers no longer wait because of them. Combined with the techniques for a fast pipeline and with image signing and SBOMs, you get a pipeline under 10 minutes that blocks secrets, fixable critical vulnerabilities, and dangerous configurations — and stays silent the rest of the time.
Checklist
- Pre-commit with secret scanning and push protection enabled
- Cloud credentials in CI via OIDC, no static keys
- Blocking only critical vulnerabilities with a fix available
- SAST on the diff, with high-confidence blocking rules
- IaC policies on the PR
- Exceptions with an owner, a reason, and an expiration date
- Checks running in parallel, adding only a few minutes to the pipeline
- Noise and time-to-remediate metrics tracked
Security nobody notices until it matters isn’t weak security. It’s well-calibrated security.