From secret-guard
プロジェクトのシークレット保護状況をスキャン・監査する。.gitignore の漏れを検出し、保護が必要なファイルを特定してレポート。Use when user wants to check secret protection, audit gitignore, scan for exposed secrets, or check security status.
How this skill is triggered — by the user, by Claude, or both
Slash command
/secret-guard:secret-scanThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
プロジェクト内のシークレットファイルをスキャンし、.gitignore の保護状況を監査する。
プロジェクト内のシークレットファイルをスキャンし、.gitignore の保護状況を監査する。
以下のパターンに該当するファイルをプロジェクト内から検索する。
ファイル名パターン:
.env, .env.*, .env.local, .env.production, .env.stagingcredentials.json, credentials.yml, credentials.yamlsecrets.json, secrets.yml, secrets.yaml, secrets.tomlservice-account*.json, serviceAccountKey*.json.netrc, .npmrc.docker/config.jsontoken.json, tokens.json, auth.json, oauth*.json.htpasswd, .htaccess, wp-config.php, database.yml拡張子パターン:
*.pem, *.key, *.p12, *.pfx, *.jks, *.keystore*.p8, *.gpg, *.ascディレクトリパターン:
.ssh/, .gnupg/, .aws/, .gcloud/ 配下検索には Glob と Bash (find 相当) を使用する。
node_modules, .git, vendor, dist, build は除外する。
検出した各ファイルについて:
.gitignore を読み取る(存在しない場合は警告)git tracking 状態の確認:
git ls-files --error-unmatch <filepath> 2>/dev/null
スキャン結果をユーザーに提示する。
フォーマット:
## secret-guard スキャン結果
### 検出されたシークレットファイル: N 件
#### 保護済み (gitignore 登録済み)
- .env (パターン: .env)
- credentials.json (パターン: credentials.json)
#### 未保護 (要対応)
- .env.local (gitignore に未登録)
- secrets.yaml (gitignore に未登録)
#### 警告: git 追跡済み (危険)
- config/database.yml (既にコミット済み)
### 推奨アクション
1. 未保護ファイルを .gitignore に追加
2. git 追跡済みファイルを git rm --cached で除外
未保護のファイルが見つかった場合:
# === secret-guard: シークレットファイル保護 ===
.env
.env.*
credentials.json
*.pem
*.key
# === /secret-guard ===
git で既に追跡されているシークレットファイルが見つかった場合:
git rm --cached <file> の実行をユーザーに提案(AI は直接実行しない)git filter-branch や BFG Repo-Cleaner を案内引数に --fix が含まれる場合:
npx claudepluginhub biwakonbu/cc-plugins --plugin secret-guardScans source code for hardcoded secrets, API keys, and credentials; classifies risk severity; checks .gitignore and git history; enforces credential externalization.
Scans code, git history, and configs for secrets like API keys, cloud credentials, private keys, and DB strings using regex, entropy, and context. Assesses severity and generates remediation reports.
Scans codebases for exposed credentials including API keys, passwords, and private keys. Activates on queries about secret scanning or credential leaks.