Lesson 6 of 9 · 26m
Dependencies, Secrets, and Supply Chain Controls at Scale
Control third-party risk with inventories, update automation, provenance checks, and secret-scanning feedback loops that focus on exploitability.
Most organizations do not write most of the code they run. They assemble it. That is why dependency and secret management are AppSec problems, even when platform teams own the machinery. The mature posture is not "scan harder." It is knowing what you run, how it got there, how fast you can change it, and whether leaked credentials are actually usable.
Inventory is the first control
You cannot patch what you cannot name. Lockfiles, package manifests, container images, infrastructure modules, GitHub Actions, browser extensions, mobile SDKs, and internal generated clients all count.
syft ghcr.io/example/payments:sha-7d9e31 -o cyclonedx-json > sbom.cdx.json
osv-scanner --sbom=sbom.cdx.json --format=json --output vulns.jsonThe SBOM is evidence, not security by itself. Use it to answer exposure questions quickly: which services include openssl, which images still carry a vulnerable Debian package, which repositories depend on an abandoned internal library.
Update mechanics beat update mandates
Telling teams to "stay current" fails because upgrades compete with feature work. Automate low-risk updates and make larger upgrades visible as planned engineering work.
# .github/dependabot.yml
version: 2
updates:
- package-ecosystem: npm
directory: "/"
schedule:
interval: weekly
groups:
production-minor:
dependency-type: production
update-types: ["minor", "patch"]Grouping matters. Thirty separate pull requests are spam; one grouped, tested upgrade is maintenance. Measure merge rate and age, not just number of opened PRs.
Provenance is different from vulnerability scanning
A dependency can have no known CVEs and still be the wrong artifact. Verify package provenance, publisher identity, build integrity, and unexpected maintainer or repository changes where the ecosystem supports it.
npm audit signatures
cosign verify ghcr.io/example/payments:sha-7d9e31 --certificate-identity-regexp 'https://github.com/example/.github/workflows/release.yml@refs/tags/v.*' --certificate-oidc-issuer https://token.actions.githubusercontent.comYou do not need maximal verification everywhere. Start with release artifacts that reach production and CI actions that can alter production artifacts.
Secret scanning needs a response path
Finding a secret is only the beginning. The real questions are whether it is valid, what it can access, how quickly it can be revoked, and whether it appeared in logs, forks, or build artifacts.
1. detect pre-commit, server-side push protection, CI artifact scan
2. validate non-invasive metadata check where provider supports it
3. contain revoke or rotate before forensic perfection
4. investigate usage logs, exposed scope, publication timeline
5. prevent remove long-lived token path or reduce privilegesNever encourage engineers to test leaked credentials by using them. Prefer provider validation APIs or controlled rotations.
Field notes
- A lockfile is not proof of what is deployed. Compare build artifacts, images, and runtime inventory.
- Transitive dependencies often carry the actual exposure; direct dependency counts hide it.
- Auto-merge is appropriate only when tests are strong, rollback is fast, and ownership is clear.
- Secret scanning without rapid rotation creates anxiety but not control.
Was this lesson helpful?