Skip to content

unxed/f4 / .agents/skills/aif-security-checklist

aif-security-checklist

Unverified

Security 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".

FileKindSize
SKILL.mdskill md21.8 KB
references/AUTH-PATTERNS.mdmarkdown1.5 KB
references/PROMPT-INJECTION.mdmarkdown3.0 KB
references/RACE-CONDITIONS.mdmarkdown4.3 KB
scripts/audit.shexecutablescript3.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
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: 471kUpdated Claude CodeCodexVerifiedInstall
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: 471kUpdated Claude CodeCodexVerifiedInstall
rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics.Stars: 471kUpdated Claude CodeCodexVerifiedInstall
ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first.Stars: 194kUpdated Claude CodeCodexVerifiedInstall