Lesson 4 of 9 · 24m
Pipeline Tooling That Engineers Do Not Ignore
Select and tune CI security checks so feedback is fast, contextual, reproducible, and rare enough that engineers trust a failure.
Nothing destroys an AppSec program faster than a scanner that cries wolf in the pull request. Engineers are trained by experience: if the red check is wrong twice this week, they will click past it next week when it is right. Your job is not to maximize the number of checks. It is to make every enforced failure worth an engineer's attention.
Separate signal classes
Not all findings deserve the same treatment. Classify them before buying or configuring anything:
block now exploitable pattern with high confidence and obvious fix
warn in PR suspicious pattern needing human context
aggregate trends, inventory, weak signals, low-confidence findings
never automate business-logic judgment requiring architectural contextA SQL string concatenation in a request handler might block. A weak random number generator in test fixtures probably should not. A broad regex for eval( across all languages will produce resentment, not security.
Speed is a security property
If a scan takes twenty minutes, developers batch changes, merge less often, and see security as friction. Keep blocking checks under the normal cognitive budget of a pull request — ideally under two or three minutes. Move expensive analysis to scheduled jobs with clear ownership.
# Example shape: fast pull request scan, deeper nightly scan.
- name: Fast diff scan
run: semgrep ci --config p/default --error --baseline main
- name: Dependency audit
run: osv-scanner --lockfile=package-lock.json --format=json --output=osv.jsonDo not scan the universe on every diff. Diff-aware scanning, caching, path filters, and language-specific jobs are how you keep feedback usable.
Reproducibility beats severity inflation
A finding engineers cannot reproduce locally becomes a negotiation. Give them the exact rule, file, commit, command, and expected evidence. Pin tool versions and rulepacks where possible.
semgrep scan --config auto --error --json --output semgrep.json
trivy fs --scanners vuln,secret --severity HIGH,CRITICAL .Then write remediation guidance in the language of the codebase. "Use parameterized queries" is generic. "Use db.query with bound parameters; do not concatenate WHERE fragments" is actionable.
Tune in public
Rule tuning should be a versioned engineering artifact. Track false positives, suppressions, and the reason for every exception:
rules:
- id: python.flask.security.injection.ssrf.ssrf-injection
paths:
exclude:
- tests/fixtures/**Blanket exclusions should expire. If a finding is suppressed because the input is constrained elsewhere, name that invariant. Otherwise the next maintainer cannot tell whether the suppression is safe.
Measure trust, not just coverage
Coverage tells you what the tool can see. Trust tells you whether engineers act on what it says. Track merge-blocking false positives, time-to-triage, dismissal reasons, and the percentage of findings fixed without escalation. When trust drops, reduce scope before adding another scanner.
Field notes
- A scanner dashboard full of unassigned findings is not a control; it is a debt ledger.
- Do not enforce a rule on day one. Run it in observe mode, tune it, then enforce it once the false positive rate is acceptable.
- Baseline legacy findings separately. Otherwise every new engineer inherits a decade of unrelated noise in their first pull request.
- If a security check can be skipped with a commit message flag, assume it will become routine unless usage is audited.
Was this lesson helpful?