← All insightsDevSecOps

Shift-left security: a practical pipeline that fails on real risk

Nir Geier, CodeWizard · 6 July 2025 · 3 min read · Intermediate

Shift-left means finding problems in the pipeline instead of production. Done badly it is a wall of red that developers learn to ignore. Done well, it fails only on risk that is both real and fixable.

Four scanners, one pipeline

yaml
security:
  stage: test
  script:
    - trivy fs --scanners vuln,secret,misconfig --severity HIGH,CRITICAL --ignore-unfixed --exit-code 1 .
    - trivy config --severity HIGH,CRITICAL --exit-code 1 .    # IaC misconfig
    - sonar-scanner -Dsonar.qualitygate.wait=true               # SAST + quality gate

Tuning the gate

  • Gate on HIGH/CRITICAL and ignore-unfixed at first, then tighten
  • Fail on new issues in changed code, not the whole legacy backlog
  • Generate an SBOM so you can answer 'are we affected?' fast
bash
# produce an SBOM for supply-chain visibility
trivy image --format cyclonedx -o sbom.json ghcr.io/acme/web:latest
A security gate that always screams gets muted. One that fires rarely and correctly gets respected.

Make the first gate narrow and trustworthy. Once developers trust it, ratcheting the bar upward is easy.

Like where this is going?

Get hands-on help from the engineers who write these posts.

Book a free consult