このスキルは、ユーザーやエージェント(自動実行プログラム)がStackHawk プラットフォームに問い合わせて、セキュリティレポート、検出結果の分析、またはアプリ管理を行う必要がある場合に使用します。 **次のような場合に使用:** - 「stackhawk api」 - 「security posture(セキュリティ状況)」 - 「findings report(検出結果レポート)」 - 「show me findings」 - 「untriaged findings(優先順位未判定の検出結果)」 - 「which apps」 - 「scan history」 - 「security dashboard」 - 「triage(優先順位付け)」 - 「what needs attention」 プラットフォームへのすべての問い合わせは、hawk CLI(コマンドラインツール)の `hawk op` サブコマンド(補助機能)を使用します。 **このスキルは以下の場合には使用しないでください:** - スキャン実行:「scan my app」「hawkscan」「stackhawk.yml」「DAST(動的セキュリティ検査)」などの場合は、hawkscan スキルを使用してください - コードやセキュリティ脆弱性の修正・改善:このスキルはプラットフォームデータの読み込みと報告のみを行います
Use this skill when a user or agent needs to query the StackHawk platform for security reporting, findings analysis, or app management. Triggers include: "stackhawk api", "security posture", "findings report", "show me findings", "untriaged findings", "which apps", "scan history", "security dashboard", "triage", "what needs attention". Uses the hawk CLI (`hawk op` subcommand) for all platform queries. Do NOT use for running scans (use the hawkscan skill for "scan my app", "hawkscan", "stackhawk.yml", "DAST") or for fixing/remediating code or vulnerabilities — this skill only reads and reports platform data.
このスキルにより、Claude は StackHawk プラットフォーム上のセキュリティレポート作成エージェント(自動処理を担う専用機能)として機能します。基本的な流れは以下の通りです。
質問 → 認証 → hawk op 経由で API にクエリ送信 → 結果を表示 → 次のアクションを提案
すべてのプラットフォームクエリは hawk バイナリの op サブコマンド(hawk op …)を通じて実行されます。これは認証、トークンの更新、ページネーション(複数ページにまたがるデータの自動取得)を処理し、安定した JSON 形式で結果を返します。生の REST API へのフォールバック(別の方法での代用)はありません。hawk が利用できない場合は、curl(データ取得ツール)を手動で使わず、インストールして hawk init --browser を実行してください。詳細は references/hawk-op-shortcuts.md を参照してください。
API を呼び出す前に、利用可能な環境をチェックしてください。
hawk がインストールされ、設定されているか?(hawk version で v6.0.0 以上が表示される)
# CLI の利用統計を記録する(hawk/hawkop が読み込む)
export _STACKHAWK_SKILL=api
command -v hawk >/dev/null && hawk op status
hawk init --browser を実行(対話的に進みます。統合バイナリには hawk op init はなく、hawk init が ~/.hawk/hawk.properties に認証情報を保存し、hawk op がそれと HAWK_API_KEY 環境変数を読み込みます)hawk CLI をインストールするよう指示(参考:docs.stackhawk.com)して、処理を止めてください。curl への代用はしないでくださいhawk op で認証されているか? ローカルまたはエージェント使用の場合、hawk init --browser は認証情報を ~/.hawk/hawk.properties に保存するため、対話的セッションで環境変数は不要です。以下で確認してください:
hawk op status
CI/CD のみ: パイプライン(自動実行環境)で実行している場合、
HAWK_API_KEYを秘密情報として設定してください。hawk opが直接読み込みます。設定ファイルは不要です。
orgId(組織 ID)は分かっているか? ほとんどのエンドポイント(API の機能)で必須です。
hawk op org get → 現在の組織 UUID(識別子)が返されますhawk op org set <ID> → デフォルト組織を切り替えますユーザーの意図に基づいてルートを決定:
| ユーザーの質問 | 次に進む |
|---|---|
| 「セキュリティ対策の状況は?」「ダッシュボード」 | ステップ 3(組織全体のサマリー) |
| 「〇〇アプリの検出事項を教えて」「何に対応が必要?」 | ステップ 4(アプリの詳細分析) |
| 「最近スキャンされていないアプリは?」 | ステップ 3(古いアプリに注目) |
| 「先週からの変化は?」「何が新しく出た?」 | ステップ 4(差分の確認) |
| 「未対応の検出事項を表示」 | ステップ 3、次にステップ 4 で対象アプリを詳細分析 |
対話的なセットアップは hawk init --browser を一度実行するだけです。CLI は認証情報を ~/.hawk/hawk.properties に保存し、hawk op が自動的にトークンを更新して、失敗時に再試行します。このスキルではこれ以上の認証作業は必要ありません。
→ 完全なセットアップコマンド(インストール、CI 環境変数、組織切り替え用プロファイル):
references/hawk-op-shortcuts.md
目標: すべてのアプリと環境全体のセキュリティ健全性を全体的に把握させる。
hawk op app list と hawk op scan list を使い、組織レベルのビューを作成します。hawk op app list --format json はアプリのメタデータを返し、hawk op scan list --format json はスキャンごとの重要度別件数を返します。applicationId で結合して、対策状況表を構築してください。
# すべてのアプリとメタデータ(チーム、種類、環境数)
hawk op app list --format json
# 組織全体の最近のスキャン — 重要度別件数を含む
hawk op scan list --limit 500 --format json
スキャンごとの利用可能なフィールド:highAlertCount、mediumAlertCount、lowAlertCount、applicationId、environmentName、startedTimestamp、status。
以下のように応答をフォーマットしてください:
| アプリ名 | 環境 | 高 | 中 | 低 | 最終スキャン |
|---|---|---|---|---|---|
| My API | 本番 | 3 | 7 | 12 | 2024-01-15 |
| Auth Service | ステージング | 0 | 2 | 4 | 2024-01-10 |
applicationId → アプリ名は hawk op app list --format json で解決してください。
startedTimestamp が 30 日以上前 — 「最近スキャンなし」と表示highAlertCount > 0 の環境を降順でソートstatus が COMPLETED でない — 設定の問題がある可能性強調されたアプリを詳しく調べることを提案してください:
jq 変換(データ加工ツール)を含む完全なレシピ:
→ references/reporting-recipes.md
目標: 単一のアプリについて具体的な検出事項の詳細を取得する — 何が見つかったのか、どこで、どういう意味か。
hawk op scan get(ほぼ 90% のケースをカバー)hawk op scan get はスキャン → 警告 → 検出事項のチェーンを内部で処理します。手動での掘り下げ、ID 抽出、トークン処理は不要です。
# あるアプリの最新スキャン — 概要 + 警告表
hawk op scan get --app "<APP_NAME>"
# HTTP の証拠と対策方法を含むすべての検出事項(AI エージェントの推論に最適)
hawk op scan get --app "<APP_NAME>" --detail full --format json
--detail full は、すべての警告、影響を受けた URI、HTTP メッセージ(--max-body-size による制限あり)、対策方法のガイダンスを 1 つの JSON で返します。
→ 特定のスキャン ID、単一警告 / 単一 URI の詳細分析、--max-findings の調整:
references/hawk-op-shortcuts.md 第 2 節
構造化されたサマリーを表示してください:
プラットフォーム上のスキャンへのリンク:
https://app.stackhawk.com/scans/{scanId}
2 つのスキャンを比較します:hawk op scan list でアプリの 2 つの最新スキャン ID を取得し、それぞれ hawk op scan get で警告を取得し、pluginId のセット(集合)で差分を取ります。
→ 実行可能なレシピ(hawk op パイプラインと comm 差分ツール):
references/hawk-op-shortcuts.md 第 2 節
→ 完全な jq レシピ:references/reporting-recipes.md
app.stackhawk.com/scans/{scanId})を含めるNEW(新規)、FALSE_POSITIVE(誤検知)、RISK_ACCEPTED(リスク受容)、ASSIGNED(割り当て済み))を表示データが示すことに基づいて提案をしてください:
| 検出内容 | 推奨アクション |
|---|---|
| 高重要度の検出事項あり | 直ちの対策を推奨。検出事項の詳細を → hawkscan スキル(スキャン実行スキル)に渡し、修正を検証するために再スキャンを提案 |
| 古いアプリ(30 日以上スキャンなし) | 新しいスキャンの実行を推奨 → hawkscan スキル |
| すべての環境で結果がクリーン | パスの件数が少ない場合、スパイダー(クローラ)のチューニングが必要な可能性 → hawkscan スキル、設定パターン参考資料 |
未対応の検出事項(status: NEW) |
プラットフォームでの対応を指示:app.stackhawk.com — 対応状況の変更は本スキルの範囲外 |
アプリの状態が ENV_INCOMPLETE |
プラットフォームで環境設定を完了するよう指示 |
API データ(本スキル)を使う場合:
プラットフォーム UI を案内する場合:
hawk op scan get <SCAN_ID> --uri-id <ID> --message を使用)${HAWK_API_KEY} を参照し、ローカル使用では hawk init --browser で認証情報を保存し、キー値を埋め込まないでくださいorgId と appId を混同しない — hawk op scan list --app <APP_ID> はアプリ UUID を受け取ります。組織は設定から暗黙的に読まれ、必要に応じて --org <ID> でオーバーライド。混在させると結果は空になり、エラーは返りませんThis skill enables Claude to act as a security reporting agent against the StackHawk platform. The core workflow is:
Question → Authenticate → Query API via hawk op → Present Results → Suggest Next Actions
All platform queries run through the hawk binary's op subtree
(hawk op …). It authenticates, refreshes tokens, follows pagination, and
emits stable JSON. There is no raw-REST fallback — if hawk is unavailable,
install it and run hawk init --browser rather than hand-rolling curl.
See references/hawk-op-shortcuts.md.
Before making any calls, check what's available:
Is hawk installed and configured? (hawk version reports v6.0.0 or greater)
# Identify the driving skill for CLI usage telemetry (read by hawk/hawkop).
export _STACKHAWK_SKILL=api
command -v hawk >/dev/null && hawk op status
hawk init --browser (interactive; the combined binary
has no hawk op init — hawk init writes ~/.hawk/hawk.properties, which
hawk op reads along with the HAWK_API_KEY env var).hawk CLI (docs:
docs.stackhawk.com) and stop; do not fall back to curl.Is hawk op authenticated? For local/agentic use, hawk init --browser stores
credentials in ~/.hawk/hawk.properties — no env var needed for interactive
sessions. Verify:
hawk op status
CI/CD only: If running in a pipeline, set
HAWK_API_KEYas a secret.hawk opreads it directly — no config file required.
Is orgId known? Required for most endpoints.
hawk op org get returns the active org UUID.hawk op org set <ID> switches the default org.Route based on user intent:
| User says... | Go to... |
|---|---|
| "What's my security posture?" or "dashboard" | Step 3 (org summary) |
| "Tell me about [app]'s findings" or "what needs attention" | Step 4 (app deep dive) |
| "What apps haven't been scanned recently?" | Step 3 with stale-app focus |
| "What changed since last week?" or "what's new" | Step 4 with diff recipe |
| "Show me untriaged findings" | Step 3, then drill into Step 4 for flagged apps |
hawk init --browser once for interactive setup — the CLI stores credentials in
~/.hawk/hawk.properties and hawk op handles token refresh and 401 retry on
every call. No further auth work for this skill.
→ Full setup commands (install, CI env var, profiles for org switching):
references/hawk-op-shortcuts.md.
Goal: Give the user a bird's-eye view of security health across all apps and environments.
Use hawk op app list and hawk op scan list to assemble an org-level view.
hawk op app list --format json returns app metadata; hawk op scan list --format json
returns per-scan severity counts. Join on applicationId to build a posture table.
# All apps with metadata (team, type, env count)
hawk op app list --format json
# Recent scans across the org — has per-scan severity counts
hawk op scan list --limit 500 --format json
Fields available per scan: highAlertCount, mediumAlertCount, lowAlertCount,
applicationId, environmentName, startedTimestamp, status.
Format the response as:
| App | Environment | High | Medium | Low | Last Scan |
|---|---|---|---|---|---|
| My API | Production | 3 | 7 | 12 | 2024-01-15 |
| Auth Service | Staging | 0 | 2 | 4 | 2024-01-10 |
Resolve applicationId → app name via hawk op app list --format json.
startedTimestamp older than 30 days — flag as "No recent scan"highAlertCount > 0, sorted descendingstatus not COMPLETED — may indicate config issuesOffer to drill down on any flagged app:
Full recipe with jq transforms:
→ references/reporting-recipes.md
Goal: Get specific finding details for a single app — what was found, where, and what it means.
hawk op scan get (one command covers ~90% of cases)hawk op scan get walks the scan → alerts → findings chain internally. No manual drill-down, no ID extraction, no token handling.
# Latest scan for an app — overview + alerts table
hawk op scan get --app "<APP_NAME>"
# Full findings with HTTP evidence + remediation (best for AI agent reasoning)
hawk op scan get --app "<APP_NAME>" --detail full --format json
--detail full returns every alert, every affected URI, HTTP messages (subject to
--max-body-size), and remediation guidance in one JSON blob.
→ Specific scan IDs, single-alert / single-URI drill-down, --max-findings tuning:
references/hawk-op-shortcuts.md §2.
Show a structured summary:
Link to the scan on the platform:
https://app.stackhawk.com/scans/{scanId}
Compare two scans: use hawk op scan list to get the two most recent scan IDs for
the app, pull alerts for each via hawk op scan get, diff the pluginId sets.
→ Executable recipe (hawk op pipeline with comm diff):
references/hawk-op-shortcuts.md §2.
→ Full jq recipes: references/reporting-recipes.md.
app.stackhawk.com/scans/{scanId}) whenever referencing a specific scanNEW, FALSE_POSITIVE, RISK_ACCEPTED, ASSIGNED) alongside each findingBase suggestions on what the data shows:
| Finding | Suggested action |
|---|---|
| High severity findings present | Recommend immediate remediation; offer to hand finding details to → hawkscan skill for a re-scan to verify fixes |
| Stale apps (no scan > 30 days) | Recommend running a fresh scan → hawkscan skill |
| Clean results across all envs | Note that low path count may mean the spider needs tuning → hawkscan skill, config-patterns reference |
Untriaged findings (status: NEW) |
Direct to platform for triage: app.stackhawk.com — triage write operations are out of scope for this skill |
ENV_INCOMPLETE app status |
Direct to platform to complete environment configuration |
Use API data (this skill) when:
Direct to platform UI when:
hawk op scan get <SCAN_ID> --uri-id <ID> --message)${HAWK_API_KEY} for CI/CD; store credentials via hawk init --browser for local use; never inline the key value itself.orgId with appId — hawk op scan list --app <APP_ID> takes the app UUID. The org is implicit from config; override with --org <ID> if needed. Mixing them returns empty results, not an error.--detail full when you need the remediation/HTTP message payload. The default hawk op scan get output is the overview — it won't include per-URI evidence.原文・著作権は Anthropic および各プラグイン作者に帰属します。日本語訳は Claude API による自動翻訳です。