• Projects
  • Service
  • About
  • branding.bz
  • Podcast
  • Tips
  • FAQ
  • Recruit
  • Download
  • Contact
  • branding.bz(ブランド構築SaaS)
  • DESIGN NOW(デザインメディア)
  • X
  • LinkedIn
  • Spotify
  • Facebook

213-0011 神奈川県川崎市高津区久本3-6-7-303

© 2026 ID INC. All rights reserved

claude-skills/スキル
SKILLOfficialsecurity

42crunch-scan

プラグイン
42crunch-api-security-testing
ソース
GitHub で見る ↗
説明

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.

ユースケース
  • APIが標準仕様に準拠しているか調べる
  • APIのアクセス制御が適切か検査する
  • BOLAテストを実行する
  • BFLAテストを実行する
  • スキャン結果の重大問題を修正する
本文(日本語訳)

42Crunch Scan スキル

単一フェーズを実行します: スキャン(ライブ適合性と認可テスト、およびセキュリティ品質ゲート(セキュリティ要件の自動チェック)ブロッキング修正ループ)。実行前に明示的なユーザー許可が必要です。

静的監査は実行しません — その場合は 42crunch-audit スキルを使用してください。

OAS ファイル(API仕様書)が既に監査済みであることを前提としています(またはユーザーがスキャンのみを明示的に実行している場合)。スキャン前に監査の問題について言及がある場合は、先に 42crunch-audit を実行することを提案してください。


エントリーポイント

  1. 事前チェック。 ../../references/pre-flight.md を読み、すべてのステップ(セットアップ、OAS ファイルの読み込み、タグ検出)を完了します。OAS ファイル選択をプロンプトする際は、コンテキスト "scan" を使用してください(例: 「どれをスキャンしますか?」)。何らかのステップが失敗した場合、またはユーザーがキャンセルした場合は先に進まないでください。

  2. スキャン対象のURL を確定する。

    OAS ファイルから servers[0].url を読み込みます。

    • SCAN42C_HOST 環境変数が設定されている → サイレント告知:

      "Using scan target from SCAN42C_HOST: <url>" SCAN_TARGET_URL として保存して進みます。

    • 設定されていない → AskUserQuestion を呼び出します:
      • question: "OAS では <servers[0].url> を API のターゲットとして指しています。これはスキャンに使用する正しい URL ですか?" — オプション: ["はい、この 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>/
    
    • 2xx, 3xx, 401, 403, or 405 → API に到達可能。サイレントで進みます。
    • 接続拒否またはタイムアウト → AskUserQuestion を呼び出します:
      • question: "<SCAN_TARGET_URL> に到達できません — 接続がタイムアウトするか拒否されました。どのように進めますか?"
      • options: ["別の URL を試す", "続行する — API は一時的にダウンしているかもしれません", "キャンセル"]
      • 別の URL を試す の場合 → 新しい URL を求め、SCAN_TARGET_URL として保存し、ステージ 1 から再実行します。
      • 続行する の場合 → 警告を記録して進みます。
      • キャンセル の場合 → 停止します。
    • 404 → 不確定(サーバーは起動しているが、ルートに何もマウントされていない可能性があります)。ステージ 2 に進みます。

    ステージ 2 — 最初のシンプルな OAS パスをプローブ(ステージ 1 が 404 を返した場合のみ実行): OAS の最初の GET パスを探します(必須のパスパラメータなし)。{param} スタイルのセグメントを削除し、プローブします:

    curl -s -o /dev/null -w "%{http_code}" --max-time 5 <SCAN_TARGET_URL><first_simple_path>
    
    • 任意の HTTP レスポンス → サーバーは起動しています(ルートにはハンドラーがありません)。サイレントで進みます。
    • 接続拒否またはタイムアウト → ステージ 1 と同じ AskUserQuestion。
    • 再び 404 → AskUserQuestion を呼び出します:
      • question: "サーバーは応答しましたが、/ と <path> の両方が 404 を返しました — ベース URL が誤っている可能性があります(API が別のプレフィックスにマウントされているかもしれません)。どのように進めますか?"
      • options: ["別の URL を試す", "続行する", "キャンセル"]
      • 別の URL を試す の場合 → 新しい URL を求め、SCAN_TARGET_URL として保存し、ステージ 1 から再実行します。
      • 続行する の場合 → 警告を記録して進みます。
      • キャンセル の場合 → 停止します。
  3. スキャンプレビュー用の OAS 分析 — 権限要求前にサイレントで実行。

    OAS ファイルを読み込み、以下を収集します:

    • 操作の総数
    • securitySchemes からの認証スキームタイプ(Bearer/JWT、API キー、Basic、OAuth2)
    • BOLA(権限昇格)候補数: パスに {…Id}、{…Key}、{…Ref} などのリソース ID プレースホルダーがあり、メソッドが GET、PUT、PATCH、DELETE の操作数
    • OAS に サンプルデータ が含まれているか: リクエストボディまたはパラメータスキーマに example、examples、または default 値を持つ操作があるか
  4. スキャン設定の権限を要求します。 AskUserQuestion を呼び出します:

    • question: (スキャンプレビューを最初に表示してから質問)
      スキャン設定の準備ができました。
        ターゲット:  <SCAN_TARGET_URL>  ✓ 疎通確認済  /  ⚠ 疎通確認不可
        OAS:         <filename>  (<N> 個の操作)
        認証:        <スキームタイプ>  [+  第 2 ユーザーが必要 — <N> 個の BOLA 候補]
        サンプル:   OAS にサンプルデータあり  /  サンプルなし — テストデータを提供する必要があります
        タグ:        <category>:<tagname>           ← プラットフォームモードのみ(タグ割り当て時)。タグなしの場合は省略
        モード:      プラットフォーム / フリーミアム
      
      "スキャン設定を開始する準備ができました。認証情報を求め、操作を分類し、テストシナリオをセットアップしてから、フルスキャン前にハッピーパス(正常系)検証を実行します。進めてもよろしいですか?"
    • options: ["はい、設定を開始します", "いいえ、キャンセル"]
  5. スキャンを実行します。 モードは既に事前チェックで確定されています — 再度導出しないでください。../../references/scan-workflow.md を読み、識別されたモードの該当コマンドのみを実行します。

    ワークフローはスキャン設定をセットアップし、認証情報を収集し、テストデータを集め、操作を分類し、ハッピーパスを検証してから、フルスキャン実行前に再度権限確認を行います。リスク分類別の検出結果レポート(認可失敗 / セキュリティ品質ゲートブロッキング適合性 / 情報通知適合性)を提示し、OAS 変更を適用する前に同意待ちします。

必須チェックポイント: CONF_FILE への直接編集後(environments.default.variables.*、認証配線、またはシナリオチェーンを含む)、scan conf validate を実行し、ハッピーパスまたはフルスキャン実行に進む前にすべての検証エラーを解決してください。

フリーミアムモード: スキャンに対してセキュリティ品質ゲートは適用されません。すべての検出結果を情報として提示します。ユーザーが修正対象を決定します。

  1. 最終スキャンサマリーを提示します(下記の出力形式を参照)。

各権限確認プロンプトで、明示的なユーザー確認後にのみ続行します。


出力形式

スキャン完了後、次の形式でサマリーを作成します:

スキャン完了
  モード:           プラットフォーム / フリーミアム
  品質ゲート:       合格  (<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 で定義されています。

原文(English)を表示

42Crunch Scan Skill

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.


Entry Point

  1. 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.

  2. Resolve the scan target URL.

    Read servers[0].url from the OAS file.

    • If SCAN42C_HOST environment variable is set → announce silently:

      "Using scan target from SCAN42C_HOST: <url>" Store as SCAN_TARGET_URL and proceed.

    • If not set → call AskUserQuestion:
      • question: "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"]
      • If No → ask the user to provide the URL and store it as SCAN_TARGET_URL.
      • If Yes → store 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>/
    
    • 2xx, 3xx, 401, 403, or 405 → API is reachable. Proceed silently.
    • Connection refused or timeout → call AskUserQuestion:
      • question: "I couldn't reach <SCAN_TARGET_URL> — the connection timed out or was refused. How would you like to proceed?"
      • options: ["Try a different URL", "Continue anyway — the API may be temporarily down", "Cancel"]
      • If Try a different URL → ask for new URL, store as SCAN_TARGET_URL, re-run from Stage 1.
      • If Continue anyway → proceed with warning noted.
      • If Cancel → stop.
    • 404 → ambiguous (server may be up but nothing is mounted at root). Proceed to Stage 2.

    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>
    
    • Any HTTP response → server is up; root just has no handler. Proceed silently.
    • Connection refused or timeout → same AskUserQuestion as Stage 1.
    • 404 again → call AskUserQuestion:
      • question: "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?"
      • options: ["Try a different URL", "Continue anyway", "Cancel"]
      • If Try a different URL → ask for new URL, store as SCAN_TARGET_URL, re-run from Stage 1.
      • If Continue anyway → proceed with warning noted.
      • If Cancel → stop.
  3. OAS analysis for scan preview — run silently before asking permission.

    Read the OAS file and collect:

    • Total operation count
    • Auth scheme types from securitySchemes (Bearer/JWT, API Key, Basic, OAuth2)
    • BOLA candidate count: operations where the path has {…Id}, {…Key}, {…Ref}, or similar resource-ID placeholders AND the method is GET, PUT, PATCH, or DELETE
    • Whether the OAS contains sample data: any operation with example, examples, or default values on its request body or parameter schemas
  4. Ask for permission to configure the scan. Call AskUserQuestion:

    • question: (show the scan preview first, then ask)
      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?"
    • options: ["Yes, let's configure", "No, cancel"]
  5. 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.

  1. Present the final scan summary (see Output Format below).

Only continue after explicit user confirmation at each permission prompt.


Output Format

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.


Environment Variables

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 による自動翻訳です。