name: security-review description: > Brakeman + bundler-audit + secrets検出 + Trivy を一括実行し、 対処が必要な指摘だけを報告する disable-model-invocation: true user-invocable: true allowed-tools: Bash(*), Read, Grep, Glob argument-hint: [--fix]
Security Review スキル
実行手順
- スキャンスクリプトを実行する:
bash .claude/skills/security-review/scripts/scan.sh
- 出力を以下のルールでフィルタする:
Brakeman
- confidence が High / Medium のみ(Low は除外)
- 各 warning からファイル・行番号・タイプ・メッセージを抽出
bundler-audit
"Vulnerabilities found!"がなければ PASS- CVE 行だけ抽出(gem名・バージョン・CVE番号・概要)
Secrets
- 以下を false positive として除外:
test/,spec/,fixtures/配下- コメント行(
#で始まる内容部分) - サンプル値(
"changeme","password","xxxx","your-*-here","TODO","example") .kamal/secrets内の参照のみの行($で始まる値)config/credentials/配下(Rails encrypted credentials)SKILL.mdやscan.sh自身
- 残ったものを報告
Trivy
- severity が HIGH / CRITICAL のみ
- パッケージ名・現バージョン・修正バージョン・CVE を抽出
- trivy がなかった場合は「trivy 未インストール — スキップ」と表示
- 最終出力フォーマット:
## Security Review Results
### 概要
| スキャン | 結果 |
|---------|------|
| Brakeman | X件の指摘 / PASS |
| bundler-audit | X件の脆弱性 / PASS |
| Secrets | X件の検出 / PASS |
| Trivy | X件 / PASS / スキップ |
### 指摘詳細 (あれば)
| 重要度 | 種別 | ファイル:行 | 概要 | 推奨対応 |
|--------|------|------------|------|---------|
| ... | ... | ... | ... | ... |
$ARGUMENTSに--fixが含まれる場合:- bundler-audit の指摘 →
bundle update <gem>を提案・実行 - Brakeman の指摘 → 該当コードを読んで修正を試みる
- Secrets → 該当ファイルの値を環境変数参照に置換を提案
- bundler-audit の指摘 →
指摘が 0件 の場合は「全スキャン PASS — 指摘なし」と表示