Interview Prep/DevSecOps/Supply Chain Security

Should dependencies be pinned to exact versions or use ranges?

BeginnerScenarioSupply Chain Security
Answer

Situation read → Ranges give automatic fixes but also automatic breakage and compromise. Pinning gives control but needs update discipline.

What I'd do →

  1. Pin exact versions via lockfiles for applications.
  2. Use ranges in libraries so consumers can resolve.
  3. Use Renovate or Dependabot to move pins forward with PRs.
  4. Add a cooldown (Renovate minimumReleaseAge: "3 days", Dependabot cooldown) so brand-new releases get some time to be flagged.

Why → A few days of delay avoids most malicious package windows.

Interview tip → Pin plus automated updates, not pin and forget.

All DevSecOps questions Roadmap: Supply chain, secrets & identity

More on Supply Chain Security