Interview Prep/DevSecOps/Pipeline Security Scanning

Full SAST on a large monorepo takes 40 minutes. How do you cut it?

AdvancedScenarioPipeline Security Scanning
Answer

Situation read → Full scans on every PR are wasteful. Most changes touch a small part of the tree.

What I'd do →

  1. Diff-aware scans on PRs (semgrep ci with --baseline-commit).
  2. Path filters in the pipeline so only affected services are scanned.
  3. Shard by directory in parallel jobs.
  4. Run a full scan nightly on the default branch and track new findings there.
  5. For CodeQL, use incremental analysis and cache the database where supported.

Why → PR scans need speed, nightly scans need completeness. Splitting them keeps both.

Interview tip → Tie the answer to developer wait time as a measurable metric.

All DevSecOps questions Roadmap: Security in the pipeline

More on Pipeline Security Scanning