Skip to content

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

Merged
yusasa16 merged 3 commits intodevfrom
feat/supply-chain-cooldown
Apr 2, 2026
Merged

feat(repo): add 7-day cooldown period for npm package releases#886
yusasa16 merged 3 commits intodevfrom
feat/supply-chain-cooldown

Conversation

@yusasa16
Copy link
Copy Markdown
Collaborator

@yusasa16 yusasa16 commented Apr 2, 2026

Summary

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

  • .yarnrc.ymlnpmMinimalAgeGate: 7d を追加(Yarn 4.10.0+)
  • packages/@d-zero/scaffold/.yarnrc.yml にも同様に追加(create-frontend で生成されるプロジェクトにも適用)
  • .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 を一時的にコメントアウトして対応してください。
対応後は必ず元に戻してください。

Set npmMinimalAgeGate to 7d in .yarnrc.yml to block installation of packages

published within the last 7 days.

Set minimumReleaseAge to "7 days" and internalChecksFilter to "strict" in

renovate.json to prevent PR/branch creation until the age requirement is met.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@yusasa16 yusasa16 requested a review from YusukeHirao as a code owner April 2, 2026 01:20
@yusasa16 yusasa16 self-assigned this Apr 2, 2026
yusasa16 and others added 2 commits April 2, 2026 11:02
Add osvVulnerabilityAlerts and vulnerabilityAlerts.minimumReleaseAge: null to ensure
security vulnerability updates are not blocked by the 7-day cooldown period.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add npmMinimalAgeGate: 7d to scaffold .yarnrc.yml so that projects created
with create-frontend also block installation of packages published within
the last 7 days.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@yusasa16 yusasa16 merged commit 958701c into dev Apr 2, 2026
1 check passed
@yusasa16 yusasa16 deleted the feat/supply-chain-cooldown branch April 2, 2026 04:10
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.

2 participants