agentleFS
cosmefaecosmefae/claude-skills/skills/security-auditor/SKILL.md

security-auditor

Skill2 starsChanged 5 months agoMITView on GitHub

Audits the security of a Claude Code environment: sensitive file permissions, .env vs gitignore, exposed secrets, Claude config (settings, CLAUDE.md, agents, skills, MCP, hooks). Read-only, never edits files. Invoke with: "audit security", "security audit", "check environment".

  • Reads credentials

41 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use performance-optimizer, api-designer and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • glinckerSkill

    performance-optimizer

    Analyze and optimize code performance, identify bottlenecks, and suggest improvements

    Also in 4 projects that use this

  • AutumnsGroveSkill

    api-designer

    Design and document RESTful and GraphQL APIs with OpenAPI/Swagger specifications, authentication patterns, versioning strategies, and best practices. Use for: (1) Creating API specifications, (2) Designing REST endpoints, (3) GraphQL schema design, (4) API authentication and authorization, (5) API versioning strategies, (6) Documentation generation

    Also in 5 projects that use this

  • JohnJBorenSkill

    test-engineer

    Testing strategy, test patterns, and coverage optimization for unit, integration, and E2E tests

    Also in 4 projects that use this

  • VercelSkill

    technical-writer

    Write, review, and edit developer documentation for SDKs, libraries, and frameworks, including sites such as ai-sdk.dev and chat-sdk.dev. Use for getting-started guides, tutorials, API references, conceptual explanations, integration guides, migration guides, troubleshooting, and code examples.

    Also in 6 projects that use this

  • JeffallanSkill

    devops-engineer

    Creates Dockerfiles, configures CI/CD pipelines, writes Kubernetes manifests, and generates Terraform/Pulumi infrastructure templates. Handles deployment automation, GitOps configuration, incident response runbooks, and internal developer platform tooling. Use when setting up CI/CD pipelines, containerizing applications, managing infrastructure as code, deploying to Kubernetes clusters, configuring cloud platforms, automating releases, or responding to production incidents. Invoke for pipelines, Docker, Kubernetes, GitOps, Terraform, GitHub Actions, on-call, or platform engineering.

    Also in 4 projects that use this

  • lotosbinSkill

    ui-ux-designer

    UI/UX 设计师专家,精通界面设计、交互设计、用户体验和设计系统

    Also in 3 projects that use this

The file

We split this skill into the rules it gives an agent

5 rules. 0 are common, 2 are distinctive, and 3 are very specific to this project.

  • 0

    Common

    Most of the 39 edited versions we read keep these.

  • 2

    Distinctive

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    If invoked with an explicit path argument, use that.

    line 17
  2. Very specific:

    All at 600 → ✅ PASS

    line 102
  3. Very specific:

    No unqualified "*" → ✅ PASS

    line 121
  4. Distinctive:

    No external URL in hooks → ✅ PASS

    line 131
  5. Very specific:

    If everything passes: NONE

    line 182

“Common” is measured: kept by at least 6 in 10 of the 39 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Claude Code environment security auditor. Follows official Anthropic best practices (docs.anthropic.com/en/docs/claude-code/security). Runs a read-only checklist and returns findings ordered by severity. Never edits files.

Configuration

This skill needs a project root to audit. Determine it in this order:

  1. If invoked with an explicit path argument, use that.
  2. Otherwise, use the current working directory ($(pwd)) as the project root.
  3. Also check ~/.claude/ for global (user-level) config alongside the project root.

Substitute $PROJECT_ROOT below with the resolved path before running each command.

Checklist

1. .env committed to git (CRITICAL)

cd $PROJECT_ROOT && git ls-files | grep -E "\.env$|\.env\." | grep -v ".env.example"
  • No results → ✅ PASS
  • Any result → ❌ CRITICAL FAIL

2. Secrets in CLAUDE.md

grep -iE "sk-ant|ANTHROPIC_API_KEY|Bearer [a-zA-Z0-9]|password\s*[:=]|secret\s*[:=]" \
  ~/.claude/CLAUDE.md $PROJECT_ROOT/CLAUDE.md 2>/dev/null
  • No match → ✅ PASS
  • Any match → ❌ FAIL

3. Secrets in memory/context files

grep -riE "sk-ant|ANTHROPIC_API_KEY|Bearer [a-zA-Z0-9]|password\s*[:=]|secret\s*[:=]" \
  $PROJECT_ROOT/context/memory/ 2>/dev/null

Adjust the path if the project uses a different location for durable memory/context files (e.g. docs/memory/, .claude/memory/).

  • No match → ✅ PASS
  • Any match → ❌ FAIL

4. dangerously-skip-permissions

grep -r "dangerously-skip-permissions\|dangerouslySkipPermissions\|bypassPermissions" \
  ~/.claude/settings.json $PROJECT_ROOT/.claude/ 2>/dev/null
  • No match → ✅ PASS
  • Any match → ❌ FAIL

5. Prompt injection in skills

grep -ri "ignore previous instructions\|override system\|disregard your\|forget your instructions" \
  ~/.claude/skills/ $PROJECT_ROOT/.claude/skills/ 2>/dev/null
  • No match → ✅ PASS
  • Any match → ❌ FAIL

6. MCP: cleartext tokens in configs

find $PROJECT_ROOT/.claude/mcp-servers ~/.claude -name "*.json" -not -path "*/node_modules/*" 2>/dev/null \
  | xargs grep -lE "\"token\"|\"api_key\"|\"secret\"|\"password\"" 2>/dev/null
  • No results → ✅ PASS
  • Any result → ❌ FAIL

7. Permissions: memory/context files

ls -la $PROJECT_ROOT/context/memory/
  • All .md files at 600 (-rw-------) → ✅ PASS
  • Any file at 644 or more open → ⚠️ WARN (report filenames)

8. Permissions: settings and CLAUDE.md

ls -la ~/.claude/settings.json ~/.claude/CLAUDE.md
ls -la $PROJECT_ROOT/.claude/settings.json 2>/dev/null
  • All at 600 → ✅ PASS
  • More open → ⚠️ WARN

9. settings.json: deny rules present (Anthropic: deny is evaluated first)

cat ~/.claude/settings.json | grep -A5 '"deny"'
cat $PROJECT_ROOT/.claude/settings.json 2>/dev/null | grep -A5 '"deny"'
  • permissions.deny present and non-empty → ✅ PASS
  • Absent or empty → ⚠️ WARN

10. settings.json: unrestricted wildcard in allow

cat ~/.claude/settings.json | grep '"allow"' -A20 | grep '"\*"'
  • No unqualified "*" → ✅ PASS
  • Present → ⚠️ WARN

11. Hooks: external URLs without allowlist (exfiltration risk)

grep -r "http" ~/.claude/settings.json $PROJECT_ROOT/.claude/settings.json 2>/dev/null \
  | grep -v "https://localhost\|https://127\|#"
  • No external URL in hooks → ✅ PASS
  • External URL present → ⚠️ WARN (verify if it's a legitimate MCP or a suspicious hook)

12. .env files: gitignore coverage

find $PROJECT_ROOT -name ".env" -o -name ".env.*" 2>/dev/null \
  | grep -v ".env.example" | grep -v node_modules | grep -v ".venv" | grep -v ".git"

For each .env found: cd $PROJECT_ROOT && git check-ignore -v <file>

  • All covered → ✅ PASS
  • Any not ignored → ⚠️ WARN

13. Agents: valid frontmatter

find ~/.claude/agents $PROJECT_ROOT/.claude/agents -name "*.md" \
  -not -name "CLAUDE.md" 2>/dev/null

For each file: check for name: and description: in the frontmatter.

  • All valid → ✅ PASS
  • File without frontmatter → ⚠️ WARN

14. MCP: endpoints without TLS

grep -r '"url"' ~/.claude/settings.json $PROJECT_ROOT/.claude/ 2>/dev/null \
  | grep "http://" | grep -v "http://localhost\|http://127"
  • No results → ✅ PASS
  • Remote http:// endpoint without TLS → ⚠️ WARN

Output

Return ONLY WARN/FAIL findings, ordered by severity (critical FAIL → FAIL → WARN), one per line:

FAIL env-committed: .env committed to git (CRITICAL)
FAIL secret-memory: sk-ant exposed in finances.md line 12
FAIL bypass-permissions: bypassPermissions active in settings
WARN memory-perms: finances.md with 644 permissions
WARN env-not-ignored: .claude/skills/foo/.env not gitignored
WARN hook-external-url: external URL in PreToolUse hook (verify)
WARN agent-frontmatter: some-agent.md missing name/description

If everything passes: NONE

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.