Skip to content
cccskills
FreePublished on GitHub

security-scan

AgentShieldを使用してClaude Codeの設定(.claude/ディレクトリ)のセキュリティ脆弱性、設定ミス、インジェクションリスクをスキャン。CLAUDE.md、settings.json、MCPサーバー、フック、エージェント定義をチェック。

The English summary is being prepared. Showing the original description.

See how to install

Files included (1)

  • SKILL.md5.4 KB

SKILL.md (original)

Review the instructions the agent will receive before you install.

セキュリティスキャンスキル

AgentShieldを使用してClaude Codeの設定をセキュリティ問題について監査します。

発動タイミング

  • 新しいClaude Codeプロジェクトのセットアップ時
  • .claude/settings.json、CLAUDE.md、またはMCP設定の変更後
  • 設定変更のコミット前
  • 既存のClaude Code設定を持つ新しいリポジトリへのオンボーディング時
  • 定期的なセキュリティ衛生チェック

スキャン対象

ファイルチェック内容
CLAUDE.mdハードコードされたシークレット、自動実行命令、プロンプトインジェクションパターン
settings.json過度に許可的な許可リスト、欠落した拒否リスト、危険なバイパスフラグ
mcp.jsonリスクのあるMCPサーバー、ハードコードされた環境シークレット、npxサプライチェーンリスク
hooks/補間によるコマンドインジェクション、データ持ち出し、サイレントエラー抑制
agents/*.md制限のないツールアクセス、プロンプトインジェクション面、欠落したモデル仕様

前提条件

AgentShieldがインストールされている必要があります。必要に応じて確認・インストール:

# Check if installed
npx ecc-agentshield --version

# Install globally (recommended)
npm install -g ecc-agentshield

# Or run directly via npx (no install needed)
npx ecc-agentshield scan .

使い方

基本スキャン

現在のプロジェクトの.claude/ディレクトリに対して実行:

# Scan current project
npx ecc-agentshield scan

# Scan a specific path
npx ecc-agentshield scan --path /path/to/.claude

# Scan with minimum severity filter
npx ecc-agentshield scan --min-severity medium

出力フォーマット

# Terminal output (default) — colored report with grade
npx ecc-agentshield scan

# JSON — for CI/CD integration
npx ecc-agentshield scan --format json

# Markdown — for documentation
npx ecc-agentshield scan --format markdown

# HTML — self-contained dark-theme report
npx ecc-agentshield scan --format html > security-report.html

自動修正

安全な修正を自動的に適用(自動修正可能とマークされたもののみ):

npx ecc-agentshield scan --fix

これにより以下が行われます:

  • ハードコードされたシークレットを環境変数参照に置換
  • ワイルドカードパーミッションをスコープ付き代替に厳格化
  • 手動のみの提案は変更しない

Opus 4.6ディープ分析

より深い分析のために対抗的3エージェントパイプラインを実行:

# Requires ANTHROPIC_API_KEY
export ANTHROPIC_API_KEY=your-key
npx ecc-agentshield scan --opus --stream

以下を実行します:

  1. Attacker(レッドチーム) — 攻撃ベクトルを発見
  2. Defender(ブルーチーム) — 強化を推奨
  3. Auditor(最終判定) — 両方の視点を統合

安全な設定の初期化

新しい安全な.claude/設定をゼロからスキャフォールド:

npx ecc-agentshield init

作成されるもの:

  • スコープ付きパーミッションと拒否リストを持つsettings.json
  • セキュリティベストプラクティスを含むCLAUDE.md
  • mcp.jsonプレースホルダー

GitHub Action

CIパイプラインに追加:

- uses: affaan-m/agentshield@v1
  with:
    path: '.'
    min-severity: 'medium'
    fail-on-findings: true

深刻度レベル

グレードスコア意味
A90-100安全な設定
B75-89軽微な問題
C60-74注意が必要
D40-59重大なリスク
F0-39致命的な脆弱性

結果の解釈

致命的な発見事項(即座に修正)

  • 設定ファイルにハードコードされたAPIキーやトークン
  • 許可リストにBash(*)(無制限のシェルアクセス)
  • ${file}補間によるフック内のコマンドインジェクション
  • シェル実行型MCPサーバー

高い発見事項(プロダクション前に修正)

  • CLAUDE.mdの自動実行命令(プロンプトインジェクションベクトル)
  • パーミッションに欠落した拒否リスト
  • 不要なBashアクセスを持つエージェント

中程度の発見事項(推奨)

  • フック内のサイレントエラー抑制(2>/dev/null、|| true)
  • 欠落したPreToolUseセキュリティフック
  • MCP設定でのnpx -y自動インストール

情報レベルの発見事項(認識)

  • MCPサーバーの欠落した説明
  • 適切なプラクティスとして正しくフラグされた禁止命令

リンク

Reviews

No reviews yet. Tell others what you thought.

Comments

No login needed. Share how it worked for you, ask a question, or note where it did not run.

No comments yet. Be the first to write one.

Comments are published right away. Do not include personal information such as email addresses or phone numbers. Up to 2 URLs.

0 / 1,000 characters

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.

More skills from this repository

コーディングエージェント(Claude Code、Aider、Codexなど)のカスタムタスクによる直接比較。合格率、コスト、時間、一貫性メトリクスを測定

The English summary is being prepared. Showing the original description.

hage-oyaji/everything-claude-code-jp-local3Updated Mar 29, 2026

AIエージェントのアクションスペース、ツール定義、オブザベーションフォーマットを設計・最適化し、タスク完了率を向上させる

The English summary is being prepared. Showing the original description.

hage-oyaji/everything-claude-code-jp-local3Updated Mar 29, 2026

評価ファーストの実行、分解、コスト考慮型モデルルーティングによるエージェンティックエンジニアとしての運用

The English summary is being prepared. Showing the original description.

hage-oyaji/everything-claude-code-jp-local3Updated Mar 29, 2026

AIエージェントが実装出力の大部分を生成するチームのためのエンジニアリング運用モデル

The English summary is being prepared. Showing the original description.

hage-oyaji/everything-claude-code-jp-local3Updated Mar 29, 2026

AI支援開発のためのリグレッションテスト戦略。データベース依存なしのサンドボックスモードAPIテスト、自動バグチェックワークフロー、同一モデルがコードの作成とレビューを行う際のAIの盲点を検出するパターン。

The English summary is being prepared. Showing the original description.

hage-oyaji/everything-claude-code-jp-local3Updated Mar 29, 2026

AndroidおよびKotlin Multiplatformプロジェクトのためのクリーンアーキテクチャパターン — モジュール構成、依存関係ルール、UseCase、Repository、データレイヤーパターン

The English summary is being prepared. Showing the original description.

hage-oyaji/everything-claude-code-jp-local3Updated Mar 29, 2026

See all skills by hage-oyaji

Report a problem with this skill