claude-skills/

Anthropic公式スキル・プラグインの日本語ディレクトリ

last sync 22h ago
スキルOfficialsecurity

🔍42crunch-scan

説明

42Crunchのライブ適合性スキャンおよび認可スキャンをAPIに対して実行し、SQGをブロックするスキャン検出結果を修正します。 次のような場合に使用: ユーザーが適合性テスト、認可スキャン、BOLAテスト、BFLAテスト、スキャン設定の生成または構成、あるいはスキャンで報告された問題の修正を行いたい場合。 「run scan」「scan only」「conformance test」「BOLA test」「BFLA test」「42crunch scan」「scan config」などのフレーズ、または静的オーディットを実行せずにライブ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の適合性テストを実行するとき
  • 認可スキャンを実行するとき
  • BOLAテスト、BFLAテストを実行するとき
  • スキャン設定を生成または構成するとき
  • スキャンで報告された問題を修正するとき

本文(日本語訳)

42Crunch スキャン スキル

単一フェーズ Scan(ライブ適合性 + 認可テスト、および SQG ブロッキング修正ループ)を実行します。 実行前にユーザーの明示的な許可が必要です。 静的監査は実行しません — 静的監査には 42crunch-audit スキルを使用してください。

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


エントリーポイント

  1. プリフライトチェック。 ../../references/pre-flight.md を読み込み、すべての手順(セットアップ、OAS 解決、タグ検出)を完了させてください。 OAS ファイルの選択を促す際は、コンテキストとして "scan" を使用してください(例: "Which one should I scan?")。 いずれかの手順が失敗した場合、またはユーザーがキャンセルした場合は処理を進めないでください。

  2. スキャン対象 URL の解決。

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

    • 環境変数 SCAN42C_HOST が設定されている場合 → サイレントで以下を通知:

      "Using scan target from SCAN42C_HOST: <url>" SCAN_TARGET_URL として保存し、処理を続行します。

    • 設定されていない場合 → 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"]
      • No の場合 → ユーザーに URL を入力してもらい、SCAN_TARGET_URL として保存します。
      • Yes の場合 → servers[0].urlSCAN_TARGET_URL として保存します。
  3. スキャンプレビューのための OAS 分析 — 許可を求める前にサイレントで実行します。

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

    • オペレーションの総数
    • securitySchemes から認証スキームの種類(Bearer/JWT、API Key、Basic、OAuth2)
    • BOLA 候補数: パスに {…Id}{…Key}{…Ref} などのリソース ID プレースホルダーが含まれ、かつメソッドが GET、PUT、PATCH、DELETE であるオペレーション
    • OAS にサンプルデータが含まれているか: リクエストボディまたはパラメータスキーマに exampleexamples、または default 値を持つオペレーションが存在するか
  4. スキャン設定の許可を求める。 最初に以下のスキャンプレビューをチャットメッセージとして出力します:

    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>           ← プラットフォームモードのみ。タグが割り当てられている場合に表示。タグがない場合は省略
      Mode:     Platform / Free Trial
    

    次に 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"]
  5. スキャンの実行。 モードはプリフライトで解決済みです — 再導出はしないでください。

    到達可能性チェック../../references/reachability-check.md を読み込み、 2 段階プローブを今すぐ実行します。完了後(またはユーザーがキャンセルした場合は停止後)、ここに戻ります。

    ../../references/scan-workflow.md を読み込み、特定されたモード用のコマンドのみを全体を通して適用します。 ワークフローでは、スキャン設定のセットアップ、クレデンシャルの収集、テストデータの収集、 オペレーションごとの分類テーブルの完全表示、ハッピーパスの検証を行い、 フルスキャン実行前に再度許可を求めます。 リスク分類されたファインディングレポート(認可失敗 / SQG ブロッキング適合性 / 情報提供の適合性)を提示します。 修正候補は SQG ブロッキングルールと認可失敗によって決定されます — 重大度のみによるものではありません。 OAS への変更またはサーバーサイドのコード修正を適用する前に、スキルは一時停止してユーザーの同意を求めます。 最終スキャンサマリーの前に、サーバーサイドのコード修正の適用後(またはスキップ後)に API の再起動をユーザーに促すことを検討してください。

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

    フリートライアルモード: スキャンに SQG は適用されません。 すべてのファインディングを情報提供として提示します。 修正するかどうか(およびどれを修正するか)はユーザーが決定します。

  6. ファインディングの表示と、最終スキャンサマリー前の修正許可の確認。

    フルスキャン完了後、ファインディングが存在する場合は最終「Scan Complete」サマリーに 直接進まないでください。まず scan-workflow.md のステップ 12 を順番に完了させます:

    • 3 層スキャンレポート(認可失敗 / SQG ブロッキング適合性 / 情報提供の適合性)を完全に表示する;
    • そのレポートと SQG ブロッキングルールから修正候補リストを作成する;
    • 提案された修正リストを含むステップ 12c の同意確認をユーザーに求める。

    ユーザーが修正の適用を明示的に選択した場合にのみ、OAS またはサーバーサイドのコード修正に進みます。 ユーザーが修正を拒否した場合、または修正とオプションの検証ループが完了した後に、 最終スキャンサマリーを提示します(以下の「出力フォーマット」を参照)。

各許可プロンプトでユーザーの明示的な確認を得た後にのみ、処理を続行してください。


出力フォーマット

スキャン完了後、以下の形式でサマリーを出力します:

Scan Complete
  Mode:           Platform / Free Trial
  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  (Free Trial — scan findings are informational; no gate enforced)    ← フリートライアルモード
  Tag:            <category>:<tagname>             ← プラットフォームモードのみ。タグが割り当てられている場合に表示。タグがない場合はこの行を省略
  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 行だけ表示してください。

ユーザーが修正の適用を拒否した場合、または問題が見つからなかった場合は、その旨を記載してください。


環境変数

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

その他の変数(API_KEYPLATFORM_HOSTTRIAL_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.
  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. 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 / Free Trial
    

    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"]
  5. Execute the 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: 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.

Free Trial mode: no SQG is enforced for scan. Present all findings for information. The user decides which (if any) to fix.

  1. Render findings and ask for fix permission before final Scan summary.

    After the full scan completes, do not jump directly to the final "Scan Complete" summary when findings exist. First complete scan-workflow.md Step 12 in order:

    • render the full three-tier scan report (Authorization failures / SQG-blocking conformance / informational conformance);
    • assemble the fix candidate lists from that report and the SQG blocking rules;
    • ask the user the Step 12c consent question with the proposed fix lists.

    Only proceed to OAS or server-side code fixes after the user explicitly chooses to apply fixes. If the user declines fixes, or after the fix and optional verification loop completes, then 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 / Free Trial
  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  (Free Trial — scan findings are informational; no gate enforced)    ← free trial 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, TRIAL_TOKEN) and general constraints are defined in ../../references/pre-flight.md.

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