Interview Prep/Git & GitHub/Secrets, Signing and Security

How do you catch vulnerable or malicious dependencies before they reach `main`?

IntermediateScenarioSecrets, Signing and Security
Answer

Situation read → Dependency changes should be reviewed like code.

What I'd do →

  1. Enable Dependabot alerts and security updates.
  2. Add the Dependency Review action on PRs to fail on new vulnerable packages or disallowed licenses.
  3. Commit lockfiles and install with npm ci or equivalent.
  4. Add CodeQL or another SAST scan as a required check.

Why → Catching it in the PR is much cheaper than after release.

Interview tip → Lockfiles plus review of dependency diffs address both bad versions and typosquats.

All Git & GitHub questions Roadmap: Git & GitHub

More on Secrets, Signing and Security