Skip to content

aiskillstore/marketplace / skills/0xdarkmatter/security-patterns

security-patterns

Verified

Security patterns and OWASP guidelines. Triggers on: security review, OWASP, XSS, SQL injection, CSRF, authentication, authorization, secrets management, input validation, secure coding.

scripts/security-scan.sh

View on GitHub
#!/bin/bash
# Quick security scan using grep patterns
# Usage: ./security-scan.sh [directory]

set -e

DIR="${1:-.}"

RED='\033[0;31m'
YELLOW='\033[1;33m'
GREEN='\033[0;32m'
NC='\033[0m'

echo "=== Security Scan: $DIR ==="
echo ""

ISSUES=0

check_pattern() {
    local name="$1"
    local pattern="$2"
    local type="$3"

    echo -n "Checking: $name... "

    if rg -l "$pattern" "$DIR" --type "$type" 2>/dev/null | head -5 | grep -q .; then
        echo -e "${RED}FOUND${NC}"
        rg -n "$pattern" "$DIR" --type "$type" 2>/dev/null | head -10
        echo ""
        ISSUES=$((ISSUES + 1))
    else
        echo -e "${GREEN}OK${NC}"
    fi
}

# Python checks
echo "--- Python Security Checks ---"
check_pattern "Hardcoded secrets" "(password|secret|api_key|token)\s*=\s*['\"][^'\"]{8,}['\"]" "py"
check_pattern "SQL injection (f-strings)" "execute\(f['\"]" "py"
check_pattern "SQL injection (format)" "execute\(.*\.format\(" "py"
check_pattern "eval() usage" "\beval\s*\(" "py"
check_pattern "exec() usage" "\bexec\s*\(" "py"
check_pattern "pickle.loads" "pickle\.loads?\(" "py"
check_pattern "os.system" "os\.system\(" "py"
check_pattern "shell=True" "subprocess.*shell\s*=\s*True" "py"
check_pattern "MD5 hashing" "hashlib\.md5\(" "py"
check_pattern "SHA1 hashing" "hashlib\.sha1\(" "py"

echo ""

# JavaScript checks
echo "--- JavaScript Security Checks ---"
check_pattern "innerHTML" "\.innerHTML\s*=" "js"
check_pattern "eval() usage" "\beval\s*\(" "js"
check_pattern "document.write" "document\.write\(" "js"

echo ""

# General checks
echo "--- General Security Checks ---"

echo -n "Checking: .env files in git... "
if git ls-files | grep -E "\.env$|\.env\." | grep -q .; then
    echo -e "${RED}FOUND${NC}"
    git ls-files | grep -E "\.env$|\.env\."
    ISSUES=$((ISSUES + 1))
else
    echo -e "${GREEN}OK${NC}"
fi

echo -n "Checking: TODO/FIXME security items... "
if rg -i "TODO.*security|FIXME.*security|HACK.*security" "$DIR" 2>/dev/null | head -5 | grep -q .; then
    echo -e "${YELLOW}FOUND${NC}"
    rg -i "TODO.*security|FIXME.*security|HACK.*security" "$DIR" 2>/dev/null | head -10
    ISSUES=$((ISSUES + 1))
else
    echo -e "${GREEN}OK${NC}"
fi

echo ""
echo "=== Summary ==="
if [ $ISSUES -eq 0 ]; then
    echo -e "${GREEN}No issues found!${NC}"
    exit 0
else
    echo -e "${RED}Found $ISSUES potential security issues${NC}"
    echo "Review the findings above and address any real vulnerabilities."
    exit 1
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