Skip to content

Lesson 3 of 12 · 20m

Advisory vs Blocking: Gating Without a Revolt

Severity isn't exploitability, day-one findings need a baseline not a wall, and every gate needs designed escape hatches — or developers build their own.

The fastest way to destroy a DevSecOps program is to turn on a scanner, set it to block on "medium and above," and walk away. Within a month there will be a Slack thread titled "can we just disable the security job," and the developers will be right — you handed them a gate that fires on noise. Gating works, but only after you've earned it.

Severity is not exploitability

A CVSS 9.8 in a function your code never calls is less urgent than a 6.5 sitting in your auth path. Raw scanner severity is a starting point, not a verdict. Before you gate on a finding, ask:

  • Is the vulnerable code path reachable? Reachability analysis and call graphs help; so does a human reading npm ls <pkg> output and checking whether the vulnerable symbol is ever imported.
  • Is it exploitable in your configuration? A debug-mode flag nobody set, a code path only reachable in test fixtures, a dependency loaded only by devDependencies that never reach the image — each changes the answer completely.
  • Is it exposed? Internet-facing and internal-only are different urgencies.
  • Is it actually being exploited? CISA's Known Exploited Vulnerabilities catalog and EPSS scores answer that better than CVSS does. A KEV entry is someone else's incident report; treat it accordingly.

You won't have perfect answers. But "could an attacker actually get here" beats "what did the scanner's default severity column say" every time.

Baselines: gate the delta, not the world

On day one, every scanner surfaces the accumulated backlog — years of findings nobody ever triaged. You cannot block on all of it; you'd halt the company. The standard move:

# record existing findings; only NEW findings fail the gate
gitleaks detect --baseline-path .gitleaks-baseline.json --source .

# diff-aware SAST: only findings introduced since the merge base — `semgrep ci`
# does this via the Semgrep platform (SEMGREP_APP_TOKEN); standalone it's:
semgrep scan --config p/default --baseline-commit "$(git merge-base HEAD origin/main)" --error

The backlog becomes a tracked queue — a real ticket list with owners and a burn-down — while the gate enforces only "don't make it worse." That turns "4,000 findings" into "12 new ones this month," which is a conversation people will actually have. Note the asymmetry: baselines age. A finding baselined in January is still a live secret in November, so the baseline file gets reviewed, not just generated.

The exception path is part of the design

Every gate needs escape hatches designed up front, not improvised at 2am during an incident deploy:

  • Inline suppression with justification — // nosemgrep: rules.sqli-concat -- parameterized driver, see ADR-14. Reviewable in the diff, greppable later, part of the audit trail.
  • A kill switch — continue-on-error: true or a repo variable that drops a job to advisory. For scanner outages and upstream outages — not emergencies of convenience.
  • Risk acceptance with an expiry — "accepted until 2026-03-01, owner: payments." A forever-exception is an unfixed bug wearing paperwork.

Rollout that survives contact

Run every new check in advisory mode for two weeks. Hand-review the top findings, tune or disable the noisy rules, then flip the vetted subset to blocking. One warning: advisory mode without a triage queue is findings going to /dev/null — someone must own the advisory output or the two weeks of tuning buys you nothing. Track gate bypass count as a metric — if it climbs, the gate is too expensive. That's feedback about the program, not about the developers.

Field notes

  • Whoever owns the gate owns its false positives. If you can't tune it, don't gate on it.
  • "We blocked 300 builds" is not a success metric; "median time-to-fix dropped" is.
  • An exception register nobody reviews is a list of unfixed bugs with good PR.

Was this lesson helpful?

Sign in to rate

Keep reading

Related articles from the SudoSecurity blog.