SECURITY ENGINEERING · PART 9 · DEVSECOPS AND SUPPLY CHAIN · PIPELINE · 122 OF 229

DevSecOps Pipeline: Which Check Goes Where

DevSecOps means building security checks into the delivery pipeline so they run automatically on every change. This episode maps which check goes where: pre-commit and the IDE, pull-request scans, build-time SCA and secret scanning, image and IaC scanning before deploy, and runtime checks after. It covers blocking versus warning, keeping the pipeline fast, baselining old findings, and the culture that makes it stick.

  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7
  8. 9
  9. 10
  10. 11
  11. 12
  12. 13
  13. 14
  14. 15
  15. 16
  16. 17
  17. 18
  18. 19
  19. 20
  20. 21
  21. 22
  22. 23
  23. 24
  24. 25
  25. 26
  26. 27
  27. 28
  28. 29
  29. 30
  30. 31
  31. 32
  32. 33
  33. 34
  34. 35
  35. 36
  36. 37
  37. 38
  38. 39
  39. 40
  40. 41
  41. 42
  42. 43
  43. 44
  44. 45
  45. 46
  46. 47
  47. 48
  48. 49
  49. 50
  50. 51
  51. 52
  52. 53
  53. 54
  54. 55
  55. 56
  56. 57
  57. 58
  58. 59
  59. 60
  60. 61
  61. 62
  62. 63
  63. 64
  64. 106
  65. 107
  66. 108
  67. 109
  68. 110
  69. 111
  70. 112
  71. 113
  72. 114
  73. 115
  74. 116
  75. 117
  76. 118
  77. 119
  78. 120
  79. 121
  80. 122
  81. 123
  82. 124
  83. 125
  84. 126
  85. 127
  86. 128
  87. 129
  88. 130
  89. 131
  90. 132
  91. 133
  92. 134
  93. 135
  94. 136
  95. 137
  96. 138
  97. 139
  98. 140
  99. 141
  100. 142
  101. 143
  102. 144
1 / 11

Press play to hear the narration, or step through at your own pace.

Key takeaways

  • Each check at its cheapest stage
  • PR gate for most feedback
  • build for supply chain
  • block on new criticals

Notes

The whole pipeline

Here is the whole map. In the editor and at commit: secret scanning, linters and fast static analysis. On the pull request: fuller static analysis and infrastructure-as-code scanning. In the build: dependency scanning, image scanning, a software bill of materials, and signing the artifact. Before deploy: a policy gate and config checks. At runtime: dynamic testing, monitoring and drift detection. The principle: run each check at the stage where it is cheapest and gives feedback fastest.

Checks by stage
  • IDE / pre-commit: secrets, linters, fast SAST
  • pull request: SAST, IaC scan
  • build: SCA, image scan, SBOM, sign artifacts
  • pre-deploy: policy gate, config checks
  • runtime: DAST, monitoring, drift detection
  • each check runs where it is cheapest and fastest

Shift all the way left

The furthest left is the developer's own machine. Editor plugins flag issues as code is typed, and pre-commit hooks block secrets and obvious problems before they are even committed. This is the cheapest possible feedback, measured in seconds. Two cautions: these checks must be fast, or developers disable them; and local hooks can be bypassed, so anything that matters must also run in the pipeline, where it cannot be skipped. Local checks are for speed and convenience; the pipeline is for enforcement.

At the developer
  • IDE plugins: flag issues as code is typed
  • pre-commit hooks: block secrets and obvious bugs before they are committed
  • fast: must run in seconds, or it gets disabled
  • this is the cheapest place to catch anything
  • but local hooks can be skipped, so repeat in CI

The pull request gate

The pull request is where most automated security feedback should land, because it matches how developers already work: they expect checks on a PR. Run static analysis and infrastructure scanning on the diff, comment findings inline on the changed lines, and block the merge only on new high or critical issues. Baseline existing findings so you are not relitigating the backlog on every change. And keep it under a few minutes, because a slow gate is one developers route around.

On the pull request
  • run SAST and IaC scanning on the diff
  • comment findings inline on the changed lines
  • block merge on NEW high or critical issues only baseline existing findings; do not relitigate them
  • keep it under a few minutes so it does not block flow

The build stage

The build stage is where supply-chain security lives, the main theme of this part. Here you scan dependencies for known vulnerabilities, generate a software bill of materials recording what is inside the artifact, scan the container image, and sign the artifact and its bill of materials so their origin can be verified later. Fail the build on new critical issues in dependencies your code actually uses. Cache scan results so builds stay fast. These steps stop you shipping someone else's vulnerability.

At build time
  • SCA: scan dependencies for known vulnerabilities
  • generate an SBOM (what is inside this artifact)
  • scan the container image
  • sign the artifact and its SBOM (provenance)
  • fail on new criticals in reachable dependencies
  • cache scans so the build stays fast

Deploy and runtime

At deploy, a policy gate makes the final decision: is this image signed, was it scanned, is its config compliant? In Kubernetes this is admission control, often backed by Open Policy Agent, which episode eleven covers. After deploy, dynamic testing runs against staging, monitoring watches the running system, and drift detection catches config that has wandered from what was declared. Because infrastructure is defined as code, its config is reviewed like any other code. No single stage is enough; they layer.

Release and after
  • pre-deploy policy gate: is the image signed? scanned? config compliant? (OPA, admission control)
  • runtime: DAST against staging, monitoring, config drift
  • infra-as-code means config is reviewed like code
  • defence in depth: do not rely on one stage alone

Block or warn

The hardest decision in DevSecOps is when a finding should actually stop the pipeline. Block on the clear, serious things: new critical vulnerabilities, committed secrets, unsigned artifacts, a failed policy check. Warn on lows, mediums and existing findings. Always give an override path with a recorded, reviewable reason, for the genuine emergency. The balance matters: a gate that blocks too much gets disabled, and a gate that blocks nothing protects nothing.

Gating policy
  • block on: new criticals, secrets, unsigned artifacts, failed policy
  • warn on: lows, mediums, existing findings
  • always give an override path with a recorded reason
  • a gate that blocks too much gets disabled
  • a gate that blocks nothing protects nothing

Keep it usable

Whether all this helps comes down to whether developers trust it, which means fast and low-noise. Keep it fast by parallelising, caching and scanning diffs. Keep it low-noise by tuning tools, baselining and deduplicating. Turn findings into tickets with owners, not walls of log output. Measure what matters: time to fix, escaped bugs, and the false-positive rate. And the culture point: security is everyone's job, and the pipeline is how a small security team enforces it at scale.

Make it stick
  • fast: parallelise, cache, scan diffs not everything
  • low-noise: tune tools, baseline, dedupe
  • findings become tickets with owners, not just logs
  • measure: time to fix, escaped bugs, false-positive rate
  • security is everyone's job, the pipeline just enforces it

Common mistakes

Mistakes. Bolting every scan onto the end of the pipeline, where it is slow and ignored, instead of spreading checks across stages. Blocking on every low finding, which trains people to disable the gate. Dumping the entire backlog of old findings on developers at once instead of baselining. Scans so slow that teams route around them. No owner assigned to findings, so they rot. And putting checks only in local hooks, which can be skipped, rather than enforcing them in the pipeline where they cannot.

Avoid these
  • bolting all scans on at the end, slow and ignored
  • blocking on every low finding
  • dumping old findings on developers at once
  • scans so slow the pipeline is bypassed
  • no owner for findings
  • checks only in local hooks, skippable in CI

Say it like this

In the interview: I put each check at the stage where it is cheapest. Secret scanning and quick static analysis at commit. Fuller static analysis and infrastructure scanning on the pull request. Dependency scanning, image scanning, a bill of materials and signing at build. A policy gate before deploy that checks the image is signed and compliant. Dynamic testing and monitoring at runtime. I block only on new criticals, secrets and failed policy, baseline the rest, and keep the pipeline fast and low-noise.

In the interview
  • "Each check at the cheapest
  • stage: secrets and fast SAST
  • at commit, SAST and IaC on the PR, SCA, image scan, SBOM and signing at build, a policy
  • gate before deploy, DAST and monitoring at runtime. Block
  • on new criticals and secrets, baseline the rest, and keep
  • it fast and low-noise."

Interview questions

Q1What is DevSecOps?

An approach that integrates security practices into DevOps, embedding automated security checks throughout the delivery pipeline so that security is continuous and shared across development, security and operations rather than a separate end-of-cycle gate.

Q2Which security checks run at which pipeline stage?

Secret scanning and fast SAST at commit and in the IDE; fuller SAST and IaC scanning on pull requests; SCA, image scanning, SBOM generation and signing at build; a policy gate and config checks before deploy; and DAST, monitoring and drift detection at runtime.

Q3What does "shift left" mean in a pipeline?

Moving security checks earlier, toward the developer and the pull request, where feedback is fast and fixes are cheap, rather than only testing at the end. Checks still run later too for enforcement, but the emphasis is on catching issues early.

Q4When should a security finding block the pipeline?

Block on clear, serious issues: new critical vulnerabilities, committed secrets, unsigned artifacts and failed policy checks. Warn on low and medium severities and existing findings, and always provide an audited override path for genuine emergencies.

Q5Why baseline existing security findings?

So developers are confronted only with new issues introduced by their change, not the entire backlog. Baselining prevents overwhelming teams and keeps the gate focused and credible, while the backlog is addressed separately.

Q6Why must pipeline security checks be fast?

Because slow checks delay delivery and tempt teams to bypass them. Parallelising, caching results and scanning only the diff keep checks quick enough that developers accept them as part of normal workflow.

Q7Why are local pre-commit hooks not sufficient on their own?

Because they can be skipped or disabled on a developer's machine. They provide fast local feedback, but any check that must be enforced has to also run in the pipeline, where it cannot be bypassed.

Q8What is a policy gate before deployment?

An automated check that allows a deployment only if conditions are met, such as the image being signed and scanned and its configuration compliant. In Kubernetes it is often implemented with admission controllers backed by policy engines like Open Policy Agent.