脅威モデル作成ツール
プロジェクトで重要な点を AI スキャナーに伝える
誤検知のほとんどは、スキャナーが攻撃者を誤解することで発生します。短い脅威モデルでそれを防げます。チェックボックスにチェックを入れ、ファイルを .oss-scanner/threat_model.md にコピーすると、ossscanner.org と Anthropic OSS Scanner の両方がその内容に従います。
修正候補
重複排除
.oss-scanner/threat_model.md
# Threat model ## About the project _Describe what the project does and who runs it._ ## Untrusted input (treat as adversarial) - Bytes received over the network (sockets, protocol messages, peers). - Files that users open or upload (documents, images, media, fonts). ## Out of scope (do not report) - Test code, fixtures and fuzzing harnesses. - Examples, demos and documentation snippets. - Build scripts, CI configuration and developer-only tooling. - Denial of service that needs very large inputs or sustained traffic. ## Severity rubric - **critical**: Remote code execution or full authentication bypass on a default configuration. - **high**: Memory corruption, privilege escalation or exposure of other users' data with a realistic attack path. - **medium**: Limited impact, or significant preconditions such as non-default settings or an authenticated attacker. - **low**: Hardening issues with no demonstrated security impact. ## Report format - Keep reports short: one-paragraph summary first, then affected file and lines, impact, reproducer and fix. - Candidate patches: minimal, enough to show the root cause and how to fix it. - Deduplicate by root cause: one report per underlying bug even if it is reachable from several places.
このファイルを、repo内の .oss-scanner/threat_model.md としてコミットしてください。生成されるファイルは英語なので、すべてのスキャナーとコントリビューターが読むことができます。ossscanner.orgで登録済みプロジェクトの設定に貼り付けることもできます。
脅威モデルが重要な理由
AIスキャナーは問題を起こす可能性のあるコードを見つけるのは得意ですが、特定の入力がプロジェクトで攻撃者に制御されるかどうかまでは判断できません。設定ファイルを書き込むのは運用担当者ですか、それとも匿名ユーザーですか。CLIは特権を持つsetuidバイナリですか、それとも開発者向けツールですか。こうした背景がないと、修正する必要のないバグを報告したり、重要度を誤って評価したりします。
Anthropicがまさにこの理由で脅威モデルファイルを推奨しており、スキャナーを試したメンテナーによると、最もよくある誤りは重要度の過大評価と脅威モデルの誤解でした。
記載する内容
- プロジェクトの役割と利用者。
- 信頼できないデータの入力元:ネットワーク、ファイル、リクエスト、プラグイン。
- 信頼できるもの:運用担当者の設定、ローカルユーザー、ビルド環境。
- 対象外とするもの:テスト、使用例、ローカル環境のみの問題、巨大な入力によるDoS。
- 重要度の評価方法。これにより、クリティカルの意味をあなたとスキャナーで統一できます。
- レポートの形式:パッチ形式、有用なPoC、重複排除。
簡潔にまとめてください。1ページで十分です。
ファイルの配置場所
どちらのスキャナーも、デフォルトではrepoのルートにある.oss-scanner/threat_model.mdを読み込みます。Anthropicのスキャナーでは、project.yamlで別のパスを指定することも、repo内でproject.yamlの隣にthreat_model.mdを配置することもできます。ossscanner.orgでは、登録済みプロジェクトの設定に貼り付けられます。変更は次回のスキャンから反映されます。