42Crunchのライブコンフォーマンス・認可スキャン(APIが標準仕様に準拠し、適切にアクセス制御できているかを調べるテスト)をAPIに対して実行し、SQG-blocking(スキャン結果として報告されるセキュリティ上の重大問題)の検出結果を修正します。 **次のような場合に使用:** - ユーザーがコンフォーマンステスト、認可スキャン、BOLA(権限なしでアクセスできる脆弱性)テスト、BFLA(ユーザーに許可されていない操作ができる脆弱性)テスト、スキャン設定の生成・調整、またはスキャンで報告された問題の修正を実行したい場合 「スキャンを実行」「スキャンのみ」「コンフォーマンステスト」「BOLAテスト」「BFLAテスト」「42crunchスキャン」「スキャン設定」、またはライブAPIテストに特化したリクエスト(静的監査を除く)など、これらのフレーズが含まれるときに自動的に起動します。 ユーザーが監査とスキャンの両方を一緒に実行したい場合は、42crunch-api-security-testingスキルを使用してください。
Run a 42Crunch live conformance and authorization scan against an API and fix SQG-blocking scan findings. Use this skill whenever the user wants to run a conformance test, authorization scan, BOLA test, BFLA test, generate or configure a scan config, or fix scan-reported issues. Triggers on phrases like "run scan", "scan only", "conformance test", "BOLA test", "BFLA test", "42crunch scan", "scan config", or any request focused on live API testing without running a static audit. Use 42crunch-api-security-testing when the user wants both audit and scan together.
単一フェーズを実行します: スキャン(ライブ適合性と認可テスト、およびセキュリティ品質ゲート(セキュリティ要件の自動チェック)ブロッキング修正ループ)。実行前に明示的なユーザー許可が必要です。
静的監査は実行しません — その場合は 42crunch-audit スキルを使用してください。
OAS ファイル(API仕様書)が既に監査済みであることを前提としています(またはユーザーがスキャンのみを明示的に実行している場合)。スキャン前に監査の問題について言及がある場合は、先に 42crunch-audit を実行することを提案してください。
事前チェック。 ../../references/pre-flight.md を読み、すべてのステップ(セットアップ、OAS ファイルの読み込み、タグ検出)を完了します。OAS ファイル選択をプロンプトする際は、コンテキスト "scan" を使用してください(例: 「どれをスキャンしますか?」)。何らかのステップが失敗した場合、またはユーザーがキャンセルした場合は先に進まないでください。
スキャン対象のURL を確定する。
OAS ファイルから servers[0].url を読み込みます。
SCAN42C_HOST 環境変数が設定されている → サイレント告知:
"Using scan target from SCAN42C_HOST:
<url>"SCAN_TARGET_URLとして保存して進みます。
AskUserQuestion を呼び出します:
"OAS では <servers[0].url> を API のターゲットとして指しています。これはスキャンに使用する正しい URL ですか?" — オプション: ["はい、この URL を使用します", "いいえ、別の URL を指定します"]SCAN_TARGET_URL として保存します。servers[0].url を SCAN_TARGET_URL として保存します。疎通確認 — SCAN_TARGET_URL が確定した直後に実行します。
2段階のプローブを使用して「サーバーダウン」と「ベース URL の誤り」を区別します。
ステージ 1 — ベース URL をプローブ:
curl -s -o /dev/null -w "%{http_code}" --max-time 5 <SCAN_TARGET_URL>/
AskUserQuestion を呼び出します:
"<SCAN_TARGET_URL> に到達できません — 接続がタイムアウトするか拒否されました。どのように進めますか?"["別の URL を試す", "続行する — API は一時的にダウンしているかもしれません", "キャンセル"]SCAN_TARGET_URL として保存し、ステージ 1 から再実行します。ステージ 2 — 最初のシンプルな OAS パスをプローブ(ステージ 1 が 404 を返した場合のみ実行):
OAS の最初の GET パスを探します(必須のパスパラメータなし)。{param} スタイルのセグメントを削除し、プローブします:
curl -s -o /dev/null -w "%{http_code}" --max-time 5 <SCAN_TARGET_URL><first_simple_path>
AskUserQuestion。AskUserQuestion を呼び出します:
"サーバーは応答しましたが、/ と <path> の両方が 404 を返しました — ベース URL が誤っている可能性があります(API が別のプレフィックスにマウントされているかもしれません)。どのように進めますか?"["別の URL を試す", "続行する", "キャンセル"]SCAN_TARGET_URL として保存し、ステージ 1 から再実行します。スキャンプレビュー用の OAS 分析 — 権限要求前にサイレントで実行。
OAS ファイルを読み込み、以下を収集します:
securitySchemes からの認証スキームタイプ(Bearer/JWT、API キー、Basic、OAuth2){…Id}、{…Key}、{…Ref} などのリソース ID プレースホルダーがあり、メソッドが GET、PUT、PATCH、DELETE の操作数example、examples、または default 値を持つ操作があるかスキャン設定の権限を要求します。 AskUserQuestion を呼び出します:
スキャン設定の準備ができました。
ターゲット: <SCAN_TARGET_URL> ✓ 疎通確認済 / ⚠ 疎通確認不可
OAS: <filename> (<N> 個の操作)
認証: <スキームタイプ> [+ 第 2 ユーザーが必要 — <N> 個の BOLA 候補]
サンプル: OAS にサンプルデータあり / サンプルなし — テストデータを提供する必要があります
タグ: <category>:<tagname> ← プラットフォームモードのみ(タグ割り当て時)。タグなしの場合は省略
モード: プラットフォーム / フリーミアム
"スキャン設定を開始する準備ができました。認証情報を求め、操作を分類し、テストシナリオをセットアップしてから、フルスキャン前にハッピーパス(正常系)検証を実行します。進めてもよろしいですか?"["はい、設定を開始します", "いいえ、キャンセル"]スキャンを実行します。 モードは既に事前チェックで確定されています — 再度導出しないでください。../../references/scan-workflow.md を読み、識別されたモードの該当コマンドのみを実行します。
ワークフローはスキャン設定をセットアップし、認証情報を収集し、テストデータを集め、操作を分類し、ハッピーパスを検証してから、フルスキャン実行前に再度権限確認を行います。リスク分類別の検出結果レポート(認可失敗 / セキュリティ品質ゲートブロッキング適合性 / 情報通知適合性)を提示し、OAS 変更を適用する前に同意待ちします。
必須チェックポイント: CONF_FILE への直接編集後(environments.default.variables.*、認証配線、またはシナリオチェーンを含む)、scan conf validate を実行し、ハッピーパスまたはフルスキャン実行に進む前にすべての検証エラーを解決してください。
フリーミアムモード: スキャンに対してセキュリティ品質ゲートは適用されません。すべての検出結果を情報として提示します。ユーザーが修正対象を決定します。
各権限確認プロンプトで、明示的なユーザー確認後にのみ続行します。
スキャン完了後、次の形式でサマリーを作成します:
スキャン完了
モード: プラットフォーム / フリーミアム
品質ゲート: 合格 (<sqg-name> — 貴組織のセキュリティ品質ゲートが満たされています) ← プラットフォームモード、合格時
品質ゲート: 不合格 (<sqg-name> — 品質ゲートが満たされていません。上記の修正が必要です) ← プラットフォームモード、不合格時
品質ゲート: N/A (フリーミアム — スキャン検出結果は情報提供のみ。ゲートは適用されません) ← フリーミアムモード
タグ: <category>:<tagname> ← プラットフォームモードのみ(タグ割り当て時)。タグなしの場合は此の行を省略
認可: 1 個の操作で BOLA 確認 — OAS 更新 · サーバー側の修正適用
適合性: 1 個のセキュリティ品質ゲートブロッキング問題を修正(OAS + コード)· 3 個の情報通知検出結果を提示
OAS 更新: <path/to/openapi.json>
現在のモードと結果に一致する品質ゲート行のみを表示します。
ユーザーが修正適用を拒否した、または問題が見つからなかった場合は、代わりにそう記述してください。
| 変数名 | 用途 |
|---|---|
SCAN42C_HOST |
スキャン対象のベース URL(OAS の servers[0] をオーバーライド)— 両モード対応 |
その他のすべての変数(API_KEY、PLATFORM_HOST、FREEMIUM_TOKEN)と一般的な制約は ../../references/pre-flight.md で定義されています。
Runs a single phase: Scan (live conformance + authorization testing and
SQG-blocking fix loop). Requires explicit user permission before execution.
Does not run a static audit — use the 42crunch-audit skill for that.
Assumes the OAS file is already audit-clean (or the user is explicitly
running scan only). If the user mentions audit issues before scanning, suggest
running 42crunch-audit first.
Pre-flight checks. Read ../../references/pre-flight.md and complete
all steps (setup, OAS resolution, tag detection). When prompting for OAS
file selection, use the context "scan" (e.g. "Which one should I scan?").
Do not proceed if any step fails or the user cancels.
Resolve the scan target URL.
Read servers[0].url from the OAS file.
SCAN42C_HOST environment variable is set → announce silently:
"Using scan target from SCAN42C_HOST:
<url>" Store asSCAN_TARGET_URLand proceed.
AskUserQuestion:
"The OAS points to <servers[0].url> as the API target. Is this the right URL to scan against?" — options: ["Yes — use this URL", "No — I'll provide a different URL"]SCAN_TARGET_URL.servers[0].url as SCAN_TARGET_URL.Reachability check — run immediately after SCAN_TARGET_URL is confirmed.
Uses a two-stage probe to distinguish "server is down" from "wrong base URL".
Stage 1 — probe the base URL:
curl -s -o /dev/null -w "%{http_code}" --max-time 5 <SCAN_TARGET_URL>/
AskUserQuestion:
"I couldn't reach <SCAN_TARGET_URL> — the connection timed out or was refused. How would you like to proceed?"["Try a different URL", "Continue anyway — the API may be temporarily down", "Cancel"]SCAN_TARGET_URL, re-run from Stage 1.Stage 2 — probe the first simple OAS path (only reached when Stage 1 returns 404):
Find the first GET path in the OAS that has no required path parameters. Strip any
{param}-style segments and probe:
curl -s -o /dev/null -w "%{http_code}" --max-time 5 <SCAN_TARGET_URL><first_simple_path>
AskUserQuestion as Stage 1.AskUserQuestion:
"The server responded but both / and <path> returned 404 — the base URL may be incorrect (the API may be mounted at a different prefix). How would you like to proceed?"["Try a different URL", "Continue anyway", "Cancel"]SCAN_TARGET_URL, re-run from Stage 1.OAS analysis for scan preview — run silently before asking permission.
Read the OAS file and collect:
securitySchemes (Bearer/JWT, API Key, Basic, OAuth2){…Id}, {…Key}, {…Ref}, or similar resource-ID placeholders AND the method is GET, PUT, PATCH, or DELETEexample, examples, or default values on its request body or parameter schemasAsk for permission to configure the scan. Call AskUserQuestion:
Ready to configure the scan?
Target: <SCAN_TARGET_URL> ✓ reachable / ⚠ reachability unknown
OAS: <filename> (<N> operations)
Auth: <scheme types> [+ second user needed — <N> BOLA candidate(s)]
Samples: OAS has sample data / No samples — you'll need to provide test data
Tag: <category>:<tagname> ← platform mode only, when a tag is assigned; omit if no tag
Mode: Platform / Freemium
"I'm ready to start configuring the scan. I'll ask for credentials, classify your operations, and set up test scenarios — then run a happy path validation before the full scan. Shall I proceed?"["Yes, let's configure", "No, cancel"]Execute the Scan. Mode is already resolved from pre-flight — do not
re-derive it. Read ../../references/scan-workflow.md and apply only the
commands for the identified mode throughout.
The workflow sets up the scan config, collects credentials, gathers test data,
classifies operations, validates happy paths, then asks for permission again
before running the full scan. It presents a risk-classified findings report
(Authorization failures / SQG-blocking conformance / informational conformance)
and pauses for consent before applying any OAS changes.
Mandatory checkpoint: after any direct edit to CONF_FILE (including
environments.default.variables.*, auth wiring, or scenario chains), run
scan conf validate and resolve all validation errors before continuing to
happy-path or full scan runs.
Freemium mode: no SQG is enforced for scan. Present all findings for information. The user decides which (if any) to fix.
Only continue after explicit user confirmation at each permission prompt.
After the scan completes, produce a summary in this shape:
Scan Complete
Mode: Platform / Freemium
SQG: PASSED (<sqg-name> — your org's security quality gate is met) ← platform mode, passed
SQG: FAILED (<sqg-name> — the quality gate is not met; fixes above are required) ← platform mode, failed
SQG: N/A (Freemium — scan findings are informational; no gate enforced) ← freemium mode
Tag: <category>:<tagname> ← platform mode only, when a tag is assigned; omit this row if no tag
Authorization: BOLA confirmed on 1 operation — OAS updated · server-side fix applied
Conformance: 1 SQG-blocking issue fixed (OAS + code) · 3 informational findings surfaced
OAS updated: <path/to/openapi.json>
Show only the one SQG line that matches the current mode and result.
If the user declined to apply fixes or no issues were found, note that instead.
| Variable | Purpose |
|---|---|
SCAN42C_HOST |
Scan target base URL (overrides OAS servers[0]) — Both modes |
All other variables (API_KEY, PLATFORM_HOST, FREEMIUM_TOKEN) and general
constraints are defined in ../../references/pre-flight.md.
原文・著作権は Anthropic および各プラグイン作者に帰属します。日本語訳は Claude API による自動翻訳です。