agentleFS
ractiveractive/hyalo/.claude/skills/security-audit/SKILL.md

security-audit

Skill27 starsChanged 3 months agoMITView on GitHub

REQUIRED skill for any security-related request. Use this skill whenever the user wants to find anything dangerous, sensitive, or risky in their code, files, or repository. This includes but is not limited to: scanning for secrets/keys/tokens/credentials, checking dependencies for vulnerabilities, auditing destructive commands for missing safeguards, reviewing files for PII or internal data before open-sourcing, checking .env files or git history for leaked credentials, or any request where the concern is "is this safe/secure/exposed?" This skill provides a structured audit methodology and checklist you MUST follow — do not attempt security reviews without it. Skip this skill ONLY for pure feature work, refactoring, bug fixes, or non-security code review.

  • Reads credentials

140 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use asset-spec, create-control-manifest 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.
  • cenconq25Skill

    asset-spec

    Generates per-asset visual specifications and AI-generation prompts from PRDs and the design bible. Produces structured spec files and updates a master asset manifest. Use after design bible is approved and a UX spec or PRD identifies assets to produce. Output: design/assets/<asset>.md plus design/assets/manifest.md.

    Also in 5 projects that use this

  • cenconq25Skill

    create-control-manifest

    Produces a flat, immediately-actionable rules sheet — do this, never do that, per system and per layer — extracted from accepted ADRs, technical preferences, and framework reference docs. More directly usable than ADRs for day-to-day implementation. Run after /architecture-review passes.

    Also in 5 projects that use this

  • +10 more from cenconq25

The file

Show its rules and text

We split this skill into the rules it gives an agent

13 rules. 0 are common, 9 are distinctive, and 4 are very specific to this project.

  • 0

    Common

    Most of the 118 edited versions we read keep these.

  • 9

    Distinctive

    This author's own choices. Worth a look.

  • 4

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  • could be automatic: a setting could enforce it
  1. Very specific:

    Test fixtures (JSON, YAML, TOML in tests/ or fixtures/ dirs) — open each one and check for real-looking values

    line 28
  2. Very specific:

    Run git log --format='%ae' | sort -u to check author emails — corporate or personal emails will be exposed when open-sourced

    line 37
  3. Very specific:

    Run git log --all --oneline --diff-filter=D -- '*.env' '*.key' '*.pem' '*.json' to check if sensitive files were ever committed and then …

    line 38
  4. Distinctive:

    Check if any commit messages reference ticket numbers, internal systems, or real account details

    line 39
  5. Distinctive:

    Do error messages leak internal paths, server responses, or credential fragments?

    line 76
  6. Very specific:

    Check Cargo.toml and Cargo.lock for known-vulnerable versions

    line 80
  7. Distinctive:

    Follow with a 2-3 sentence assessment of the overall security posture.

    line 127
  8. Distinctive:

    Don't list items that pass inspection — only report actual findings

    line 131
  9. Distinctive:

    Don't flag theoretical issues in safe Rust code that the type system already prevents

    line 132
  10. Distinctive:

    Don't recommend adding dependencies (like secret-scanning tools) unless there's a specific gap

    line 133
  11. Distinctive:

    Don't rewrite code — just identify the issues and suggest fixes

    line 134
  12. Distinctive:

    Don't pad the report with generic security advice (e.g., "consider using HTTPS" when the code already does)

    line 135
  13. Distinctive:

    Don't flag things as issues when they're intentional design choices (e.g., reading API key from env var is standard practice, not a …

    line 136

“Common” is measured: kept by at least 6 in 10 of the 118 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

Security Audit

You are performing a security audit of a Rust codebase. Your goal is to find real, actionable security issues — not to generate a long list of theoretical concerns. Prioritize findings by actual risk: a leaked API key in a fixture is more urgent than a theoretical timing attack on a string comparison.

Audit Structure

Produce a report with these sections. For each section, only include findings — skip "PASS" items unless they are genuinely surprising or counterintuitive. A lean report focused on what needs fixing is more useful than one padded with confirmations of good practices. However, always check and report on dependencies (section 2) even if they look clean — dependency vulnerabilities are silent and a "no issues found" confirmation is valuable there.

1. Secrets & Sensitive Data Scan

This is often the highest-impact finding category because leaked secrets can be exploited immediately, unlike code vulnerabilities that require an attack vector. Scan systematically — open and read every non-binary file, don't just check whether directories are gitignored.

Where to look (read the actual files, don't just check if they exist):

  • Test fixtures (JSON, YAML, TOML in tests/ or fixtures/ dirs) — open each one and check for real-looking values
  • Documentation and knowledgebase files — read every .md file in any docs/, knowledgebase/, or similar directory. Look for infrastructure details, account references, "production" mentions, internal project names, and internal URLs. These files are easily overlooked but often contain the most revealing information about the real infrastructure behind the project
  • Agent memory and config (.claude/ directory tree) — check committed agent definitions, skill files, and memory indexes for private paths or personal details
  • Config files (.env, .env.example, settings.json, settings.local.json)
  • OpenAPI specs or API reference files — these often contain example data copied from real responses
  • Cargo.toml metadata (author emails, repository URLs)
  • CI/CD configs

Git history scan — this catches things the file tree misses:

  • Run git log --format='%ae' | sort -u to check author emails — corporate or personal emails will be exposed when open-sourced
  • Run git log --all --oneline --diff-filter=D -- '*.env' '*.key' '*.pem' '*.json' to check if sensitive files were ever committed and then deleted (they're still in history)
  • Check if any commit messages reference ticket numbers, internal systems, or real account details

What to look for:

  • API keys, tokens, passwords (even "test" values — redacted-* is fine, but sk-live-* or realistic UUIDs are not)
  • Real account IDs, user IDs, or organization IDs (vs obvious dummy values like 00000000-...)
  • Email addresses, usernames, or personal information
  • Internal hostnames, IP addresses, or infrastructure details
  • URLs with embedded credentials or tokens
  • Private file paths (like /Users/username/...) that reveal system layout
  • References to "production", "staging", or internal environments that reveal infrastructure context

Severity guide:

  • CRITICAL: Live credentials, real API keys, or PII that could enable account access
  • HIGH: Real-looking IDs or infrastructure details that could aid reconnaissance
  • MEDIUM: Personal info (emails in git history, local paths) that would be exposed on open-source
  • LOW: Placeholder values that technically should be more obviously fake

2. Rust Code Security

Focus on patterns that create real vulnerabilities in this specific codebase, not generic Rust safety advice.

Input validation & injection:

  • CLI arguments passed to shell commands, URLs, or file paths without sanitization
  • Path traversal: can user-supplied --path, --file, --remote_path etc. escape intended directories? (e.g., ../../etc/passwd)
  • URL construction: are user inputs interpolated into URLs without encoding? Pay special attention to hostname construction — if a user-supplied value becomes part of a domain name, an attacker can redirect requests (and credentials) to their own server
  • Does the CLI accept --format json or similar that could be used for output injection?

Authentication & credential handling:

  • Are API keys logged, included in error messages, or written to disk?
  • Could debug output (--debug flag) leak credentials in HTTP headers?
  • Are credentials held in memory longer than necessary?
  • Is there any credential caching that could leave secrets on disk?

Unsafe code:

  • Any unsafe blocks — are they actually necessary? Is the safety invariant documented?

Error handling:

  • Do error messages leak internal paths, server responses, or credential fragments?
  • Are panics possible from user input (unwrap on user-controlled data)?

Dependency concerns:

  • Check Cargo.toml and Cargo.lock for known-vulnerable versions
  • Are there dependencies with overly broad feature flags?

3. CLI Misuse Vectors

Think like an attacker who has access to this CLI tool. What could they do that the developer didn't intend?

Destructive operations:

  • Are delete operations (purge, rm, delete) protected by confirmation prompts?
  • Can --yes / -y flag be used to bypass all safety checks in scripts?
  • Is there rate limiting or batch-size limits on destructive operations?
  • Does the delete confirmation distinguish between files and directories (recursive delete)?

Local file system risks:

  • Can download commands write to arbitrary paths? (overwriting ~/.ssh/authorized_keys, etc.)
  • Can upload commands read arbitrary local files? (exfiltrating /etc/passwd to cloud storage)
  • Are there symlink-following risks?

Privilege escalation:

  • Could a low-privilege API key be used to discover or access resources it shouldn't?

Supply chain:

  • Could malicious shell completions be generated?
  • Are there code paths where external data (API responses) influences local file operations?

4. Configuration & Infrastructure

  • Is .env properly gitignored?
  • Are there any config files that might be committed with real values?
  • Does the project have appropriate .gitignore coverage?

Report Format

Present findings as a prioritized list. For each finding:

### [CRITICAL|HIGH|MEDIUM|LOW] Brief title

**File:** `path/to/file.rs:42`
**Issue:** What's wrong, concretely
**Risk:** What an attacker could do with this
**Fix:** Specific remediation (one line if possible)

End the report with exactly this format: X findings: N critical, N high, N medium, N low

Follow with a 2-3 sentence assessment of the overall security posture.

What NOT to do

  • Don't list items that pass inspection — only report actual findings
  • Don't flag theoretical issues in safe Rust code that the type system already prevents
  • Don't recommend adding dependencies (like secret-scanning tools) unless there's a specific gap
  • Don't rewrite code — just identify the issues and suggest fixes
  • Don't pad the report with generic security advice (e.g., "consider using HTTPS" when the code already does)
  • Don't flag things as issues when they're intentional design choices (e.g., reading API key from env var is standard practice, not a vulnerability)

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.