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 →
- Pin exact versions via lockfiles for applications.
- Use ranges in libraries so consumers can resolve.
- Use Renovate or Dependabot to move pins forward with PRs.
- Add a cooldown (Renovate
minimumReleaseAge: "3 days", Dependabotcooldown) 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.
More on Supply Chain Security
What is an SBOM, and at which point in the pipeline do you generate it?BeginnerA customer asks for an SBOM for your product. What do you give them?BeginnerHow do you sign container images in GitHub Actions without managing private keys?IntermediateYou signed images in CI. How do you make sure the cluster only runs signed images?IntermediateLeadership wants "SLSA compliance". What do you propose?IntermediateWhat is typosquatting and how do you protect developers from it?Beginner