DevSecOps Pipeline: Automated Gates from Commit to Admission
How automated security gates—pre-commit secret scanning, SAST, SCA, IaC checks, Trivy, Cosign signing, and Kyverno admission—protect production without manual bottlenecks.
Intent
Turn security from a manual pre-release meeting into automated, blocking code gates ordered from fastest (pre-commit and SAST) to last-mile enforcement (Kyverno admission control and runtime detection).
Problem
Manual security sign-offs before release either slow delivery to a crawl or get bypassed under deadline pressure. Conversely, turning on every scanner in "warn-only" mode creates a wall of red alerts that everyone ignores.
Solution
Layer controls at four checkpoints so each catches what the previous layer cannot see:
- Pre-commit & fast PR checks (seconds):
gitleaksblocks secrets before they hit Git history; linters, SAST (Semgrep), SCA (trivy fswith--ignore-unfixed), and IaC scanners (checkov/trivy config) block high-severity issues early. - Build, SBOM & signing (minutes): Build an immutable image, scan OS/app packages with
trivy image, generate a CycloneDX SBOM (Syft), and sign thesha256:digest with Cosign. - Admission control (deploy time): Kyverno verifies the Cosign signature, rejects
:latesttags, and enforces non-root + resource limits before a Pod schedules—covering even out-of-bandkubectlchanges. - Runtime detection (continuous): Falco and cluster audit logs watch for unexpected shells, privilege escalation, or anomalous egress and alert the SIEM.
Real-world analogy
▶ Flow: watch it work
DevSecOps Pipeline Gates: Commit to Admission
Press Start or tap any step dot to trace the path.
▸All steps (5)
Structure
Example CI image scan and signing commands:
# Scan filesystem dependencies and container image for actionable CVEs (not run)
trivy fs --exit-code 1 --severity CRITICAL,HIGH --ignore-unfixed .
trivy image --exit-code 1 --severity CRITICAL --ignore-unfixed app@sha256:...
# Sign the immutable digest with Cosign (not run)
cosign sign --yes registry.example.com/apps/payment@sha256:...When to use / when to avoid
- Use full gated DevSecOps for production services, multi-team clusters, and regulated workloads.
- Avoid heavy blocking gates on day-one prototypes if rulesets aren't tuned yet—start with secret scanning (
gitleaks) + dependency scanning (trivy fs --ignore-unfixed), then add signing and admission policies before going live.
Pros / Cons
- Pros: Fast developer feedback; tamper-evident supply chain (SBOM + Cosign); last-mile protection via Kyverno even if someone bypasses CI.
- Cons: Requires tuning rulesets and maintaining an expiring exception workflow so false positives do not stall legitimate releases.
Relations
- Extends Supply-Chain Security and Platform Security Baseline.
- Integrates into Pipeline Anatomy.
Check yourself
Check Yourself
1. Why should a Kubernetes cluster run Kyverno admission policies even if Trivy and Cosign already run in CI?
2. What flag helps prevent Trivy from blocking builds on CVEs that have no upstream patch available yet?
Sources
Related Notes
ELK Logging: Pipelines, ILM & Log Hygiene
Centralize structured JSON logs with Filebeat/Fluent Bit, Elasticsearch data streams, Index Lifecycle Management (ILM), KQL queries, and PII redaction.
SLOs, Error Budgets & Actionable Runbooks
Define Service Level Indicators (SLIs), SLOs, and multi-window burn-rate alerts, and write runbooks that let on-call engineers mitigate incidents in minutes.