Add supply chain security policy with npm cooldown#630
Conversation
2026-03 の axios 侵害を踏まえ、公開直後の悪意あるバージョンの自動取り込みを防ぐ。 - .npmrc: min-release-age=7(npm install/update の解決を公開後7日待機。要 npm>=11.10、古い npm では無視) - .github/dependabot.yml: npm / github-actions の version update に cooldown(既定7日・major14日)。security update は対象外で即時 PR(設計どおり) - CONTRIBUTING.md: 運用ルール(npm 11.10 要件 / npm ci は対象外 / 緊急バイパス手順) 注: engines.npm は protect フック対象のため未変更(npm>=11.10 の担保は CONTRIBUTING に明記)。検証: YAML 妥当・npm ci exit 0。 https://claude.ai/code/session_019KsGHZUVwcvbhwi1tVebCH
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
🔗 Linked repositories identifiedCodeRabbit considers these linked repositories for cross-repo context during reviews:
✅ Files skipped from review due to trivial changes (1)
📝 WalkthroughWalkthroughAdds a supply‑chain cooldown: ChangesSupply-chain security cooldown policy
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
CONTRIBUTING.md (1)
41-45: ⚡ Quick winConsider adding a checklist or template for emergency bypass PRs.
The emergency procedures require PR descriptions to explain "why the normal cooldown is not being waited out." To ensure consistency and completeness, consider creating a PR template or checklist that includes:
- Rationale for bypassing cooldown
- Security assessment performed
- Alternative mitigations applied (e.g.,
--ignore-scripts)📋 Example PR template snippet
## Emergency Cooldown Bypass - [ ] Justification: [Describe why waiting 7 days is not feasible] - [ ] Security review: [Steps taken to verify the package is safe] - [ ] Mitigation: [Any additional safeguards applied, e.g., --ignore-scripts] - [ ] Rollback plan: [How to revert if issues are discovered]🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@CONTRIBUTING.md` around lines 41 - 45, Add a small emergency-bypass PR checklist/template to the CONTRIBUTING.md near the guidance that PR descriptions must explain “why the normal cooldown is not being waited out”; create a titled snippet (e.g., "Emergency Cooldown Bypass") that lists required items: justification, security assessment, mitigation steps (like --ignore-scripts), and rollback plan so authors must fill them when submitting such PRs; ensure the CONTRIBUTING.md text references and links to this template/checklist so reviewers can verify completeness.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/dependabot.yml:
- Around line 32-33: The dependabot config incorrectly sets the cooldown key
under the github-actions ecosystem; remove the cooldown: default-days: 7 entry
from the github-actions section (or relocate it to a supported ecosystem or
global config) so Dependabot no longer rejects/ignores updates for
github-actions; look for the cooldown key and the github-actions ecosystem
identifier in .github/dependabot.yml and delete or move that cooldown setting
accordingly.
In @.npmrc:
- Line 5: The .npmrc entry "min-release-age=7" requires npm >= 11.10.0 and npm's
"npm config get min-release-age" may print "null" even on supported versions
because npm normalizes the setting internally; update the repository
documentation and the .npmrc header to state the minimum supported npm version
(>=11.10.0), the intended behavior of min-release-age, and the reason "npm
config get" can show null, and add a quick CI/preinstall check (e.g., a script
referenced by package.json like "check-npm-version" or a preinstall hook) that
fails with a clear message if npm --version is older than 11.10.0 so the setting
is not silently ignored.
---
Nitpick comments:
In `@CONTRIBUTING.md`:
- Around line 41-45: Add a small emergency-bypass PR checklist/template to the
CONTRIBUTING.md near the guidance that PR descriptions must explain “why the
normal cooldown is not being waited out”; create a titled snippet (e.g.,
"Emergency Cooldown Bypass") that lists required items: justification, security
assessment, mitigation steps (like --ignore-scripts), and rollback plan so
authors must fill them when submitting such PRs; ensure the CONTRIBUTING.md text
references and links to this template/checklist so reviewers can verify
completeness.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 8ca5dd67-f620-41fd-a270-7e0aabe2a2aa
📒 Files selected for processing (3)
.github/dependabot.yml.npmrcCONTRIBUTING.md
🔗 Linked repositories identified
CodeRabbit considers these linked repositories for cross-repo context during reviews:
bitbankinc/bitbank-api-docs(manual)
CodeRabbit (#630) 指摘対応: - Dependabot の cooldown は github-actions エコシステム未サポートのため除去(npm 側は維持)。設定拒否/無視を回避。 - CONTRIBUTING に「npm config get min-release-age は内部 before 変換で null を返しうる」注記を追記。 preinstall でのバージョン強制 fail 案は、既定 npm(10.x) 利用者の install をブロックし過剰なため見送り。 https://claude.ai/code/session_019KsGHZUVwcvbhwi1tVebCH
Summary
Establish a supply chain security policy to mitigate risks from newly published npm packages by implementing a 7-day cooldown period before automatic dependency updates.
Changes
CONTRIBUTING.md (new): Comprehensive contribution guide documenting the cooldown policy, rationale (referencing past supply chain attacks), and operational details
.npmrcfor local/CI installs and Dependabot configuration for automated PRsnpm ciis unaffected and security updates bypass cooldown.npmrc (new): Configures
min-release-age=7to prevent npm from resolving packages published less than 7 days ago.github/dependabot.yml (new): Configures Dependabot with cooldown periods
Implementation Details
https://claude.ai/code/session_019KsGHZUVwcvbhwi1tVebCH
Summary by CodeRabbit
Chores
Documentation