Skip to content

Bruno-Cunha-Souza/ValarMindSkills / skills/code-security-review

code-security-review

Flagged

Web/API security lifecycle for Go, Next.js, Python, and Bun — design controls, active testing, supply-chain/CI-CD, and LLM/agentic/MCP coverage. Maps to OWASP Web Top 10 2025 + API 2023 + LLM 2025 + Agentic 2026. Triggers: 'security review', 'revisão de segurança', 'auditar segurança', 'pentest', '/code-security-review'.

FileKindSize
SKILL.mdskill md17.3 KB
references/AI_SECURITY.mdmarkdown9.5 KB
references/DESIGN_CONTROLS.mdmarkdown18.0 KB
references/REPORT_TEMPLATE.mdmarkdown2.6 KB
references/SUPPLY_CHAIN_CICD.mdmarkdown9.1 KB
references/TESTING_PHASES.mdmarkdown17.5 KB
references/WEB_VULNERABILITIES.mdmarkdown22.1 KB
references/golang/API.mdmarkdown27.6 KB
references/golang/MIDDLEWARE.mdmarkdown14.4 KB
references/golang/PATCHES.mdmarkdown15.0 KB
references/golang/TESTING_PAYLOADS.mdmarkdown10.9 KB
references/golang/VULNERABILITIES.mdmarkdown20.6 KB
references/nextjs/API.mdmarkdown38.5 KB
references/nextjs/CONFIGURATION.mdmarkdown15.7 KB
references/nextjs/PATCHES.mdmarkdown16.7 KB
references/nextjs/TESTING_PAYLOADS.mdmarkdown11.9 KB
references/nextjs/VULNERABILITIES.mdmarkdown35.7 KB
references/python/API.mdmarkdown36.0 KB
references/python/CONFIGURATION.mdmarkdown22.4 KB
references/python/PATCHES.mdmarkdown12.1 KB
references/python/TESTING_PAYLOADS.mdmarkdown12.8 KB
references/python/VULNERABILITIES.mdmarkdown28.1 KB
scripts/00-pre-checks.shexecutablescript3.7 KB
scripts/01-auth-probes.shexecutablescript5.4 KB
scripts/02-jwt-attacks.pyexecutablescript10.1 KB
scripts/03-bola-probes.shexecutablescript6.4 KB
scripts/04-injection-probes.shexecutablescript7.3 KB
scripts/05-burst.k6.jsscript1.9 KB
scripts/05-rate-limit.shexecutablescript5.0 KB
scripts/06-info-disclosure.shexecutablescript5.2 KB
scripts/07-supply-chain.shexecutablescript7.9 KB
scripts/08-cors-headers.shexecutablescript5.5 KB
scripts/09-cicd-workflows.shexecutablescript6.1 KB
scripts/10-secrets-scan.shexecutablescript5.2 KB
scripts/11-ai-llm-probes.shexecutablescript8.8 KB
scripts/README.mdmarkdown8.0 KB
scripts/lib/common.shscript4.8 KB
scripts/lib/report.pyscript5.4 KB
scripts/run-all.shexecutablescript4.8 KB

scripts/run-all.sh

View on GitHub
#!/usr/bin/env bash
# Orchestrator — runs all probe phases in order, then aggregates findings into report.md.
#
# AUTHORIZATION REQUIRED: set I_HAVE_AUTHORIZATION=1 to confirm you have written
# permission to test the target. Refuses to run otherwise.
#
# STATIC_ONLY=1 runs only the static phases (07/09/10/11 — supply chain, CI/CD,
# secrets, AI/LLM static) against PROJECT_ROOT. No TARGET and no authorization
# needed, because static phases read files and send no attack traffic.
#
# Reads:  TARGET, I_HAVE_AUTHORIZATION, STATIC_ONLY, plus per-script env vars (see README.md)
# Writes: out/findings.jsonl, out/report.md, out/summary.json

set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
# shellcheck source=lib/common.sh
source "$SCRIPT_DIR/lib/common.sh"

if [ "${STATIC_ONLY:-}" = "1" ]; then
  log_info "STATIC_ONLY=1 — running static phases only (no live target)."
  phases=(
    "07-supply-chain.sh"
    "09-cicd-workflows.sh"
    "10-secrets-scan.sh"
    "11-ai-llm-probes.sh"
  )
else
  require_env TARGET

  # -------------------------------------------------------------------------
  # Authorization gate (active phases send attack-shaped traffic)
  # -------------------------------------------------------------------------
  if [ "${I_HAVE_AUTHORIZATION:-}" != "1" ]; then
    log_error "Refusing to run without explicit authorization."
    log_dim ""
    log_dim "These probes send real attack-shaped traffic to $TARGET."
    log_dim "Running without authorization is a crime in most jurisdictions."
    log_dim ""
    log_dim "If you have written permission to test (pentest agreement, bug bounty"
    log_dim "scope, ownership of the target), set:"
    log_dim ""
    log_dim "    export I_HAVE_AUTHORIZATION=1"
    log_dim ""
    log_dim "and rerun. (For file-only static checks, use STATIC_ONLY=1 instead.)"
    exit 2
  fi

  phases=(
    "00-pre-checks.sh"
    "01-auth-probes.sh"
    "02-jwt-attacks.py"
    "03-bola-probes.sh"
    "04-injection-probes.sh"
    "05-rate-limit.sh"
    "06-info-disclosure.sh"
    "07-supply-chain.sh"
    "08-cors-headers.sh"
    "09-cicd-workflows.sh"
    "10-secrets-scan.sh"
    "11-ai-llm-probes.sh"
  )
fi

# ---------------------------------------------------------------------------
# Reset findings file for a fresh run (back up previous if it exists)
# ---------------------------------------------------------------------------
if [ -s "$FINDINGS_FILE" ]; then
  backup="$OUT_DIR/findings.$(date +%Y%m%d-%H%M%S).jsonl"
  mv "$FINDINGS_FILE" "$backup"
  log_info "Previous findings backed up to $backup"
fi
: > "$FINDINGS_FILE"

run_phase() {
  local script="$1"
  local path="$SCRIPT_DIR/$script"
  if [ ! -f "$path" ]; then
    log_warn "Skipping $script — file not found"
    return 0
  fi

  log_info "============================================================"
  log_info "Running $script"
  log_info "============================================================"

  case "$script" in
    *.py)
      if ! python3 "$path"; then
        log_warn "$script exited non-zero (continuing)"
      fi
      ;;
    *.sh)
      if ! bash "$path"; then
        log_warn "$script exited non-zero (continuing)"
      fi
      ;;
  esac
}

for phase in "${phases[@]}"; do
  run_phase "$phase"
done

# ---------------------------------------------------------------------------
# Aggregate
# ---------------------------------------------------------------------------
log_info "============================================================"
log_info "Aggregating findings..."
log_info "============================================================"

if [ ! -f "$SCRIPT_DIR/lib/report.py" ]; then
  log_error "lib/report.py not found — cannot aggregate."
  exit 1
fi

python3 "$SCRIPT_DIR/lib/report.py" "$FINDINGS_FILE" > "$OUT_DIR/report.md"
python3 "$SCRIPT_DIR/lib/report.py" "$FINDINGS_FILE" --json > "$OUT_DIR/summary.json"

# ---------------------------------------------------------------------------
# Summary line for CI consumption
# ---------------------------------------------------------------------------
total_findings=$(wc -l < "$FINDINGS_FILE" | tr -d ' ')
log_ok "Run complete. $total_findings finding(s) recorded."
log_dim "  Markdown report: $OUT_DIR/report.md"
log_dim "  JSON summary:    $OUT_DIR/summary.json"
log_dim "  Raw findings:    $FINDINGS_FILE"

# Print one-line summary to stdout for CI
if command -v jq >/dev/null 2>&1; then
  jq -s '{
    total:    length,
    critical: ([.[] | select(.severity == "critical")] | length),
    high:     ([.[] | select(.severity == "high")]     | length),
    medium:   ([.[] | select(.severity == "medium")]   | length),
    low:      ([.[] | select(.severity == "low")]      | length),
    info:     ([.[] | select(.severity == "info")]     | length)
  }' "$FINDINGS_FILE"
else
  cat "$OUT_DIR/summary.json"
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: 472kUpdated 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: 472kUpdated Claude CodeCodexVerifiedInstall
rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics.Stars: 472kUpdated 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