Skip to content

Course

Software Supply-Chain Security

Dependency confusion, typosquats, maintainer takeovers, lockfiles, SBOMs, SLSA, and sigstore — what the npm and PyPI incidents proved about the threat model and the practices that close each door.

14 lessons

Course Q&A

Keep reading

Related articles from the SudoSecurity blog.

Reviews

Enrolled members can rate this course.

No reviews yet.

How Packages Become Payloads

The install path itself: lifecycle scripts, flat namespaces, resolver precedence, maintainer accounts, and the xz tarball.

  1. 01Install Time Is Run Timenpm lifecycle scripts and pip's setup.py execute package code with your credentials before your app ever imports it.13mOpen
  2. 02Typosquats: Names Are a NonceFlat registries serve whoever registered the confusable name first — how to verify the artifact instead of the vibes.12mOpen
  3. 03Dependency Confusion: The Registry Outranks YouResolvers pick the highest version across every configured index, so an unpublished internal name is a public landing zone.14mOpen
  4. 04The Maintainer Is the Attack Surfaceevent-stream to node-ipc: accounts get phished, handed off, expired, and turned — re-derive trust on every update.14mOpen
  5. 05xz: The Build Is the ArtifactCVE-2024-3094 shipped only in release tarballs via disguised test fixtures — the git repo everyone reviewed was clean.15mOpen

Lockfiles and Determinism

What your lockfile guarantees, where it stops, and how hashes and vendoring close the rest.

  1. 01The Lockfile Is the Build ContractSemver ranges are resolution inputs; package-lock.json is the output — npm ci enforces it, npm install rewrites it.11mOpen
  2. 02What the Lockfile Doesn't CoverIntegrity hashes protect the tarball you got, git deps still move, resolved hosts are editable — lint and review the diff.12mOpen
  3. 03Hashes, Vendoring, and Not Trusting the Networkpip --require-hashes, go.sum's transparency log, and vendoring move trust from the channel to the bytes.13mOpen

Provenance: SBOMs, SLSA, and Sigstore

Inventory, attestations, and keyless signatures — proving what shipped and who built it.

  1. 01SBOMs Are an Incident Tool, Not PaperworkLog4Shell proved the SBOM's job is answering 'do we ship it' in minutes — generate per artifact, keep it queryable.12mOpen
  2. 02SLSA: Who Built This, From WhatProvenance is a signed in-toto claim about the build — SLSA levels decide whether that claim is worth trusting.13mOpen
  3. 03Sigstore: Signatures Without Key FilesOIDC-bound ephemeral certs, Fulcio, and the Rekor transparency log make 'this workflow built these bytes' verifiable.14mOpen

Running It

Hardened CI, dependency vetting at the registry chokepoint, and the response playbook for when a package goes bad.

  1. 01Your CI Is the Attacker's ComputeMutable action tags, pull_request_target, and over-privileged tokens hand your secrets to anyone who can open a PR.14mOpen
  2. 02Adding a Dependency Is Adding a MaintainerScorecard, deps.dev, cooldowns, and a pull-through proxy turn trust decisions from laptop folklore into a gate.13mOpen
  3. 03When a Package Goes BadScope with the SBOM, rotate what the install env held, rebuild clean, then fix the door it entered through.13mOpen