42Crunch監査とライブスキャン(実際の通信環境でのセキュリティ検査)の両方を1つのパイプライン(一連の処理フロー)で実行します。 次のような場合に使用: - ユーザーが監査とスキャンの両方を実行したい - セキュリティチェックの全工程を完了したい - 監査とスキャンのどちらを実行するべきかリクエストが曖昧な場合 「監査とスキャンを実行」「42Crunch全体パイプライン」「完全なセキュリティチェック」「監査の後スキャン」「42crunch」「SQG」といったフレーズで自動的に実行されます。 ただし、ユーザーが監査のみ(42crunch-auditを使用)またはスキャンのみ(42crunch-scanを使用)を明確に指定した場合は、このスキルを使用しないでください。
Run both a 42Crunch Audit and a live Scan together in a single pipeline. Use this skill when the user wants to run audit and scan together, complete the full security pipeline, or when the request is ambiguous about which phase to run. Triggers on phrases like "run audit and scan", "full 42crunch pipeline", "full security check", "audit then scan", "42crunch", or "SQG". Do NOT use this skill if the user explicitly requests only an audit (use 42crunch-audit) or only a scan (use 42crunch-scan).
監査(OAS(API仕様書)の静的分析と修正ループ)とスキャン(実際の環境への準拠テストと権限テスト)の2つのフェーズを管理します。各フェーズは実行前に明確なユーザー許可が必要です。
事前確認チェック。 ../../references/pre-flight.md を読み、すべてのステップ(セットアップ、OAS解決、タグ検出)を完了してください。OASファイル選択をプロンプトする際は、「pipeline」というコンテキストを使用します(例:「どのファイルをパイプラインで実行しましょうか?」)。いずれかのステップが失敗したり、ユーザーがキャンセルした場合は進まないでください。
フェーズ1の許可をリクエスト。 AskUserQuestion を呼び出してください:
"Ready to run a 42Crunch Audit on <filename>. This will analyse your OAS file and produce a scored report. Shall I proceed?"["Yes, proceed", "No, cancel"]フェーズ1を実行 — 監査。 モードは事前確認で既に判定されているため、再度決定しないでください。../../references/audit-workflow.md を読み、判定されたモードのコマンドのみを適用してください。
ワークフローは監査を実行してから、開発者向けで、リスク分類された報告書(SQGブロッキング/セキュリティ/データ検証の階層)を平易な英語の見出しとリスク説明で提示します。生のルールIDは表示しません。その後、一時停止して、ユーザーに修正を適用する前に同意を求めます。修正は明確な確認後のみ適用されます。
スキャン対象URLを確認。
OASファイルから servers[0].url を読み込みます。
SCAN42C_HOST 環境変数が設定されている場合 → サイレント表示:
"Using scan target from SCAN42C_HOST:
<url>"SCAN_TARGET_URLとして保存して進みます。
AskUserQuestion を呼び出します:
"The OAS points to <servers[0].url> as the API target. Is this the right URL to scan against?" — オプション: ["Yes — use this URL", "No — I'll provide a different 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 を呼び出します:
"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 に保存、段階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 を呼び出します:
"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 に保存、段階1から再実行。フェーズ2プレビュー用OAS分析 — フェーズ1完了後、フェーズ2の許可をリクエストする前にサイレント実行します。
OASファイルを読み込み、以下を収集します:
{…Id}、{…Key}、{…Ref} などのリソースID型プレースホルダーがあり、メソッドがGET、PUT、PATCH、またはDELETEである操作の数example、examples、または default 値を持つ操作があるかフェーズ2の許可をリクエスト。 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> ← プラットフォームモードのみ、タグが割り当てられている場合;タグなしの場合は省略
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"]フェーズ2を実行 — スキャン。 モードは事前確認で既に判定されているため、再度決定しないでください。../../references/scan-workflow.md を読み、判定されたモードのコマンドのみを適用してください。
ワークフローはスキャンを実行してから、リスク分類された検出報告書(権限失敗/SQGブロッキング準拠/情報提供準拠)を提示します。修正候補はSQGブロッキングルールと権限失敗により判定されます(重大度だけでなく)。スキルは一時停止して、OASに変更を加える前にユーザーに同意を求めます。
必須チェックポイント: フェーズ2中、CONF_FILE への直接編集後(environments.default.variables.*、認証ワイヤリング、シナリオチェーンを含む)、scan conf validate を実行して、すべての検証エラーを解決してからハッピーパスまたはフルスキャン実行に進んでください。
最終的な統合サマリーを提示。 (下の出力形式を参照)
成果に基づいて次のステップを推奨:
両フェーズが成功し、修正が適用された場合:
"Both audit and scan are passing. Your OAS is more precise and your security contract is enforced. Consider committing the updated OAS file and rerunning
42crunch-api-security-testingafter any significant API change."
いずれかのフェーズが失敗したか、ユーザーが修正を辞退した場合:
"Here's what's still open: [list remaining SQG-failing issues or unfixed scan findings by tier]. When you're ready to address them, run
42crunch-auditor42crunch-scanindividually."
いずれのフェーズでも問題が見つからなかった場合:
"Clean result — your API passed both static analysis and live testing. This is a good baseline to maintain."
各許可プロンプトでの明確なユーザー確認の後のみ続行してください。
両フェーズが完了した後、以下の形式でサマリーを生成します:
Phase 1 — Audit Complete
Score: <score> / 100 (Security: <sec-score> · Data Validation: <data-score>)
Score change: <initial-score> → <score> (<delta>) | Data: <initial-data> → <data-score> (<data-delta>) ← 修正が適用されていない場合は省略
Mode: Platform ← または "Freemium"
SQG: PASSED (<sqg-name> — your org's security quality gate is met) ← プラットフォームモード、合格
SQG: FAILED (<sqg-name> — the quality gate is not met; fixes above are required) ← プラットフォームモード、不合格
SQG: N/A (Freemium — no automated gate; user-defined thresholds applied this session) ← フリーミアムモード
Tag: <category>:<tagname> ← プラットフォームモードのみ、タグが割り当てられている場合;タグなしの場合はこの行を省略
Issues fixed: 2 SQG-blocking (0 security · 2 data validation)
OAS updated: <path/to/openapi.json>
Phase 2 — Scan Complete
Mode: Platform ← または "Freemium"
SQG: PASSED (<sqg-name> — your org's security quality gate is met) ← プラットフォームモード、合格
SQG: FAILED (<sqg-name> — the quality gate is not met; fixes above are required) ← プラットフォームモード、不合格
SQG: N/A (Freemium — scan findings are informational; no gate enforced) ← フリーミアムモード
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>
各フェーズごとに、現在のモードと結果に一致するSQG行のみを表示します。
フェーズ1の Score change: 行は ../../references/audit-workflow.md のステップ4で計算されたデルタ値から生成されます。監査修正が適用されていない場合(ユーザーが同意ゲートで辞退、またはSQGブロッキング問題がなかった)は省略します。
フェーズがスキップされた場合(ユーザーが辞退)、結果の代わりにそれを記載します。
| 変数 | 目的 |
|---|---|
SCAN42C_HOST |
スキャン対象ベースURL(OAS servers[0] をオーバーライド) — 両モード |
その他すべての変数(API_KEY、PLATFORM_HOST、FREEMIUM_TOKEN)と一般的な制約は ../../references/pre-flight.md で定義されています。
Orchestrates two phases: Audit (static OAS analysis and SQG fix loop) and Scan (live conformance + authorization testing). Each phase requires explicit user permission before execution.
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 "pipeline" (e.g. "Which one should I run
through the pipeline?"). Do not proceed if any step fails or the user cancels.
Ask for Phase 1 permission. Call AskUserQuestion:
"Ready to run a 42Crunch Audit on <filename>. This will analyse your OAS file and produce a scored report. Shall I proceed?"["Yes, proceed", "No, cancel"]Execute Phase 1 — Audit. Mode is already resolved from pre-flight — do
not re-derive it. Read ../../references/audit-workflow.md and apply only
the commands for the identified mode throughout.
The workflow runs the audit, then presents a developer-readable,
risk-classified report (SQG-Blocking / Security / Data Validation tiers)
with plain-English titles and risk descriptions — no raw rule IDs. It then
pauses and asks the user to consent before applying any fixes. Fixes are
only applied after explicit confirmation.
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 Phase 2 preview — run silently after Phase 1 completes, before asking for Phase 2 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 Phase 2 permission. 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 Phase 2 — 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 runs the scan, then presents a risk-classified findings
report (Authorization failures / SQG-blocking conformance /
informational conformance). Fix candidates are determined by SQG-blocking
rules and authorization failures — not severity alone. The skill pauses and
asks the user to consent before applying any OAS changes.
Mandatory checkpoint: during Phase 2, 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.
Present the final combined summary (see Output Format below).
Recommend next steps based on the outcome:
If both phases passed and fixes were applied:
"Both audit and scan are passing. Your OAS is more precise and your security contract is enforced. Consider committing the updated OAS file and rerunning
42crunch-api-security-testingafter any significant API change."
If either phase failed or the user declined fixes:
"Here's what's still open: [list remaining SQG-failing issues or unfixed scan findings by tier]. When you're ready to address them, run
42crunch-auditor42crunch-scanindividually."
If no issues were found in either phase:
"Clean result — your API passed both static analysis and live testing. This is a good baseline to maintain."
Only continue after explicit user confirmation at each permission prompt.
After both phases complete, produce a summary in this shape:
Phase 1 — Audit Complete
Score: <score> / 100 (Security: <sec-score> · Data Validation: <data-score>)
Score change: <initial-score> → <score> (<delta>) | Data: <initial-data> → <data-score> (<data-delta>) ← omit if no fixes applied
Mode: Platform ← or "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 — no automated gate; user-defined thresholds applied this session) ← freemium mode
Tag: <category>:<tagname> ← platform mode only, when a tag is assigned; omit this row if no tag
Issues fixed: 2 SQG-blocking (0 security · 2 data validation)
OAS updated: <path/to/openapi.json>
Phase 2 — Scan Complete
Mode: Platform ← or "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
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 per phase that matches the current mode and result.
The Score change: row in Phase 1 is produced from the delta values computed in
Step 4 of ../../references/audit-workflow.md. Omit it when no audit fixes were
applied (user declined at the consent gate, or there were no SQG-blocking issues).
If a phase was skipped (user declined), note that instead of its results.
| 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 による自動翻訳です。