Repository navigation
Add npm min-release-age to .npmrc for supply chain attack mitigation - #222
Closed
anishi-pfr wants to merge 1 commit into
Closed
anishi-pfr wants to merge 1 commit into
anishi-pfr wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
推奨:自衛手段の整備
3月中のサプライチェーン攻撃は、Trivy、LiteLLM、Telnyx、そして今回の axios へと波及しています。次にどのパッケージが狙われるかは予測できないため、可能な限りの自衛を推奨します。
npm の
min-release-agenpm v11 以降では
.npmrcにmin-release-ageを設定することで、公開から一定期間が経過していないバージョンのインストールを抑止できます。この状況下では 7 日程度を推奨します。急ぐ場合でも 3 日程度は確保してください。今回の axios のようにエコシステム全体で騒がれる規模の侵害は、数時間でテイクダウンされます。しかし、より小規模なパッケージや依存の深い階層で起こる侵害は発見が遅れ、数日間以上にわたって npm 上に残存することもあります。検疫期間はそうした「気づかれにくい侵害」に対してこそ効果を発揮します。
pnpm の
trustPolicy: no-downgradepnpm には
trustPolicy: no-downgradeという仕様があり、パッケージの信頼度が下がるような更新(例:OIDC による trusted publishing から手動パブリッシュへの切り替え)をブロックできます。今回の axios の問題の2バージョンは、この設定を有効化していればブロックされます。ただし、今後 axios 経由で他のパッケージ(例えば axios の依存パッケージ)が侵害された場合に、trustPolicy: no-downgradeでブロックできないケースが存在する可能性はあります。