# Dependency and Supply-Chain Hygiene

> Manage third-party packages, lockfiles, SBOMs and build integrity so your software is not compromised through what it depends on. Free notes, key concepts,...

Canonical: https://www.internhack.in/roadmaps/tracks/cybersecurity/supply-chain-security
Last updated: 2026-11-28

Manage third-party packages, lockfiles, SBOMs and build integrity so your software is not compromised through what it depends on.

Intermediate · about 6 hours · difficulty 3/5

Learn first: [Secure SDLC](https://www.internhack.in/roadmaps/tracks/cybersecurity/secure-sdlc)

Modern applications are mostly other people's code. A single compromised or vulnerable dependency, build tool or CI plugin can affect everything downstream, so **software supply-chain security** is now a core defensive discipline.

### Dependency hygiene

- **Pin versions** and commit **lockfiles** (`package-lock.json`, `poetry.lock`, `go.sum`) so builds are reproducible.
- Prefer well-maintained packages with active maintainers; check OpenSSF Scorecard results for important dependencies.
- Watch for **typosquatting** and look-alike package names before installing.
- Remove unused dependencies; every package is attack surface.
- Automate update pull requests with Dependabot or Renovate and review them like any other change.

### Visibility

- An **SBOM** (software bill of materials) in SPDX or CycloneDX format lists every component in a build, which makes answering "are we affected by this new CVE?" fast.
- Match SBOMs against vulnerability databases such as OSV.

### Build integrity

- Protect CI: least-privilege tokens, pinned third-party actions (by commit SHA), branch protection and required reviews.
- **Sign** artifacts and container images (for example with Sigstore) and verify signatures before deploy.
- **SLSA** describes levels of build provenance and tamper resistance.

### Pitfalls

- Automatically merging every dependency update without tests.
- CI secrets exposed to untrusted pull requests from forks.

Move on when you can generate an SBOM for a project, enable automated dependency updates, and pin your CI actions to commit hashes.

## Key concepts

- **Lockfiles and version pinning**
- **Choosing trustworthy packages**
- **Typosquatting awareness**
- **Dependabot and Renovate**
- **SBOMs (SPDX, CycloneDX)**
- **CI hardening and pinned actions**
- **Artifact signing with Sigstore**
- **SLSA levels**

## Mini project

For one of your GitHub projects, enable Dependabot, generate a CycloneDX SBOM in CI, pin all third-party actions to commit SHAs and check the repo with OpenSSF Scorecard.

## Check yourself

How does an SBOM speed up your response when a new critical CVE is announced in a popular library?

## Free resources

- [SLSA framework](https://slsa.dev/) (OpenSSF)
- [OpenSSF Scorecard](https://scorecard.dev/) (OpenSSF)
- [CycloneDX specification](https://cyclonedx.org/) (OWASP)
- [OSV vulnerability database](https://osv.dev/) (OSV)

Previous: [Secure Coding and Input Validation](https://www.internhack.in/roadmaps/tracks/cybersecurity/secure-coding) · Next: [Secrets Management](https://www.internhack.in/roadmaps/tracks/cybersecurity/secrets-management)

## More in Secure Software Development

- [Secure SDLC](https://www.internhack.in/roadmaps/tracks/cybersecurity/secure-sdlc)
- [Threat Modelling with STRIDE](https://www.internhack.in/roadmaps/tracks/cybersecurity/threat-modeling-stride)
- [Secure Coding and Input Validation](https://www.internhack.in/roadmaps/tracks/cybersecurity/secure-coding)
- [Dependency and Supply-Chain Hygiene](https://www.internhack.in/roadmaps/tracks/cybersecurity/supply-chain-security)
- [Secrets Management](https://www.internhack.in/roadmaps/tracks/cybersecurity/secrets-management)
- [SAST and SCA in CI Pipelines](https://www.internhack.in/roadmaps/tracks/cybersecurity/sast-sca-ci)

## Related

- [Roadmaps](https://www.internhack.in/roadmaps)
- [Cybersecurity Roadmap](https://www.internhack.in/roadmaps/tracks/cybersecurity)
