unxed/f4 / .agents/skills/aif-security-checklist
aif-security-checklist
UnverifiedSecurity audit checklist based on OWASP Top 10 and best practices. Covers authentication, injection, XSS, CSRF, secrets management, and more. Use when reviewing security, before deploy, asking "is this secure", "security check", "vulnerability".
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 21.8 KB |
| references/AUTH-PATTERNS.md | markdown | 1.5 KB |
| references/PROMPT-INJECTION.md | markdown | 3.0 KB |
| references/RACE-CONDITIONS.md | markdown | 4.3 KB |
| scripts/audit.shexecutable | script | 3.6 KB |
scripts/audit.sh
View on GitHub#!/bin/bash
# Security Audit Script
# Run comprehensive security checks on a project
set -e
echo "π Security Audit"
echo "================="
echo ""
# Colors
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
NC='\033[0m' # No Color
# Counters
ISSUES=0
# 1. Check for secrets in code
echo "π Checking for hardcoded secrets..."
SECRETS=$(grep -rn --include="*.ts" --include="*.js" --include="*.py" --include="*.php" \
-E "(password|secret|api_key|apikey|token|private_key)\s*[:=]" . 2>/dev/null | \
grep -v node_modules | grep -v ".git" | grep -v "test" | head -20 || true)
if [ -n "$SECRETS" ]; then
echo -e "${RED}β οΈ Potential secrets found:${NC}"
echo "$SECRETS"
((ISSUES++))
else
echo -e "${GREEN}β
No obvious hardcoded secrets${NC}"
fi
echo ""
# 2. Check for .env committed
echo "π Checking for .env in git..."
if git ls-files --error-unmatch .env 2>/dev/null; then
echo -e "${RED}β οΈ .env is tracked in git!${NC}"
((ISSUES++))
else
echo -e "${GREEN}β
.env is not tracked${NC}"
fi
echo ""
# 3. Check .gitignore
echo "π Checking .gitignore..."
if [ -f .gitignore ]; then
if grep -q "\.env" .gitignore; then
echo -e "${GREEN}β
.env in .gitignore${NC}"
else
echo -e "${YELLOW}β οΈ .env not in .gitignore${NC}"
((ISSUES++))
fi
else
echo -e "${YELLOW}β οΈ No .gitignore found${NC}"
fi
echo ""
# 4. NPM Audit (if package.json exists)
if [ -f package.json ]; then
echo "π Running npm audit..."
if npm audit --audit-level=high 2>/dev/null; then
echo -e "${GREEN}β
No high/critical vulnerabilities${NC}"
else
echo -e "${RED}β οΈ Vulnerabilities found - run 'npm audit' for details${NC}"
((ISSUES++))
fi
echo ""
fi
# 5. Check for verbose client logging in production code
echo "π Checking for verbose console statements..."
LOGS=$(grep -rn -E "console\.(log|debug|info|trace)" \
--include="*.ts" --include="*.tsx" --include="*.js" --include="*.jsx" src/ 2>/dev/null | \
grep -v "test" | grep -v "spec" | head -10 || true)
if [ -n "$LOGS" ]; then
echo -e "${YELLOW}β οΈ Verbose console output found (must be removed or gated outside production):${NC}"
echo "$LOGS"
else
echo -e "${GREEN}β
No verbose console output in src/${NC}"
fi
echo ""
# 6. Check for raw error rendering patterns
echo "π Checking for raw client-facing error patterns..."
RAW_ERRORS=$(grep -rn -E "(error|err)\.message|String\((error|err)\)|\.stack" \
--include="*.ts" --include="*.tsx" --include="*.js" --include="*.jsx" src/ 2>/dev/null | \
grep -v "test" | grep -v "spec" | head -10 || true)
if [ -n "$RAW_ERRORS" ]; then
echo -e "${YELLOW}β οΈ Raw error usage found (verify production UI/API returns normalized client-safe errors):${NC}"
echo "$RAW_ERRORS"
else
echo -e "${GREEN}β
No obvious raw error rendering patterns in src/${NC}"
fi
echo ""
# 7. Check for TODO security items
echo "π Checking for security TODOs..."
TODOS=$(grep -rn --include="*.ts" --include="*.js" --include="*.py" --include="*.php" \
-i "todo.*security\|fixme.*security\|xxx.*security\|hack" . 2>/dev/null | \
grep -v node_modules | head -10 || true)
if [ -n "$TODOS" ]; then
echo -e "${YELLOW}β οΈ Security TODOs found:${NC}"
echo "$TODOS"
else
echo -e "${GREEN}β
No security TODOs${NC}"
fi
echo ""
# Summary
echo "================="
if [ $ISSUES -gt 0 ]; then
echo -e "${RED}Found $ISSUES potential issue(s)${NC}"
echo "Review the items above and fix before deployment."
exit 1
else
echo -e "${GREEN}β
No critical issues found${NC}"
echo "Remember to also review manually using /aif-security-checklist"
exit 0
fi
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| rea-analysis-optimizationmorluto/reaOptimize REA providers and shared analysis workflows for agent context, latency, CPU, and memory while preserving correctness and Evidence. Use for analysis bottlenecks and cache or query design; CI/test-suite optimization belongs to rea-ci-tests-audit. | Stars: 471k | Updated | Claude CodeCodex | Verified | Install |
| rea-ci-tests-auditmorluto/reaAudit REA CI and test suites for correctness, fixture drift, false passes, and measured performance; use for suite or workflow investigations and efficiency changes, rather than ordinary feature testing or a single test failure. | Stars: 471k | Updated | Claude CodeCodex | Verified | Install |
| rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics. | Stars: 471k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |