Security
Supply-chain security: multiple-choice review
Six questions that cut across the whole unit. Each one mirrors a decision you make in a real incident — not a definition to recite, but a tradeoff to weigh when the install step is the attack surface.
Confirm you can connect the documented attack patterns to the defense that actually stops each one — lockfile integrity, registry precedence, provenance, and signing — and judge which layer a given control protects.
Your team pins exact versions in package.json (no caret ranges) and feels safe from supply-chain attacks. What does that pin actually fail to guarantee?
A build at a large company silently resolved a public package named after an internal-only module, at version 9.9.9, and ran the attacker's code. No credentials were stolen. What enabled this, and what is the primary fix?
The xz-utils backdoor (CVE-2024-3094) had clean source in Git but a malicious released tarball. Which control would have caught it, and why do lockfiles and audit not?
Why does adding `--ignore-scripts` to installs matter, and what does it specifically defend against?
A CI workflow grants its build job a broad, write-scoped token and runs on pull_request from forks. What is the supply-chain risk, and the first fix?
A CVE drops in a deep transitive dependency. Leadership asks 'are we affected, and where?' What artifact answers this in seconds rather than a frantic grep across repos?
Across the unit the through-line is one layered model: the install step is the attack surface, and each control answers a different question. Lockfile + npm ci + integrity hashes answer “did I get the exact bytes I expected”; exact pins and --ignore-scripts shrink the auto-upgrade and code-execution windows; scoped names with registry precedence kill dependency confusion; SBOMs answer “what is inside”; and SLSA provenance plus signing answer “how was it built and is it untampered” — the gap xz exploited. CI itself is in the chain, so least-privilege tokens matter as much as the dependencies they handle.