/code-health:security-auditfrom Code Health
Audits code for security vulnerabilities: hardcoded secrets, dependency issues (pip/npm audit), and OWASP Top 10. Activated by phrases like 'security audit' or 'check for vulnerabilities'.
Ships in Code Health. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Навык для аудита безопасности: поиск уязвимостей, анализ кода, проверка OWASP Top 10.
| # | Уязвимость | Проверка |
|---|---|---|
| A01 | Broken Access Control | Проверка авторизации, IDOR, privilege escalation |
| A02 | Cryptographic Failures | Слабое шифрование, hardcoded secrets |
| A03 | Injection | SQL, NoSQL, OS, LDAP injection |
| A04 | Insecure Design | Архитектурные проблемы |
| A05 | Security Misconfiguration | Дефолтные настройки, открытые порты |
| A06 | Vulnerable Components | Устаревшие зависимости |
| A07 | Auth Failures | Слабые пароли, session management |
| A08 | Software/Data Integrity | CI/CD security, unsigned updates |
| A09 | Logging Failures | Недостаточное логирование |
| A10 | SSRF | Server-Side Request Forgery |
# ❌ Плохо
def login(username, password):
user = db.query(f"SELECT * FROM users WHERE name='{username}'") # SQLi!
if user.password == password: # Plain text!
return True
# ✅ Хорошо
def login(username, password):
user = db.query("SELECT * FROM users WHERE name = %s", (username,))
if user and bcrypt.checkpw(password.encode(), user.password_hash):
return create_session(user)
# ❌ Плохо
@app.route('/search')
def search():
query = request.args.get('q')
return f"<h1>Results for: {query}</h1>" # XSS!
# ✅ Хорошо
from markupsafe import escape
@app.route('/search')
def search():
query = escape(request.args.get('q', ''))
return f"<h1>Results for: {query}</h1>"
# ❌ Плохо
def upload(file):
file.save(f'/uploads/{file.filename}') # Path traversal!
# ✅ Хорошо
import os
from werkzeug.utils import secure_filename
ALLOWED_EXTENSIONS = {'png', 'jpg', 'pdf'}
def upload(file):
if '.' in file.filename and \
file.filename.rsplit('.', 1)[1].lower() in ALLOWED_EXTENSIONS:
filename = secure_filename(file.filename)
file.save(os.path.join('/uploads', filename))
# Python - Bandit
pip install bandit
bandit -r ./src -f json -o report.json
# JavaScript - ESLint Security
npm install eslint-plugin-security
eslint --ext .js,.ts ./src
# Multi-language - Semgrep
pip install semgrep
semgrep scan --config=auto ./
# Python
pip install safety
safety check
# Node.js
npm audit
npm audit fix
# Go
go list -m all | nancy sleuth
# Gitleaks
gitleaks detect --source . --verbose
# TruffleHog
trufflehog filesystem ./
# Pattern matching
grep -rn "password\s*=\s*['\"]" ./
grep -rn "api_key\s*=\s*['\"]" ./
# Detect patterns:
# - String concatenation in queries
# - f-strings with user input in SQL
# - .format() with user input in SQL
# Safe alternatives:
cursor.execute("SELECT * FROM users WHERE id = %s", (user_id,))
User.query.filter_by(id=user_id).first()
// Detect patterns:
// - innerHTML with user input
// - document.write() with user input
// - eval() with any input
// Safe alternatives:
element.textContent = userInput;
element.innerText = userInput;
# ❌ Dangerous
os.system(f"ping {user_input}")
subprocess.call(f"ls {path}", shell=True)
# ✅ Safe
subprocess.run(["ping", "-c", "4", validated_ip], check=True)
subprocess.run(["ls", validated_path], shell=False)
# ❌ Dangerous
open(f"/data/{filename}")
# ✅ Safe
import os
base_path = "/data"
full_path = os.path.realpath(os.path.join(base_path, filename))
if not full_path.startswith(base_path):
raise ValueError("Invalid path")
* для авторизованных запросов?.gitignore покрывает .env, secrets, credentials, keys?# Flask example
@app.after_request
def add_security_headers(response):
response.headers['X-Content-Type-Options'] = 'nosniff'
response.headers['X-Frame-Options'] = 'DENY'
response.headers['X-XSS-Protection'] = '1; mode=block'
response.headers['Content-Security-Policy'] = "default-src 'self'"
response.headers['Strict-Transport-Security'] = 'max-age=31536000; includeSubDomains'
return response
# Security Audit Report
## Executive Summary
- **Scope**: [описание]
- **Date**: [дата]
- **Risk Level**: Critical/High/Medium/Low
## Findings
### [CRITICAL] Finding 1: SQL Injection in login.py
- **Location**: src/auth/login.py:42
- **Description**: User input directly concatenated into SQL query
- **Impact**: Full database compromise
- **Remediation**: Use parameterized queries
- **CVSS Score**: 9.8
### [HIGH] Finding 2: Hardcoded API Key
- **Location**: src/config.py:15
- **Description**: API key stored in source code
- **Impact**: Unauthorized access to external service
- **Remediation**: Move to environment variables
## Recommendations
1. Implement input validation
2. Update dependencies
3. Enable security headers
4. Add logging and monitoring
#!/bin/bash
# security-audit.sh
echo "=== Security Audit ==="
echo "\n[1] Checking for secrets..."
gitleaks detect --source . --no-git
echo "\n[2] Scanning Python code..."
bandit -r ./src -ll
echo "\n[3] Checking dependencies..."
safety check || pip-audit
echo "\n[4] Running Semgrep..."
semgrep scan --config=p/security-audit ./src
echo "\n[5] Checking for outdated packages..."
pip list --outdated
echo "\n=== Audit Complete ==="
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
9 skills in this plugin
/config-healthЗдоровье конфига Claude Code: битые ссылки, вес промпта, лимит памяти, живость MCP. Триггеры: «проверь конфиг», «вес промпта». НЕ чужой скилл→skill-manager; НЕ код→health-inline/health-inlineЧинит codebase health инлайн: /health bugs|cleanup|deps|reuse|security — детекция→фикс→верификация. Только pnpm+TypeScript-репо. НЕ одна красная сборка→build-fix./leak-scanPII/деанон перед публикацией (leak_scan.py) + prompt-injection в чужом скилле (skill_injection_scan.py). Триггеры: «обезличь репо», «проверь скилл перед установкой»./osint-reconРазведка инфраструктуры домена/IP CLI osint_client.py: DNS, whois, субдомены, порты/CVE, санкции. Триггеры: «пробей домен». НЕ люди→social-intel./privacy-filterЛокальный PII-фильтр (OpenAI opf, on-device): обезличить текст перед облачным LLM, обратимая редакция. Триггеры: «обезличь текст», «найди ПД»./skill-auditЗаглушка: проверка чужого скилла/плагина до установки переехала в skill-manager, режим «Аудит». Сам не вызывается, держит старые ссылки живыми.npx claudepluginhub jhamidun/claude-code-config-pack --plugin code-healthOther plugins' skills for the same job