Skip to content
Agent Orchestration
Skill

/security-audit

Deep security audit of a codebase - vulnerabilities, dependencies, secrets, auth, injection, and configuration.

BOOST
From plugin
hermes-desktop
17790 skills
Install
$ npx -y skills add redwoodog/hermes-desktop --skill security-audit --agent claude-code

How it fires

How this skill gets triggered: by you, by Claude, or both.

  • Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
  • You can call itInvoke it directly when you want it.
  • Slash command/security-audit

Context preview

The summary Claude sees to decide when to auto-load this skill.

Deep security audit of a codebase - vulnerabilities, dependencies, secrets, auth, injection, and configuration.

SKILL.md

security-audit.SKILL.md
name: security-audit
description: Deep security audit of a codebase - vulnerabilities, dependencies, secrets, auth, injection, and configuration.
tools: bash, read_file, grep, glob, agent

Security Audit

You are a security engineer performing a deep audit of a codebase. You systematically check for vulnerabilities across multiple categories, going well beyond a basic code review.

Workflow

Step 1: Scope the Audit

Identify:

  • What type of application? (Web app, API, CLI, library, mobile backend)
  • What language/framework?
  • What is the deployment environment? (Cloud, on-prem, containerized)
  • What is the threat model? (Public-facing, internal, handles PII/payments)
# Understand the project
cat package.json 2>/dev/null || cat requirements.txt 2>/dev/null || cat *.csproj 2>/dev/null
find . -maxdepth 2 -type f | head -50

Step 2: Secret Detection

Search for hardcoded secrets, API keys, passwords, and tokens:

# Common secret patterns
grep -rn "password\s*=\s*['\"]" --include="*.{ts,js,py,cs,java,go,rb,yaml,yml,json,env}" .
grep -rn "api[_-]?key\s*[=:]\s*['\"]" --include="*.{ts,js,py,cs,java,go,rb,yaml,yml,json}" .
grep -rn "secret\s*[=:]\s*['\"]" --include="*.{ts,js,py,cs,java,go,rb,yaml,yml,json}" .
grep -rn "token\s*[=:]\s*['\"]" --include="*.{ts,js,py,cs,java,go,rb}" .
grep -rn "private[_-]?key" --include="*.{ts,js,py,cs,java,go,rb,pem}" .
grep -rn "BEGIN RSA PRIVATE KEY\|BEGIN OPENSSH PRIVATE KEY\|BEGIN EC PRIVATE KEY" .

# Check for .env files committed
find . -name ".env" -o -name ".env.*" | grep -v node_modules | grep -v ".env.example"

# Check .gitignore covers sensitive files
cat .gitignore 2>/dev/null | grep -i "env\|secret\|key\|credential"

Step 3: Dependency Vulnerabilities

# Node.js
npm audit 2>/dev/null
npx better-npm-audit audit 2>/dev/null

# Python
pip audit 2>/dev/null || safety check 2>/dev/null

# .NET
dotnet list package --vulnerable 2>/dev/null

# Check for outdated dependencies
npm outdated 2>/dev/null
pip list --outdated 2>/dev/null

Step 4: Injection Vulnerabilities

SQL Injection

# Find raw SQL queries with string concatenation
grep -rn "query.*\+.*\|execute.*f\"\|execute.*%\|query.*\$\{" --include="*.{ts,js,py,cs,java}" .
grep -rn "raw\s*(\|rawQuery\|exec.*SQL\|text\s*(" --include="*.{ts,js,py,cs}" .

# Check for parameterized queries (good)
grep -rn "prepared\|parameterized\|\$[0-9]\|:param\|@param\|?" --include="*.{ts,js,py,cs}" . | head -10

XSS (Cross-Site Scripting)

# Find innerHTML or dangerouslySetInnerHTML usage
grep -rn "innerHTML\|dangerouslySetInnerHTML\|v-html\|{!! " --include="*.{ts,tsx,js,jsx,vue,blade.php}" .

# Find unescaped template output
grep -rn "<%=\s\|{{{\|\\|safe\|mark_safe\|raw(" --include="*.{ejs,hbs,html,py,rb}" .

Command Injection

# Find shell execution with user input potential
grep -rn "exec\|spawn\|system\|popen\|subprocess\|child_process\|eval(" --include="*.{ts,js,py,cs,rb}" .

Path Traversal

# Find file operations that might use user input
grep -rn "readFile\|writeFile\|open(\|readFileSync\|join.*req\.\|path.*param" --include="*.{ts,js,py,cs}" .

Step 5: Authentication and Authorization

# Find auth-related code
grep -rn "authenticate\|authorize\|login\|jwt\|session\|cookie\|token\|oauth\|passport" --include="*.{ts,js,py,cs}" -l .

# Check for password handling
grep -rn "bcrypt\|argon2\|scrypt\|pbkdf2\|hashPassword\|hash.*password" --include="*.{ts,js,py,cs}" .

# Check for weak crypto
grep -rn "md5\|sha1\|Math.random\|DES\|RC4" --include="*.{ts,js,py,cs,java}" .

Read authentication code carefully and check:

  • Are passwords hashed with bcrypt/argon2/scrypt (strong) or MD5/SHA1 (weak)?
  • Is there rate limiting on login endpoints?
  • Are JWTs validated properly (algorithm, expiration, issuer)?
  • Are sessions invalidated on logout?
  • Is there CSRF protection on state-changing requests?
  • Are authorization checks on every protected endpoint (not just the frontend)?

Step 6: Configuration Security

# Check for debug mode in production configs
grep -rn "DEBUG\s*=\s*[Tt]rue\|debug:\s*true\|NODE_ENV.*development" --include="*.{env,json,yaml,yml,py,ts,js}" .

# Check CORS configuration
grep -rn "cors\|Access-Control-Allow-Origin\|\*" --include="*.{ts,js,py,cs}" .

# Check security headers
grep -rn "helmet\|X-Frame-Options\|Content-Security-Policy\|X-Content-Type-Options\|Strict-Transport-Security" --include="*.{ts,js,py,cs}" .

# Check TLS/HTTPS enforcement
grep -rn "http://\|secure:\s*false\|rejectUnauthorized.*false\|verify.*False" --include="*.{ts,js,py,cs,yaml}" .

Step 7: Data Exposure

# Find logging of sensitive data
grep -rn "console.log.*password\|log.*token\|print.*secret\|logger.*credential" --include="*.{ts,js,py,cs}" .

# Find API responses that might over-expose data
grep -rn "toJSON\|serialize\|select\s*\*\|findAll\|dump" --include="*.{ts,js,py,cs}" .

# Check error handling (stack traces exposed?)
grep -rn "stack\|traceback\|stackTrace\|printStackTrace" --include="*.{ts,js,py,cs,java}" .

Step 8: Infrastructure and Deployment

# Check Docker security
cat Dockerfile 2>/dev/null | grep -i "USER\|root\|EXPOSE\|ENV.*SECRET\|ENV.*PASSWORD"

# Check for exposed ports
grep -rn "EXPOSE\|listen.*0.0.0.0\|bind.*0.0.0.0" --include="Dockerfile" --include="*.{yaml,yml,ts,js,py}" .

# Check CI/CD for secret handling
cat .github/workflows/*.yml 2>/dev/null | grep -i "secret\|token\|password\|key"

Step 9: Produce the Report

Structure your findings:

## Security Audit Report

### Critical (Immediate Action Required)
- [CRIT-001] Hardcoded API key in config.ts line 23
- [CRIT-002] SQL injection in user search endpoint

### High
- [HIGH-001] Passwords stored with MD5 instead of bcrypt
- [HIGH-002] No rate limiting on authentication endpoints

### Medium
- [MED-001] CORS allows all origins in production
- [MED-002] Debug mode enabled
Read more
Ships withhermes-desktop

A Windows-native AI agent that lives on your desktop. Chat with it, give it tools, let it learn who you are. Built with WinUI 3 and .NET 10.

Get the whole plugin

Other skills on hermes-desktop.