Notes
What you depend on
First, understand what you depend on. Direct dependencies are the libraries you deliberately added. Transitive dependencies are what those libraries depend on, several levels deep. A handful of direct dependencies routinely pulls in hundreds. And the crucial point: most vulnerabilities turn up in transitive dependencies you never chose or heard of. The lockfile, which pins the exact version of every package, is the authoritative record of what you actually ship.
- direct: the libraries you added to your project
- transitive: what those depend on, levels deep
- a few direct deps can pull in hundreds
- most vulns are in transitive deps you never chose
- the lockfile records the exact resolved versions
How SCA works
SCA works by matching. It reads your lockfile to get every package and its exact version, then matches those against advisory databases: the national database, GitHub Advisories, the open-source OSV database and vendor feeds. For each match it reports the package, version, vulnerability, severity and fixed version. The best tools also show the dependency path, so you see which direct dependency pulled in a vulnerable transitive one, which is what you need to fix it.
- read the lockfile: every package and exact version
- match against advisory DBs (NVD, GitHub, OSV, vendor)
- report: package, version, CVE, severity, fixed version
- best tools show the dependency path to a transitive vuln
- flag outdated, end-of-life packages
The tools
There are several good tools. Trivy and Grype are fast, free and scan both source projects and images. OWASP Dependency-Check is free and long-established. Snyk is a popular commercial option with strong fix advice. GitHub's Dependabot alerts are built into repositories. And every ecosystem has a native scanner: npm audit, pip-audit, cargo audit, govulncheck. Most teams run one scanner in the pipeline and rely on ecosystem tools locally. They all draw on the same advisory data.
- Trivy, Grype: fast, free, scan code and images
- OWASP Dependency-Check: free, long-established
- Snyk: commercial, strong fix advice and developer UX
- GitHub Dependabot alerts: built into GitHub repos
- language-native: npm audit, pip-audit, cargo audit, govulncheck
Not all alerts matter
A long list of dependency alerts is not a long list of real risks. A vulnerability in a package you include but never call may be no risk at all. Some SCA tools do reachability analysis: they check whether your code actually reaches the vulnerable function, which cuts the noise. Even so, you prioritise by context, exposure, the exploit-prediction score and the known-exploited list, as in Part five. The next episode is entirely about triaging these alerts, because the volume is the real challenge.
- a CVE in a package you include but never call is low risk
- reachability analysis: does your code actually reach the vulnerable function?
- cuts the noise dramatically
- still: context (exposure, EPSS, KEV) decides priority
- next episode is all about triaging these alerts
More than CVEs
SCA does more than find known vulnerabilities. It checks licenses, flagging copyleft or incompatible ones before they become a legal problem. It can catch malicious packages: typosquats, hijacked packages and suspicious install scripts, which episode seven covers. And it flags abandoned dependencies. Mature teams write policy on all of this: block a package not just for a vulnerability, but for a bad license, extreme age, or no maintenance.
- license compliance: flag copyleft or incompatible licenses before legal does
- malicious packages: typo- squats, hijacks, install scripts
- abandoned / unmaintained deps
- policy: block on license, age or no maintenance, not just CVEs
Running it well
Run SCA on every build, against the lockfile, and fail only on new critical issues in dependencies your code actually reaches, warning on the rest. The subtle point is to rescan continuously, not just at build time: a dependency clean yesterday can have a new vulnerability disclosed today, and you want to know across your estate the same day. Keep an inventory of what you depend on, the software bill of materials in episode five, and pair SCA with automated update tools, in episode four.
- scan every build, against the lockfile
- fail on NEW criticals in reachable deps; warn on rest
- rescan continuously: a dep clean yesterday may have a CVE today
- keep a dependency inventory (the SBOM, ep 5)
- pair with auto-update tools (ep 4)
Common mistakes
Mistakes. Scanning only direct dependencies and ignoring transitive ones, where most of the risk is. Treating every reported vulnerability as urgent with no context, which buries the few that matter. Scanning once at build time and never re-scanning, so a newly disclosed critical goes unnoticed. Ignoring license and malicious-package risk, which SCA can catch. Updating dependencies blindly and breaking the build, the thing that makes teams stop updating. And having no inventory of what you actually depend on.
- scanning direct deps only, ignoring transitive
- treating every CVE as urgent with no context
- scanning once, never re-scanning
- ignoring license and malicious-package risk
- updating blindly and breaking the build
- no dependency inventory
Say it like this
In the interview: I run software composition analysis against the lockfile, so it covers transitive dependencies where most risk lives, matching exact versions against OSV, GitHub Advisories and vendor feeds. I prioritise with reachability analysis and context like exposure and the known-exploited list, not treating every vulnerability as urgent. I block new criticals in reachable deps, rescan continuously, check licenses and malicious packages, and pair it with automated updates and an SBOM.
- "SCA against the lockfile, covering transitive deps where
- most risk is, matched to OSV
- and vendor advisories. I use
- reachability and context to prioritise, block new criticals in reachable deps, rescan continuously, check
- licenses and malicious
- packages, and automate updates."