Opscraft
DevSecOps & secrets management · Lesson 1 of 7 · 3 min read

Shift-left security in the pipeline

DevSecOps means security is built into the delivery pipeline and platform rather than bolted on at the end. Senior DevOps interviews ask how you secure the software supply chain (code → dependencies → build → image → deploy), manage secrets, harden Kubernetes workloads, and respond when a scanner reports 400 vulnerabilities. The OPA and IAM topics cover policy and identity in depth; this topic connects the rest.

Where each control fits

Enlarge diagramDeveloperpre-commit, secret scanPull requestSAST, SCA, IaC scan, reviewBuildSBOM, image scan, signRegistryscan on push, daily re-scanDeployadmission policy, verifysignatureRuntimedetection, drift, audit logs123456
Figure 1. Security controls along the delivery path. Each stage catches different problems; the earlier something is caught, the cheaper it is to fix.
Swipe sideways to see all of it, or tap to open it full screen.
Control What it finds Tools
Secret scanning Keys, tokens, passwords in code/history gitleaks, trufflehog, GitHub secret scanning + push protection, detect-secrets
SAST (static analysis) Code flaws: injection, unsafe deserialisation SonarQube, Semgrep, CodeQL, Checkmarx
SCA (software composition analysis) Vulnerable/licence-problem dependencies Dependabot, Snyk, OWASP Dependency-Check, Trivy, Grype, Renovate (updates)
IaC scanning Misconfigurations in Terraform/CloudFormation/K8s/Helm Checkov, tfsec/Trivy config, KICS, cfn-lint/cfn-guard, kube-score, Kubescape
Container image scanning OS and language package CVEs, misconfigurations Trivy, Grype, ECR enhanced scanning (Inspector), Snyk Container
DAST Running app vulnerabilities (XSS, auth issues) OWASP ZAP, Burp
Policy as code Org rules at admission and in CI OPA/Gatekeeper, Kyverno, Conftest
Runtime security Suspicious behaviour in containers/hosts Falco, GuardDuty EKS Runtime Monitoring, Sysdig

Making scanners useful rather than noisy

  • Fail on what matters: block builds on critical/high with a fix available, or exploitable in context; report the rest. trivy image --severity CRITICAL,HIGH --ignore-unfixed --exit-code 1.
  • Prioritise by exploitability: CVSS severity + EPSS (probability of exploitation) + CISA KEV (known exploited) + reachability + exposure (internet-facing?).
  • Exceptions with expiry: a documented, time-bound ignore (.trivyignore with comments, VEX statements) reviewed by security — not silent suppression.
  • Fast feedback: run quick checks on PRs (diff-aware SAST, secret scan), heavier ones nightly.
  • Ownership: findings routed to the owning team with SLAs (e.g. critical 7 days, high 30 days); dashboards for trends.
  • Fix at the source: rebuild images on patched base images automatically; minimal bases cut most findings.
Enlarge diagramAll findingshundredsPrioritisefix available?EPSS, CISA KEV,exposed?Blockcritical + fixableTrackowner, SLA,expiringexceptions
Figure 2. Making scanners useful: block on what is truly dangerous, route the rest to owners with deadlines.
Swipe sideways to see all of it, or tap to open it full screen.