Skip to Content
Mengty Learns
Platform tools

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.

explanationintermediateTested with trivy 0.76.2 (docs), kyverno 1.20.0 (docs), cosign 3.1.4 (docs)Updated Nov 27, 2026

Intent

TL;DR

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:

  1. Pre-commit & fast PR checks (seconds): gitleaks blocks secrets before they hit Git history; linters, SAST (Semgrep), SCA (trivy fs with --ignore-unfixed), and IaC scanners (checkov / trivy config) block high-severity issues early.
  2. Build, SBOM & signing (minutes): Build an immutable image, scan OS/app packages with trivy image, generate a CycloneDX SBOM (Syft), and sign the sha256: digest with Cosign.
  3. Admission control (deploy time): Kyverno verifies the Cosign signature, rejects :latest tags, and enforces non-root + resource limits before a Pod schedules—covering even out-of-band kubectl changes.
  4. 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

Overview of DevSecOps Pipeline Gates: Commit to Admission. 5 steps.
Overview5 steps in this flow

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

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