• 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-api-security-testing

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

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

ユースケース
  • 監査とスキャンの両方を実行したい
  • セキュリティチェックの全工程を完了したい
  • 監査とスキャンのどちらを実行するべきか曖昧な場合
本文(日本語訳)

42Crunch API セキュリティスキル

監査(OASファイルの静的解析と修正ループ)とスキャン(実際の動作確認とセキュリティ権限テスト)の2つのフェーズを順序立てて実行します。各フェーズは、ユーザーの明示的な許可を得てからのみ実行されます。


実行の流れ

  1. 事前確認を行う。 ../../references/pre-flight.md を読んで、すべての準備を完了させます(セットアップ、OASファイルの読み込み、タグの検出)。OASファイルの選択を促す際は「パイプラインを通すなら、どれを選びますか?」というように「パイプライン」という文脈を使用してください。いずれかの手順が失敗するか、ユーザーがキャンセルした場合は、先に進まないでください。

  2. フェーズ1の実行許可を求める。 AskUserQuestion を呼び出します:

    • 質問: 「<ファイル名>に対して42Crunch監査を実行する準備ができました。OASファイルを分析して、スコア付きレポートを生成します。進めてよろしいですか?」
    • 選択肢: 「はい、進める」「いいえ、キャンセル」
  3. フェーズ1を実行 — 監査。 実行モード(プラットフォーム/トークン)は事前確認で既に決まっているため、ここで改めて判定しないでください。../../references/audit-workflow.md を読んで、判定されたモードに対応するコマンドのみを使用します。

    監査を実行し、その後、開発者にとって読みやすく、リスク別に分類されたレポートを提示します(SQGブロッキング・セキュリティ・データ検証・仕様準拠のレベル別に、生のルールIDではなく、わかりやすいタイトルとリスク説明を表示)。その後一旦停止して、修正を適用する前にユーザーの同意を得ます。修正は明示的な確認後のみ適用されます。

  4. スキャン対象のURLを確認する。

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

    • SCAN42C_HOST 環境変数が設定されている場合 → 以下を静かに表示:

      「スキャン対象をSCAN42C_HOSTから使用します: <url>」 これを SCAN_TARGET_URL として保存して、処理を続行します。

    • 設定されていない場合 → AskUserQuestion を呼び出します:
      • 質問: 「OASファイルが指す<servers[0].url>がAPIのスキャン対象として正しいですか?」 — 選択肢: 「はい、このURLを使用」「いいえ、別のURLを指定する」
      • 「いいえ」を選んだ場合 → ユーザーにURLを入力させ、SCAN_TARGET_URL として保存します。
      • 「はい」を選んだ場合 → servers[0].url を SCAN_TARGET_URL として保存します。
  5. フェーズ2のプレビューのためのOAS分析 — フェーズ1が完了した後、フェーズ2の許可を求める前に、静かに実行します。

    OASファイルを読み込んで以下を集計します:

    • 操作(API呼び出し)の総数
    • 認証スキームの種類(ベアラートークン/JWT、APIキー、Basic認証、OAuth2など)
    • BOLA侯補の数:クライアントが指定するID/キー/参照によって既存リソースを特定する操作。パスパラメータ({…Id}、{…Key}、{…Ref})、クエリパラメータ(?orderId=)、またはリクエストボディのフィールド(POST /lookup {orderId}、POST /transfer {fromAccountId, toAccountId})に該当する操作。メソッド(GET・POSTなど)は該当性に影響しません。単純な一覧取得や新規作成操作のみを除外
    • OASがサンプルデータを含むかどうか:リクエストボディまたはパラメータスキーマに example、examples、または default の値を持つ操作があるか

    これらの結果は保持しておいてください — scan-workflow.md がこれを後で再利用し、認証設定、テストデータ、分類ステップで再びOASを読む必要がなくなります。

  6. フェーズ2の実行許可を求める。 次のスキャンプレビューをチャットメッセージとして最初に出力します:

    スキャンの設定準備ができました
      対象:     <SCAN_TARGET_URL>
      OAS:      <ファイル名>  (<N>個の操作)
      認証:     <スキームの種類>  [+ 別ユーザーが必要 — <N>個のBOLA候補]
      サンプル: OASがサンプルデータを含む  /  サンプルなし — テストデータの提供が必要
      タグ:     <カテゴリ>:<タグ名>           ← プラットフォームモード、タグが割り当てられている場合のみ; タグがない場合は省略
      モード:   プラットフォーム / トークン
    

    その後、AskUserQuestion を呼び出します:

    • 質問: 「スキャンの設定を開始する準備ができました。認証情報、操作の分類、テストシナリオを設定し、正常系の検証を行ったあとで、本格的なスキャンを実行します。進めてよろしいですか?」
    • 選択肢: 「はい、設定を進める」「いいえ、キャンセル」
  7. フェーズ2を実行 — スキャン。 実行モードは事前確認で既に決まっているため、ここで改めて判定しないでください。

    到達可能性の確認 — ../../references/reachability-check.md を読んで、2段階の試験的接続を今実行してください。完了後(またはユーザーがキャンセル時)ここに戻ってください。

    ../../references/scan-workflow.md を読んで、判定されたモードに対応するコマンドのみを使用します。 スキャン設定を構築し、認証情報を収集し、テストデータを集約し、操作ごとの完全な分類表を表示し、正常系を検証してから、本格スキャンの実行前に再び許可を求めます。その後、リスク別に分類された検出結果レポートを提示します(認可失敗・SQGブロッキング仕様準拠・情報レベルの仕様準拠)。修正候補はSQGブロッキングルールと認可失敗で判定されます — 重大度だけでは判定されません。スキルは一旦停止して、OASの変更またはサーバー側のコード修正の適用前にユーザーの同意を得ます。オプションとして、サーバー側コード修正の適用または スキップ後に、最終スキャンサマリーの前にAPIの再起動をユーザーに促すことができます。

    必須チェックポイント: フェーズ2中、CONF_FILE に直接編集を加えた後(environments.default.variables.*、認証接続、またはシナリオチェーンを含む)、scan conf validate を実行して、すべての検証エラーを解決してから、正常系または本格スキャンに進みます。

  8. 最終的な統合サマリーを表示します(後述の「出力形式」を参照)。

  9. 結果に基づいて次のステップを推奨します:

    両フェーズが成功し、修正が適用された場合:

    「監査とスキャンの両方がパスしました。OASファイルはより正確になり、セキュリティ契約が実装されます。更新したOASファイルのコミット、およびAPIに大きな変更があった場合は42crunch-api-security-testingの再実行をお勧めします。」

    いずれかのフェーズが失敗した、またはユーザーが修正を拒否した場合:

    「未解決の問題: [SQG不合格の問題または未修正のスキャン検出結果をレベル別にリスト]。これらに対応する準備ができたら、42crunch-auditまたは42crunch-scanを個別に実行してください。」

    いずれのフェーズでも問題が見つからなかった場合:

    「問題なし — APIは静的解析と実際の動作確認の両方をパスしました。これを基準として維持することをお勧めします。」

各許可プロンプトで明示的なユーザー確認を得た後のみ、処理を続行します。


出力形式

両フェーズが完了した後、以下の形式でサマリーを作成します:

フェーズ1 — 監査完了
  スコア:          <スコア> / 100  (セキュリティ: <セキュリティスコア> · データ検証: <データスコア>)
  スコア変化:      <初期スコア> → <スコア>  (<差分>)  |  データ: <初期データ> → <データスコア>  (<データ差分>)   ← 修正が適用されなかった場合は省略
  モード:          プラットフォーム                 ← または「トークン」
  SQG:             合格  (<SQG名> — 貴組織のセキュリティ品質ゲートを満たしています)     ← プラットフォームモード、合格時
  SQG:             不合格  (<SQG名> — 品質ゲートを満たしていません; 上記の修正が必要です)    ← プラットフォームモード、不合格時
  SQG:             N/A  (トークンモード — 自動ゲートなし; このセッションでユーザー定義の閾値を適用)    ← トークンモード
  タグ:            <カテゴリ>:<タグ名>              ← プラットフォームモード、タグが割り当てられている場合のみ; タグがない場合は省略
  修正された問題:   2件のSQGブロッキング  (0件セキュリティ · 2件データ検証)
  OAS更新:         <パス/openapi.json>

フェーズ2 — スキャン完了
  モード:          プラットフォーム                 ← または「トークン」
  SQG:             合格  (<SQG名> — 貴組織のセキュリティ品質ゲートを満たしています)    ← プラットフォームモード、合格時
  SQG:             不合格  (<SQG名> — 品質ゲートを満たしていません; 上記の修正が必要です)    ← プラットフォームモード、不合格時
  SQG:             N/A  (トークンモード — スキャン検出結果は情報提供のみ; ゲート適用なし)    ← トークンモード
  認可:            1件の操作でBOLA確認 — OAS更新 · サーバー側修正適用
  準拠:            1件のSQGブロッキング問題修正 (OAS+コード) · 3件の情報レベルの検出結果を表示
  OAS更新:         <パス/openapi.json>

現在のモードと結果に一致するSQG行のみを、各フェーズごとに1行表示してください。

フェーズ1のスコア変化:行は、../../references/audit-workflow.mdのステップ4で計算された差分値から生成されます。監査修正が適用されなかった場合(ユーザーが同意ゲートで拒否、またはSQGブロッキング問題がなかった)は、省略してください。

フェーズがスキップされた場合(ユーザーが拒否)は、その結果の代わりにそのことを記載してください。


環境変数

変数 用途
SCAN42C_HOST スキャン対象のベースURL(OASのservers[0]を上書き) — 両モード

その他のすべての変数(API_KEY、PLATFORM_HOST、TRIAL_TOKEN)と一般的な制約は、../../references/pre-flight.mdで定義されています。

原文(English)を表示

42Crunch API Security Skill

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.


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 "pipeline" (e.g. "Which one should I run through the pipeline?"). Do not proceed if any step fails or the user cancels.

  2. Ask for Phase 1 permission. Call AskUserQuestion:

    • question: "Ready to run a 42Crunch Audit on <filename>. This will analyse your OAS file and produce a scored report. Shall I proceed?"
    • options: ["Yes, proceed", "No, cancel"]
  3. 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 / Spec Conformance 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.

  4. 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.
  5. OAS analysis for Phase 2 preview — run silently after Phase 1 completes, before asking for Phase 2 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 that reference a specific existing resource by a client-supplied id/key/ref — in a path parameter ({…Id}, {…Key}, {…Ref}), a query parameter (?orderId=), or a request-body field (POST /lookup {orderId}, POST /transfer {fromAccountId, toAccountId}). Method does not gate candidacy; only pure collection or create-new operations are excluded
    • Whether the OAS contains sample data: any operation with example, examples, or default values on its request body or parameter schemas

    Carry these results forward — scan-workflow.md reuses them in its auth setup, test-data, and classification steps instead of re-reading the OAS.

  6. Ask for Phase 2 permission. Output the following scan preview as a chat message first:

    Ready to configure the scan?
      Target:   <SCAN_TARGET_URL>
      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 / Token
    

    Then call AskUserQuestion:

    • question: "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"]
  7. Execute Phase 2 — Scan. Mode is already resolved from pre-flight — do not re-derive it.

    Reachability check — read ../../references/reachability-check.md and run the two-stage probe now. Return here once it completes (or stop if the user cancels).

    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, shows a complete operation-by-operation classification table, 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). 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 or server-side code fixes. Optionally prompt user to restart the API after server-side code fixes are applied, or skipped, before the final scan summary.

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.

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

  2. 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-testing after 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-audit or 42crunch-scan individually."

    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.


Output Format

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 "Token"
  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  (Token mode — no automated gate; user-defined thresholds applied this session)    ← token 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 "Token"
  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  (Token mode — scan findings are informational; no gate enforced)    ← token 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.


Environment Variables

Variable Purpose
SCAN42C_HOST Scan target base URL (overrides OAS servers[0]) — Both modes

All other variables (API_KEY, PLATFORM_HOST, TRIAL_TOKEN) and general constraints are defined in ../../references/pre-flight.md.

原文・著作権は Anthropic および各プラグイン作者に帰属します。日本語訳は Claude API による自動翻訳です。