
Secure SDLC & Supply Chain
Shift-left in practice — SAST, DAST, IAST, dependency and secret scanning, SBOM and SLSA, plus a code-review checklist you can run on any PR today.
What you will learn
Security as a separate phase at the end of the project is a 1990s habit. Modern engineering folds it into every step — design, code, build, deploy, operate. The goal is not to find every bug; it is to reduce the cost of finding them from "weeks during pen-test" to "minutes in CI."
The Three Scanner Families
- Reads source / bytecode
- Finds: SQLi, XSS sinks, hardcoded secrets, taint flows
- Pros: early, runs on every PR
- Cons: false-positive heavy without tuning
- Tools: Semgrep, CodeQL, SonarQube
- Hits a running app with payloads
- Finds: real reflective XSS, SQLi, auth flaws
- Pros: framework-agnostic, real proof
- Cons: needs an environment, slow, low coverage
- Tools: ZAP, Burp, Nuclei
And IAST — instruments the app at runtime to combine the two: it watches real requests with source-level context. Useful in QA; not yet a CI default.
Make SAST Useful, Not Noisy
- Run on diff, not the whole tree, on PRs.
- Block merge only on high-confidence, high-severity findings; track the rest.
- Maintain an allow-list with reasons (not silenced silently).
- Add custom rules for project-specific patterns ("never call
exec()," "all SQL via the orm helper").
Dependency & Secret Scanning
Two of the highest-leverage controls in the SDLC, both close to free.
- Dependency scanning — Dependabot/Renovate for updates, Snyk/Trivy/
npm audit/pip-audit/govulncheckfor CVEs. Set SLAs (Critical: 24h, High: 7d). - Secret scanning — pre-commit hooks (gitleaks, talisman, trufflehog) and GitHub's push-protection. The cost of one leaked AWS key on the open internet is measured in minutes before crypto miners hit it.
- License compliance — block GPL drift into closed-source products if that's your model; FOSSA / Snyk / OSS Review Toolkit.
SBOM and SLSA — Knowing What You Ship
You cannot defend what you do not inventory. SBOM (Software Bill of Materials) is the inventory; SLSA (Supply-chain Levels for Software Artifacts) is the maturity ladder for build provenance.
Concrete Steps
- Generate an SBOM at build (CycloneDX or SPDX). Store it with the artifact.
- Sign the artifact (Sigstore / cosign). Verify on deploy.
- Pin all base images by digest, not tag. Reproducible enough for L2.
- Run vulnerability scans against the SBOM continuously — CVEs land after release.
- Track and minimise build-time secrets; rotate the rest with a vault.
Threat Modeling in Code Review
The cheapest threat model is one you do during code review. The questions to ask on every non-trivial PR:
Secrets Management
Secrets do not belong in code, env files, container images, ticket comments, or Slack DMs. They live in a vault. Every consumer fetches by identity at runtime.
- Vaults: AWS Secrets Manager, GCP Secret Manager, HashiCorp Vault, 1Password Service Accounts.
- Workload identity over static credentials: IAM Roles for Service Accounts (k8s), Workload Identity Federation (GCP), IRSA (AWS), Managed Identities (Azure).
- Short TTLs on whatever cannot be eliminated.
- Rotation automation — a secret you can't rotate quickly will not be rotated when leaked.
- Pre-commit gitleaks; push-protection on GitHub; branch-protection requires review on any file matching
**/secrets**.
Show answer
Wiring It All Into CI
A pragmatic baseline pipeline (each step is a different team, each gate is meaningful):
jobs: lint-and-test: # the existing fast feedback sast: # semgrep --config p/owasp-top-ten deps: # trivy fs / npm audit / pip-audit secrets: # gitleaks detect --redact build: # reproducible image, pinned digests sbom-and-sign: # cosign sign + cyclonedx-bom image-scan: # trivy image — block on Critical deploy-staging: # cosign verify before pull dast-smoke: # nuclei + zap baseline against staging
- Plan — threat model in design doc
- Lint — SAST + secrets in CI
- Build — reproducible, pinned, hermetic
- Sign — sigstore / cosign
- Scan — SBOM + CVE feed continuously
- Deploy — verify signature, least-privilege
- Watch — DAST, runtime, anomaly alerts
- SLSA — Supply-chain Levels for Software Artifactsslsa.dev
- NIST SP 800-218 — Secure Software Development Framework (SSDF)nist.gov
- OWASP SAMM — Software Assurance Maturity Modelowaspsamm.org
- BSIMM — Building Security In Maturity Modelbsimm.com
- Sigstore — keyless signing for software artifactssigstore.dev
- CycloneDX — SBOM specificationcyclonedx.org
- SPDX — alternative SBOM specification (ISO/IEC 5962)spdx.dev
- Semgrep — open-source SASTsemgrep.dev
Finished reading?