42Crunchの環境をセットアップして、監査と検査のスキルがスムーズに動作するようにします。 次のような場合に使用: ユーザーが42Crunchを初めて設定したい、42c-astバイナリ(実行可能なプログラム)をインストールまたは更新したい、APIキー(認証用の暗号化コード)を設定したい、または認証情報やバイナリのエラーをトラブルシューティングしたい場合。 「42crunchのセットアップ」「42crunchの設定」「42c-astのインストール」「42c-astの更新」「APIキーの設定」「42crunchが動作しない」「バイナリが見つからない」といった表現や、監査・検査の実行前に環境を準備するリクエストで自動起動します。
Set up the 42Crunch environment so that audit and scan skills can run without friction. Use this skill whenever the user wants to configure 42Crunch for the first time, install or update the 42c-ast binary, configure an API key, or troubleshoot missing credentials or binary errors. Triggers on phrases like "setup 42crunch", "configure 42crunch", "install 42c-ast", "update 42c-ast", "set api key", "42crunch not working", "binary not found", or any request to prepare the environment before running an audit or scan.
42Crunch(APIのセキュリティ診断・監査ツール)の環境を、以下の2つのフェーズで準備します:
42c-ast バイナリ(実行形式プログラム)が正しい場所にインストールされていることを確認する呼び出し元の文脈: このスキルは、ユーザーが直接実行することもあれば、別のスキル(例:
pre-flight)から呼び出されることもあります。呼び出し元が指定されているかを確認してください。ステップ1と6は文脈に応じて動作が異なります。各ステップの説明を参照してください。
ユーザーが直接実行した場合(呼び出し元の文脈がない場合)、ユーザーを歓迎し、セットアップ完了後にできることを説明します:
ようこそ — 42Crunchの環境を整えます。これは1回限りのセットアップで、約2分かかります。完了すれば、以下のことができるようになります:
- Audit(診断) — OpenAPIファイルのセキュリティ問題をスコア形式で診断し、対応策を提示
- Scan(スキャン) — 実行中のAPIに対してBOLA(認可チェック漏れ)、BFLA(機能レベルのアクセス制御漏れ)、仕様への準拠状況をテスト
- Fix(修正) — セキュリティグレード問題を自動修正します(各ステップで承認が必要)
以下の2つのステップで対応します:
- このマシンに
42c-ast分析ツールをインストール- 42Crunchの認証情報を設定(既存アカウント、または無料アカウント)
始めましょう。
別のスキルから呼び出された場合(呼び出し元の文脈がある場合)、この案内をスキップし、ステップ2に直接進みます。
../../references/binary-setup.md の手順に従います(詳細表示モード — 各主要ステップをユーザーに報告)。
バイナリがインストールできない場合は、明確なエラーを表示して停止します。ステップ3には進みません。
../../references/credential-setup.md の手順に従います。
この手順は以下の順序で進みます:
~/.42crunch/conf/env(macOS/Linux)または %APPDATA%\42Crunch\conf\env(Windows)に存在しないか確認します。既に設定されていれば、現在のモードとマスクされたキーを表示し、保持するか置き換えるかを選択させます。https://42crunch.com/freemium/)を表示して停止~/.42crunch/conf/env に書き込み、macOS/Linuxで chmod 600 を設定します。簡単な動作確認を実行します:
# バイナリ(macOS / Linux)
"$HOME/.42crunch/bin/42c-ast" --version
# バイナリ(Windows)
& "$env:APPDATA\42Crunch\bin\42c-ast.exe" --version
# 認証情報(macOS / Linux)
grep -E "^(API_KEY|FREEMIUM_TOKEN)=" "$HOME/.42crunch/conf/env"
いずれかの確認が失敗した場合は、具体的な失敗内容を報告し、ユーザーが解決できるようにガイドしてから続行します。
セットアップの要約を表示します(出力形式は下を参照)。
別のスキルから呼び出された場合(呼び出し元の文脈がある場合)、次のステップの提案をスキップします。「Setup complete — continuing.(セットアップ完了 — 続行します)」と表示して、制御を呼び出し元に戻します。呼び出し元(例: pre-flight)は途中から再開します。
ユーザーが直接実行した場合(呼び出し元の文脈がない場合)、以下を提示します:
セットアップが完了しました。今すぐできることを紹介します:
42crunch-audit— OpenAPIファイルを提供してください。スコアを付け、セキュリティ問題を重大度で分類し、優先度の高い問題は承認のうえ自動修正します。APIを初めて診断する場合の第一歩です。
42crunch-scan— 実行中のAPIに対して仕様への準拠性と認可テストを実行します。BOLA、BFLA、応答契約違反をチェックします。診断が完了した後の実行が効果的です。
42crunch-api-security-testing— 診断とスキャンを連続実行します。1回のセッションで全体像を把握したい場合の推奨ワークフローです。どれから始めたいですか?
## 42Crunch セットアップ完了
| 項目 | ステータス |
|--------------------|-----------------------------------------------------|
| バイナリ | <BINARY_PATH> v<version> |
| 認証モード | <Platform(プラットフォーム)\| Freemium(フリーミアム)> |
| APIキー/トークン | Platform(プラットフォーム): `api_••••••••` または `ide_••••••••` |
| | Freemium(フリーミアム): `<最初の4文字>••••••••` |
| | (保存先: <path>) |
| プラットフォーム | <url> ← フリーミアムモードの場合は非表示 |
api_•••••••• / ide_•••••••• の形式で先頭を残して置き換え、フリーミアムトークンは <最初の4文字>•••••••• の形式。例: eyJh••••••••)。bash_tool を使用します。設定ファイル作成時は str_replace_editor または create_file を使用し、シェルのリダイレクトは使いません。curl を使用。使えない場合は wget にフォールバック。Windows では Invoke-WebRequest を使用します。42c-ast.exe、パスは \ を使用、設定は %APPDATA%\42Crunch\conf\env に保存、chmod 600 はスキップ(Windows ACLが APPDATA を保護します)。| 変数 | デフォルト | モード |
|---|---|---|
API_KEY |
(必須) | プラットフォーム |
PLATFORM_HOST |
(セットアップ中に設定) | プラットフォームのみ |
FREEMIUM_TOKEN |
(必須) | フリーミアム |
Prepares the environment for 42Crunch audit and scan workflows in two phases:
42c-ast binary is installed at the canonical path.Caller context: This skill may be invoked directly by the user or as a subroutine by another skill (e.g.
pre-flight). Check whether a caller was passed. Steps 1 and 6 behave differently depending on this context — see each step for details.
If called directly by the user (no caller context), greet the user and explain what they'll be able to do once setup is complete:
Welcome — let me get your 42Crunch environment ready. This is a one-time setup that takes about two minutes. Once done, you'll be able to:
- Audit any OpenAPI file for security issues and get a scored, actionable report
- Scan a live API to catch BOLA, BFLA, and conformance problems
- Fix SQG-blocking issues automatically, with your approval at every step
I'll handle this in two quick steps:
- Install the
42c-astanalysis binary on this machine.- Connect your 42Crunch credentials (existing platform account or free account).
Let's go.
If called as a subroutine (caller context is set), skip this greeting entirely and proceed directly to Step 2.
Follow ../../references/binary-setup.md completely (verbose mode — announce each major step to the user).
Stop and surface a clear error if the binary cannot be installed. Do not proceed to Step 3.
Follow ../../references/credential-setup.md completely.
The procedure covers, in order:
~/.42crunch/conf/env (macOS/Linux) or %APPDATA%\42Crunch\conf\env
(Windows). If already configured: show mode + masked key, offer to keep or replace.https://42crunch.com/freemium/) and stop~/.42crunch/conf/env, set chmod 600 on macOS/Linux.Run a quick end-to-end check:
# Binary (macOS / Linux)
"$HOME/.42crunch/bin/42c-ast" --version
# Binary (Windows)
& "$env:APPDATA\42Crunch\bin\42c-ast.exe" --version
# Credentials (macOS / Linux)
grep -E "^(API_KEY|FREEMIUM_TOKEN)=" "$HOME/.42crunch/conf/env"
If either check fails, report the specific failure and guide the user to resolve it before continuing.
Display the setup summary (see Output Format below).
If called as a subroutine (caller context is set), skip the next-steps
prompt entirely. Announce "Setup complete — continuing." and return control
to the caller. The caller (e.g. pre-flight) will resume from where it left
off.
If called directly by the user (no caller context), present the following:
You're all set. Here's what you can do right now:
42crunch-audit— Hand me an OpenAPI file and I'll score it, classify every security issue by severity, and fix the SQG-blocking ones with your approval. A good first step if you haven't audited this API before.
42crunch-scan— Run a live conformance and authorization test against a running API. I'll check for BOLA, BFLA, and response-contract violations. Best run after the audit passes.
42crunch-api-security-testing— Runs both audit and scan back-to-back. The recommended workflow when you want the full picture in one session.Which would you like to start with?
## 42Crunch Setup Complete
| Item | Status |
|------------------|-----------------------------------------------------|
| Binary | <BINARY_PATH> v<version> |
| Credential mode | <Platform \| Freemium> |
| API key / Token | Platform: `api_••••••••` or `ide_••••••••` |
| | Freemium: `<first-4-chars>••••••••` |
| | (stored in <path>) |
| Platform host | <url> ← omit this row for freemium mode |
api_•••••••• / ide_•••••••• for platform tokens — keep
prefix, replace rest; <first-4-chars>•••••••• for freemium tokens, e.g.
eyJh••••••••).bash_tool for all shell commands; use str_replace_editor or
create_file when writing config files — never shell redirection.curl for downloads; fall back to wget if curl is unavailable. On
Windows use Invoke-WebRequest.42c-ast.exe, paths use \, config lives in
%APPDATA%\42Crunch\conf\env, skip chmod 600 (Windows ACLs protect APPDATA).| Variable | Default | Mode |
|---|---|---|
API_KEY |
(required) | Platform |
PLATFORM_HOST |
(set during setup) | Platform only |
FREEMIUM_TOKEN |
(required) | Freemium |
原文・著作権は Anthropic および各プラグイン作者に帰属します。日本語訳は Claude API による自動翻訳です。