$npx -y skills add vibeeval/vibecosystem --skill config-security-scanScan .claude/ directory for security misconfigurations, exposed secrets, unsafe permissions
| 1 | # Config Security Scan |
| 2 | |
| 3 | Scan your `.claude/` directory and related configuration files for security issues. Inspired by AgentShield pattern - checks CLAUDE.md, settings.json, MCP configs, hooks, and agent definitions for misconfigurations, exposed secrets, and unsafe permissions. |
| 4 | |
| 5 | ## Usage |
| 6 | |
| 7 | ``` |
| 8 | /config-security-scan [path] |
| 9 | ``` |
| 10 | |
| 11 | Default path: `.claude/` in current project. |
| 12 | |
| 13 | ## What It Checks |
| 14 | |
| 15 | ### 1. Secrets Detection (CRITICAL) |
| 16 | ``` |
| 17 | - API keys, tokens, passwords in CLAUDE.md |
| 18 | - Hardcoded credentials in hook scripts |
| 19 | - Secrets in MCP server configs |
| 20 | - Bearer tokens in agent definitions |
| 21 | - .env files committed to git |
| 22 | ``` |
| 23 | |
| 24 | ### 2. Permission Escalation (HIGH) |
| 25 | ``` |
| 26 | - dangerouslySkipPermissions in settings.json |
| 27 | - Overly broad tool permissions (all tools for simple agents) |
| 28 | - MCP servers with filesystem write access |
| 29 | - Hooks with shell execution and no validation |
| 30 | - Agents with Bash tool that don't need it |
| 31 | ``` |
| 32 | |
| 33 | ### 3. MCP Server Security (HIGH) |
| 34 | ``` |
| 35 | - Unknown/untrusted MCP servers |
| 36 | - MCP servers with network access + filesystem access |
| 37 | - Missing authentication on MCP endpoints |
| 38 | - MCP servers running as root/admin |
| 39 | - Unverified npm packages in MCP configs |
| 40 | ``` |
| 41 | |
| 42 | ### 4. Hook Security (MEDIUM) |
| 43 | ``` |
| 44 | - Hooks that execute user input |
| 45 | - Hooks without error handling |
| 46 | - Hooks that modify git config |
| 47 | - Hooks that access external networks |
| 48 | - Hooks with hardcoded paths |
| 49 | ``` |
| 50 | |
| 51 | ### 5. Agent Definition Security (MEDIUM) |
| 52 | ``` |
| 53 | - Agents with unnecessary tools |
| 54 | - Agents with system-level Bash access |
| 55 | - Agent descriptions that could enable prompt injection |
| 56 | - Agents without clear scope boundaries |
| 57 | ``` |
| 58 | |
| 59 | ### 6. Configuration Hygiene (LOW) |
| 60 | ``` |
| 61 | - Unused MCP server configs |
| 62 | - Deprecated settings |
| 63 | - Conflicting rules |
| 64 | - Missing recommended security settings |
| 65 | ``` |
| 66 | |
| 67 | ## Scan Procedure |
| 68 | |
| 69 | ```bash |
| 70 | # Step 1: Find all config files |
| 71 | find .claude/ -type f \( -name "*.json" -o -name "*.md" -o -name "*.yml" -o -name "*.yaml" -o -name "*.js" -o -name "*.mjs" -o -name "*.ts" \) |
| 72 | |
| 73 | # Step 2: Secret patterns |
| 74 | grep -rn "api[_-]?key\|password\|secret\|token\|bearer\|sk-\|pk_\|ghp_\|gho_\|xoxb-\|xoxp-" .claude/ |
| 75 | |
| 76 | # Step 3: Permission checks |
| 77 | grep -rn "dangerouslySkipPermissions\|allowedTools.*Bash\|shell_exec\|eval(" .claude/ |
| 78 | |
| 79 | # Step 4: MCP config review |
| 80 | cat .mcp.json 2>/dev/null | jq '.mcpServers | keys' |
| 81 | |
| 82 | # Step 5: Hook review |
| 83 | ls .claude/hooks/ 2>/dev/null |
| 84 | ``` |
| 85 | |
| 86 | ## Output Format |
| 87 | |
| 88 | ```markdown |
| 89 | # Config Security Scan Report |
| 90 | Scanned: [path] |
| 91 | Date: [timestamp] |
| 92 | |
| 93 | ## Summary |
| 94 | - CRITICAL: X issues |
| 95 | - HIGH: Y issues |
| 96 | - MEDIUM: Z issues |
| 97 | - LOW: W issues |
| 98 | |
| 99 | ## CRITICAL Issues |
| 100 | |
| 101 | ### [Issue Title] |
| 102 | **File:** [path] |
| 103 | **Line:** [number] |
| 104 | **Issue:** [description] |
| 105 | **Fix:** [remediation] |
| 106 | |
| 107 | ## Recommendations |
| 108 | 1. [Action item] |
| 109 | ``` |
| 110 | |
| 111 | ## Hard Exclusion List (Skip These) |
| 112 | |
| 113 | These are NOT security issues in the .claude/ context: |
| 114 | - Environment variable references (not actual values) |
| 115 | - Test/example credentials clearly marked as such |
| 116 | - Public API keys meant to be public |
| 117 | - SHA hashes used as identifiers |
| 118 | - Base64-encoded non-secret data |
| 119 | - localhost/127.0.0.1 URLs |
| 120 | |
| 121 | ## Integration |
| 122 | |
| 123 | - **security-reviewer**: Calls this skill during security audits |
| 124 | - **verifier**: Includes config scan in pre-commit checks |
| 125 | - **shipper**: Runs before deployments |