Skip to content

feat(repo): add 7-day cooldown period for npm package releases#849

Closed
YusukeHirao wants to merge 1 commit into
devfrom
chore/npm-cooldown
Closed

feat(repo): add 7-day cooldown period for npm package releases#849
YusukeHirao wants to merge 1 commit into
devfrom
chore/npm-cooldown

Conversation

@YusukeHirao
Copy link
Copy Markdown
Member

@YusukeHirao YusukeHirao commented Apr 22, 2026

Summary

npmサプライチェーン攻撃対策として、公開から 7日未満 のパッケージをインストール・更新対象から除外するクールダウン期間を設定します(frontend-env#886 の展開)。

  • .yarnrc.ymlnpmMinimalAgeGate: 7d を追加(Yarn 4.10.0+)
  • .github/renovate.jsonminimumReleaseAge: "7 days" および internalChecksFilter: "strict" を追加

なぜ7日なのか

悪意あるパッケージの多くは公開から数時間〜数日以内に検出・削除されます。公開直後の短期間をブロックするだけで高い防御効果が得られます。

3日(Renovate の config:best-practices デフォルト)では防御期間として短く、14日以上は開発速度への影響が大きくなるため、7日を採用しています。Andrew Nesbitt も7日間のクールダウンの有効性について言及しています(Package Managers Need to Cool Down)。

参考資料

動作

ツール 動作
Yarn yarn install 時、公開7日未満のパッケージが含まれるとエラーで停止
Renovate 7日経過前はブランチ自体を作成しない(CVE対応のセキュリティ更新はバイパス)

Warning

Yarn 側には緊急時のバイパス手段がありません。
セキュリティパッチなど公開直後のパッケージをどうしても即座にインストールする必要がある場合は、.yarnrc.ymlnpmMinimalAgeGate を一時的にコメントアウトして対応してください。
対応後は必ず元に戻してください。


Note

Medium Risk
Tightens dependency update/install policy by blocking packages released within the last 7 days, which can unexpectedly break CI or emergency upgrades. Security-alert updates are explicitly exempted in Renovate, but Yarn installs will still fail until the gate is relaxed.

Overview
Adds a 7-day minimum release age gate for npm packages: Yarn now enforces npmMinimalAgeGate: 7d, and Renovate delays creating update PRs via minimumReleaseAge: "7 days".

Also tightens Renovate checks with internalChecksFilter: "strict" and enables vulnerability alerting (osvVulnerabilityAlerts), while explicitly bypassing the release-age delay for vulnerabilityAlerts updates.

Reviewed by Cursor Bugbot for commit 84e23b8. Configure here.

Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 84e23b8. Configure here.

Comment thread .github/renovate.json
"osvVulnerabilityAlerts": true,
"vulnerabilityAlerts": {
"minimumReleaseAge": null
},
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Security settings in ignored config file, shadowed by root

High Severity

The new minimumReleaseAge, internalChecksFilter, osvVulnerabilityAlerts, and vulnerabilityAlerts settings are added to .github/renovate.json, but a renovate.json file exists at the repository root. Renovate uses the first config file it finds in priority order, and renovate.json at root takes precedence over .github/renovate.json. This means the entire .github/renovate.json — including these new supply chain security settings — is likely ignored, silently defeating the purpose of this PR.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 84e23b8. Configure here.

@YusukeHirao
Copy link
Copy Markdown
Member Author

v5 が current stable ブランチであることが確認できたため、このPRをクローズし v5 ベースで作り直します。

@YusukeHirao YusukeHirao deleted the chore/npm-cooldown branch April 22, 2026 06:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant