chore: Configure npmMinimalAgeGate quarantine window#251
Conversation
📝 WalkthroughWalkthroughAdded Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
.yarnrc.yml (1)
9-9: Consider the operational trade-offs of the 7-day quarantine window.While
npmMinimalAge: 7deffectively mitigates same-day supply chain attacks, it also delays access to legitimate updates including potential security patches for 7 days. Consider establishing a process for emergency dependency updates (e.g., temporarily disabling the constraint or usingyarn upwith explicit overrides) when critical patches are released.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.yarnrc.yml at line 9, npmMinimalAge: 7d enforces a 7-day quarantine which reduces same-day supply chain risk but blocks urgent patches; update the repo's operational guidance and CI to support emergency dependency updates by (1) documenting a runbook that describes when to bypass npmMinimalAge and the approval process, (2) adding a sanctioned emergency procedure using "yarn up" with explicit package@version overrides or temporarily disabling the npmMinimalAge setting, and (3) adding a guarded CI flag or repo secret (e.g., EMERGENCY_DEP_UPGRADE=true) that the update workflow checks before allowing bypass so emergency fixes can be applied safely while keeping the 7-day default in place.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.yarnrc.yml:
- Line 9: Rename the incorrect config key npmMinimalAge to npmMinimalAgeGate and
change its value from the string/duration format to an integer representing
minutes; specifically replace npmMinimalAge: "7d" (or npmMinimalAge: 7d) with
npmMinimalAgeGate: 10080 so Yarn recognizes the key and the 7-day (7×24×60)
quarantine window.
---
Nitpick comments:
In @.yarnrc.yml:
- Line 9: npmMinimalAge: 7d enforces a 7-day quarantine which reduces same-day
supply chain risk but blocks urgent patches; update the repo's operational
guidance and CI to support emergency dependency updates by (1) documenting a
runbook that describes when to bypass npmMinimalAge and the approval process,
(2) adding a sanctioned emergency procedure using "yarn up" with explicit
package@version overrides or temporarily disabling the npmMinimalAge setting,
and (3) adding a guarded CI flag or repo secret (e.g.,
EMERGENCY_DEP_UPGRADE=true) that the update workflow checks before allowing
bypass so emergency fixes can be applied safely while keeping the 7-day default
in place.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
npmMinimalAgeGate quarantine window
Problem
No protection against freshly-published malicious packages. Same-day supply chain attacks (e.g., axios@1.14.1 pulling in malicious
plain-crypto-js) can enter the dependency tree immediately.Solution
Add
npmMinimalAgeGate: 7dto.yarnrc.yml. Yarn will refuse to resolve any package version published less than 7 days ago. No lockfile or runtime changes — only affects future dependency resolution.