用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/aibot88/sec_skill_store --skill owasp-check命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
Guides the creation of agile user stories and Gherkin feature files. Use when the user wants to create a user story, write acceptance criteria, define Gherkin scenarios, or author BDD feature files. This should trigger for requests such as Create a user story; Write a user story; I need to write a user story. Part of cursor-rules-java project
Guía técnica completa para integrar 250+ servicios externos con agentes IA usando Composio. Cubre instalación, autenticación OAuth, gestión de herramientas, triggers y flujos multi-servicio.
Facilitates conversational discovery to create Architectural Decision Records (ADRs) for non-functional requirements using the ISO/IEC 25010:2023 quality model. Use when the user wants to document quality attributes, NFR decisions, security/performance/scalability architecture, or design systems with measurable quality criteria. This should trigger for requests such as Create ADR for Non-functional requirements; Document Non-functional requirements; Capture Non-functional requirements; Generate Non-functional requirements in an ADR. Part of cursor-rules-java project
基于 SOC 职业分类
正在显示 SKILL.md
| name | owasp-check |
| description | OWASP Top 10 vulnerability scanning and remediation |
| disable-model-invocation | true |
I'll scan your application for OWASP Top 10 vulnerabilities and provide remediation guidance for common web security issues.
Arguments: $ARGUMENTS - specific vulnerability category or full scan
Vulnerabilities Checked:
This skill uses security scanning-specific patterns to minimize token usage while maintaining comprehensive OWASP Top 10 coverage:
Pattern: Cache vulnerability detection patterns per OWASP category
.claude/cache/owasp-check/patterns/ (persistent)Pattern: Detect framework once, load targeted vulnerability checks
.owasp-check-framework (1 week TTL)Pattern: Pattern match vulnerabilities without reading full files
grep -r "SELECT.*+.*req\.|query.*\.${" --include=".js"` (300 tokens)grep -r "innerHTML.*req\.|dangerouslySetInnerHTML" --include="*.{js,jsx,tsx}" (250 tokens)grep -r "exec.*req\.|spawn.*params\." --include="*.{js,py,php}" (300 tokens)grep -r "app\.\(get\|post\)" --include="*.js" | grep -v "auth" (350 tokens)Pattern: Scan only changed files by default
git diff --name-only HEAD to get changed files (100 tokens)--full flag providedPattern: Report critical vulnerabilities first, stop if found
--full or no critical/high foundPattern: Delegate to external security tools via Bash
npm audit --json | jq '.vulnerabilities' (200 tokens)safety check --json (200 tokens)bandit -r . -f json (300 tokens)Pattern: Stop immediately when no vulnerabilities detected
Pattern: Reuse cached data from /security-scan, /secrets-scan, /security-headers
.claude/cache/security/Pattern: Use pre-written remediation heredocs, no generation
Pattern: Scan single OWASP category when specified
--injection: A03 only (SQL, NoSQL, Command, XSS) - 400 tokens--auth: A07 only (Authentication failures) - 400 tokens--access-control: A01 only (Broken access control) - 400 tokens--crypto: A02 only (Cryptographic failures) - 400 tokens--ssrf: A10 only (Server-side request forgery) - 300 tokensOptimized Patterns:
Unoptimized Baseline:
Optimization Status: ✅ Fully Optimized (Phase 2 Batch 3C, 2026-01-26)
Cache Locations:
.claude/cache/owasp-check/
├── patterns/ # OWASP pattern library (persistent)
│ ├── injection.patterns
│ ├── xss.patterns
│ ├── auth.patterns
│ └── [8 other categories]
├── framework-detection # Detected framework (1 week TTL)
└── .owasp-last-scan # Last scan timestamp and results hash
.claude/cache/security/ # Shared security cache
├── npm-audit-results.json
├── pip-audit-results.json
└── framework-config.json
Cache Invalidation:
Shared Cache Benefits:
/security-scan shares framework detection (800 token savings)/secrets-scan shares pattern library (400 token savings)/dependency-audit shares npm/pip audit results (600 token savings)/security-headers shares framework config (300 token savings)Standard Usage:
owasp-check - Changed files, progressive scan (1,000-1,500 tokens)owasp-check changed - Explicit changed files only (800-1,200 tokens)owasp-check --full - All files, full OWASP scan (2,000-2,500 tokens)Focused Scans:
owasp-check --injection - SQL/NoSQL/Command injection only (400-700 tokens)owasp-check --auth - Authentication issues only (400-700 tokens)owasp-check --access-control - A01 Broken Access Control (400-700 tokens)owasp-check --crypto - A02 Cryptographic failures (400-700 tokens)owasp-check --critical - Critical vulnerabilities only (600-1,000 tokens)CI/CD Integration:
owasp-check --ci - Optimized for pipeline (600-1,000 tokens, fail on critical)owasp-check --report - Generate compliance report (1,500-2,000 tokens)#!/bin/bash
# Detect project type for targeted scanning
detect_project_type() {
echo "=== Project Detection ==="
echo ""
# Check for Node.js/JavaScript
if [ -f "package.json" ]; then
echo "✓ Node.js/JavaScript project"
PROJECT_TYPE="nodejs"
if grep -q "express" package.json; then
FRAMEWORK="express"
echo " Framework: Express.js"
elif grep -q "next" package.json; then
FRAMEWORK="nextjs"
echo " Framework: Next.js"
elif grep -q "react" package.json; then
FRAMEWORK="react"
echo " Framework: React"
fi
fi
# Check for Python
if [ -f "requirements.txt" ] || [ -f "setup.py" ]; then
echo "✓ Python project"
PROJECT_TYPE="python"
if [ -f "manage.py" ]; then
FRAMEWORK="django"
echo
grep -q requirements.txt 2>/dev/null;
FRAMEWORK=
grep -q requirements.txt 2>/dev/null;
FRAMEWORK=
[ -f ];
PROJECT_TYPE=
grep -q composer.json;
FRAMEWORK=
[ -f ] || [ -f ];
PROJECT_TYPE=
grep -q pom.xml 2>/dev/null || grep -q build.gradle 2>/dev/null;
FRAMEWORK=
}
detect_project_type
#!/bin/bash
# Check for broken access control vulnerabilities
check_access_control() {
echo "=== A01: Broken Access Control ==="
echo ""
ISSUES=0
# Check for missing authentication
echo "Checking for missing authentication..."
if [ "$PROJECT_TYPE" = "nodejs" ]; then
# Look for routes without authentication middleware
UNPROTECTED=$(find . -name "*.js" -o -name "*.ts" | xargs grep -l "app\.\(get\|post\|put\|delete\)" | \
xargs grep -L "auth\|authenticate\|isAuthenticated")
if [ -n "$UNPROTECTED" ]; then
echo "⚠️ Routes potentially without authentication:"
echo "$UNPROTECTED" | sed 's/^/ /'
ISSUES=$((ISSUES + 1))
fi
fi
# Check for insecure direct object references
echo ""
echo "Checking for insecure direct object references..."
IDOR_PATTERNS=(
"req\.params\.id"
"req\.query\.id"
"params\[.*id.*\]"
"SELECT.*WHERE id.*params"
)
for pattern in ;
grep -r --include= --include= --include= . 2>/dev/null | grep -qv ;
ISSUES=$((ISSUES + ))
[ = ];
! grep -r --include= . 2>/dev/null;
ISSUES=$((ISSUES + ))
[ -eq 0 ];
}
check_access_control
#!/bin/bash
# Check for cryptographic failures
check_crypto_failures() {
echo "=== A02: Cryptographic Failures ==="
echo ""
ISSUES=0
# Check for hardcoded secrets
echo "Checking for hardcoded secrets..."
SECRET_PATTERNS=(
"password\s*=\s*['\"][^'\"]{8,}['\"]"
"api[_-]?key\s*=\s*['\"][^'\"]{20,}['\"]"
"secret\s*=\s*['\"][^'\"]{16,}['\"]"
"token\s*=\s*['\"][^'\"]{20,}['\"]"
"private[_-]?key"
"aws_secret_access_key"
)
for pattern in "${SECRET_PATTERNS[@]}"; do
matches=$(grep -r -i "$pattern" \
--include="*.js" \
--include="*.ts" \
--include="*.py" \
--include="*.php" \
--exclude-dir=node_modules \
--exclude-dir=.git \
. 2>/dev/null)
if [ -n "$matches" ]; then
echo "❌ CRITICAL: Hardcoded secrets found"
echo "$matches" | head -3
echo " Move secrets to environment variables"
ISSUES=$((ISSUES + 1))
fi
done
# Check for weak password hashing
WEAK_HASH=( )
;
grep -r \
--include= \
--include= \
--include= \
. 2>/dev/null;
ISSUES=$((ISSUES + ))
grep -r --include= --include= . 2>/dev/null | grep -q ;
ISSUES=$((ISSUES + ))
[ = ];
! grep -r \
--include= \
--include= \
. 2>/dev/null;
ISSUES=$((ISSUES + ))
[ -eq 0 ];
}
check_crypto_failures
#!/bin/bash
# Check for SQL injection, NoSQL injection, command injection
check_injection() {
echo "=== A03: Injection Vulnerabilities ==="
echo ""
ISSUES=0
# SQL Injection
echo "Checking for SQL injection vulnerabilities..."
SQL_INJECTION_PATTERNS=(
"SELECT.*\+.*req\."
"INSERT.*\+.*req\."
"UPDATE.*\+.*req\."
"DELETE.*\+.*req\."
"WHERE.*\+.*params"
"execute.*%.*req\."
"query.*\`.*\$\{.*\}\`"
)
for pattern in "${SQL_INJECTION_PATTERNS[@]}"; do
matches=$(grep -r "$pattern" \
--include="*.js" \
--include="*.ts" \
--include="*.py" \
--exclude-dir=node_modules \
. 2>/dev/null)
if [ -n "$matches" ]; then
echo "❌ CRITICAL: Potential SQL injection"
echo " Pattern: $pattern"
echo " Use parameterized queries or ORM"
ISSUES=$((ISSUES + 1))
fi
done
# NoSQL Injection
echo ""
grep -r \
--include= \
--include= \
. 2>/dev/null | grep -qv ;
ISSUES=$((ISSUES + ))
COMMAND_INJECTION=(
)
pattern ;
grep -r \
--include= \
--include= \
--include= \
--include= \
. 2>/dev/null;
ISSUES=$((ISSUES + ))
XSS_PATTERNS=(
)
pattern ;
grep -r \
--include= \
--include= \
--include= \
--include= \
. 2>/dev/null;
ISSUES=$((ISSUES + ))
[ -eq 0 ];
}
check_injection
#!/bin/bash
# Check for security misconfigurations
check_misconfig() {
echo "=== A05: Security Misconfiguration ==="
echo ""
ISSUES=0
# Check for debug mode in production
echo "Checking for debug mode..."
if grep -r "DEBUG\s*=\s*True\|NODE_ENV.*development" \
--include="*.py" \
--include="*.js" \
--include="*.env" \
. 2>/dev/null; then
echo "⚠️ Debug mode may be enabled"
echo " Ensure DEBUG=False and NODE_ENV=production in production"
ISSUES=$((ISSUES + 1))
fi
# Check for default credentials
echo ""
echo "Checking for default credentials..."
if grep -r -i "admin.*admin\|root.*root\|password.*password" \
--include="*.js" \
--include="*.py" \
--include="*.php" \
--include="*.env" \
. 2>/dev/null; then
echo "❌ CRITICAL: Default credentials detected"
echo " Change all default passwords"
ISSUES=$((ISSUES + 1))
fi
# Check for exposed .env files
echo ""
echo
[ -f ];
! grep -q .gitignore 2>/dev/null;
ISSUES=$((ISSUES + ))
grep -r \
--include= \
--include= \
--include= \
. 2>/dev/null | grep -qv ;
ISSUES=$((ISSUES + ))
grep -r \
--include= \
--include= \
--include= \
. 2>/dev/null;
ISSUES=$((ISSUES + ))
[ -eq 0 ];
}
check_misconfig
#!/bin/bash
# Check for vulnerable and outdated components
check_vulnerable_components() {
echo "=== A06: Vulnerable and Outdated Components ==="
echo ""
# Node.js dependencies
if [ -f "package.json" ]; then
echo "Checking npm packages for vulnerabilities..."
npm audit --production 2>&1 | tee .npm-audit.txt
CRITICAL=$(grep -o "critical.*[0-9]*" .npm-audit.txt | grep -o "[0-9]*" | head -1)
HIGH=$(grep -o "high.*[0-9]*" .npm-audit.txt | grep -o "[0-9]*" | head -1)
if [ "${CRITICAL:-0}" -gt 0 ] || [ "${HIGH:-0}" -gt 0 ]; then
echo ""
echo "❌ CRITICAL: High-severity vulnerabilities found"
echo " Run: npm audit fix"
fi
rm -f .npm-audit.txt
fi
# Python dependencies
if [ -f "requirements.txt" ]; then
echo ""
echo "Checking Python packages for vulnerabilities..."
if command -v pip-audit &> /dev/null;
pip-audit
[ -f ];
npm outdated
}
check_vulnerable_components
#!/bin/bash
# Check for authentication and session management issues
check_authentication() {
echo "=== A07: Identification and Authentication Failures ==="
echo ""
ISSUES=0
# Check for weak password requirements
echo "Checking password validation..."
if ! grep -r "password.*length.*8\|.{8,}" \
--include="*.js" \
--include="*.ts" \
--include="*.py" \
. 2>/dev/null; then
echo "⚠️ Weak password requirements"
echo " Enforce minimum 8 characters with complexity"
ISSUES=$((ISSUES + 1))
fi
# Check for rate limiting
echo ""
echo "Checking for rate limiting..."
if [ "$FRAMEWORK" = "express" ]; then
if ! grep -r "rate-limit\|express-rate-limit" \
--include="package.json" \
. 2>/dev/null; then
echo "⚠️ Rate limiting not detected"
echo " Install: npm install express-rate-limit"
ISSUES=$((ISSUES + 1))
fi
fi
# Check for secure session management
grep -r \
--include= \
--include= \
. 2>/dev/null;
ISSUES=$((ISSUES + ))
grep -r \
--include= \
--include= \
. 2>/dev/null;
ISSUES=$((ISSUES + ))
! grep -r \
--include= \
--include= \
--include= \
. 2>/dev/null;
[ -eq 0 ];
}
check_authentication
#!/bin/bash
# Check for logging and monitoring issues
check_logging() {
echo "=== A09: Security Logging and Monitoring Failures ==="
echo ""
ISSUES=0
# Check for logging implementation
echo "Checking for logging..."
if ! grep -r "logger\|log\|winston\|bunyan\|pino" \
--include="*.js" \
--include="*.ts" \
. 2>/dev/null; then
echo "⚠️ Logging implementation not detected"
echo " Install logging library (winston, pino, etc.)"
ISSUES=$((ISSUES + 1))
fi
# Check for security event logging
echo ""
echo "Checking for security event logging..."
SECURITY_EVENTS=(
"login"
"logout"
"failed.*auth"
"access.*denied"
)
logged_events=0
for event in "${SECURITY_EVENTS[@]}"; do
if grep -r "$event.*log" \
--include="*.js" \
--include="*.ts" \
. 2>/dev/null; then
logged_events=$((logged_events + 1))
fi
done
[ -lt 2 ];
ISSUES=$((ISSUES + ))
grep -r \
--include= \
--include= \
. 2>/dev/null | grep -qv ;
ISSUES=$((ISSUES + ))
[ -eq 0 ];
}
check_logging
#!/bin/bash
# Generate comprehensive OWASP vulnerability report
generate_owasp_report() {
local output="${1:-OWASP_SECURITY_REPORT.md}"
echo "=== Generating OWASP Report ==="
echo ""
cat > "$output" << EOF
# OWASP Top 10 Security Assessment Report
**Date:** $(date +"%Y-%m-%d %H:%M:%S")
**Project:** $(basename $(pwd))
## Executive Summary
This report covers the OWASP Top 10 (2021) vulnerability categories.
## Findings
### A01:2021 - Broken Access Control
EOF
# Run all checks and append to report
check_access_control >> "$output" 2>&1
check_crypto_failures >> "$output" 2>&1
check_injection >> "$output" 2>&1
check_misconfig >> "$output" 2>&1
check_vulnerable_components >> "$output" 2>&1
check_authentication >> "$output" 2>&1
check_logging >> "$output" 2>&1
cat >> "$output" << EOF
## Remediation Priorities
### Critical (Fix Immediately)
- Hardcoded secrets and credentials
- SQL/Command injection vulnerabilities
- Authentication bypass issues
- High-severity dependency vulnerabilities
### High (Fix Within 30 Days)
- XSS vulnerabilities
- CSRF protection missing
- Weak cryptographic algorithms
- Security misconfigurations
### Medium (Fix Within 90 Days)
- Missing security headers
- Insufficient logging
- Rate limiting missing
- Weak password policies
### Low (Review and Plan)
- Code quality improvements
- Documentation updates
- Monitoring enhancements
## Next Steps
1. Review all CRITICAL findings immediately
2. Assign remediation tasks to team members
3. Set up automated security scanning in CI/CD
4. Schedule regular security reviews
5. Conduct penetration testing for high-risk applications
## Tools Used
- Custom OWASP Top 10 scanner
- npm audit / pip-audit
- Static code analysis
- Pattern matching for common vulnerabilities
## Disclaimer
This is an automated scan and may have false positives/negatives.
Conduct manual security review and penetration testing for production applications.
EOF
}
generate_owasp_report
Full OWASP scan:
/owasp-check
/owasp-check --report
Specific categories:
/owasp-check --injection
/owasp-check --auth
/owasp-check --access-control
Generate report:
/owasp-check --generate-report OWASP_Report.md
Security Testing:
Remediation:
/security-scan - Comprehensive security analysis/dependency-audit - Dependency vulnerability scanning/security-headers - Web security headers validation/ci-setup - Add OWASP checks to CI pipelineImportant: I will NEVER:
All security scans will be safe, thorough, and well-documented. This tool is for defensive security only.
Credits: Based on OWASP Top 10 (2021), security best practices, and common vulnerability patterns.