agentleFS
Cogni-AI-OUCogni-AI-OU/cogni-ai-agent-skills/security-audit/SKILL.md

security-audit

Skill4 starsChanged 7 months agoMITView on GitHub

Commands, step-by-step procedures, and mechanical execution for performing deep security audits, vulnerability assessments, and report generation on codebases and configurations. You MUST load this skill when performing security audits or validation.

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

We split this skill into the rules it gives an agent

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

  • 0

    Common

    Most of the 118 edited versions we read keep these.

  • 2

    Distinctive

    This author's own choices. Worth a look.

  • 2

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use this skill when the request involves:

    line 18
  2. Very specific:

    When performing a lightweight PR review (use security-review).

    line 33
  3. Very specific:

    When writing tests for functional validation (use tester or tdd).

    line 34
  4. Distinctive:

    When optimizing code purely for performance without a security context.

    line 35

“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 Auditing Skill

This skill outlines the mechanical steps, mindset, and procedures required to conduct a thorough security audit on a target codebase or architectural component. It integrates dependency analysis, deep vulnerability scanning, structured threat modeling, and strict output constraints.

When to Use

Use this skill when the request involves:

  • Scanning a codebase or file for security vulnerabilities
  • Running a security audit or vulnerability check
  • Checking for SQL injection, XSS, command injection, or other injection flaws
  • Finding exposed API keys, hardcoded secrets, or credentials in code
  • Auditing dependencies for known CVEs
  • Reviewing authentication, authorization, or access control logic
  • Detecting insecure cryptography or weak randomness
  • Performing a data flow analysis to trace user input to dangerous sinks
  • Any request phrasing like "is my code secure?", "scan this file", or "check my repo for vulnerabilities"
  • Running /security-audit or /security-audit <path>

When Not to Use

  • When performing a lightweight PR review (use security-review).
  • When writing tests for functional validation (use tester or tdd).
  • When optimizing code purely for performance without a security context.

Common Pitfalls

  • False Positives: Flagging code as vulnerable purely based on regex matches without considering existing sanitization or trust boundaries.
  • Ignoring the Supply Chain: Auditing the source code meticulously but neglecting to check package.json or requirements.txt for known CVEs.
  • Suggesting Breaking Changes: Recommending heavy-handed security controls that completely break the application's core business logic.

Role Persona & Cognitive Framework

  • Adversarial Attacker Engine: Think like an advanced persistent threat (APT). Ask "How can I bypass this check?", "What happens if this input is 10GB?", and "Can I pivot from this resource to another?"
  • Zero-Trust Assumption Principle: Assume developers have made the most common mistake and that the network is already compromised.
  • Root Cause Vulnerability Tracing: Trace security flaws to their architectural root.
  • Audit-Only Enforcement: Base your analysis on reading the code, static analysis, and configuration inspection.
  • Exploit & Remediation Pairing: For every vulnerability found, provide both the adversarial attack scenario and an exact, implementable remediation.

1. Threat Surface Discovery & Triage

  1. Architecture & Trust Boundary Mapping:
    • Identify all primary assets, actors, data flows, and entry points.
    • Map explicit trust boundaries.
  2. Dependency & Supply Chain Audit:
    • Analyze dependency manifests to identify vulnerable dependencies (known CVEs).

2. Deep Vulnerability Audit Execution

Execute a rigorous, ordered security analysis against the target architecture:

  1. Injection & Input Handling: SQLi, XSS, command injection.
  2. Authentication & Authorization: RBAC, IDOR, session management.
  3. Secrets, Cryptography & Data Protection: Credential scanning, weak crypto.
  4. Security Headers & Network Config: CSP, HSTS, CORS.
  5. Third-Party Integrations: Webhooks, API keys.
  6. AI & Prompt Security: Prompt injection boundaries.

3. Threat Modeling & Exploitability Assessment

  1. STRIDE Analysis.
  2. Attack Scenario Formulation.
  3. Blast-Radius Check.
  4. Risk Ranking.

4. Remediation Reporting

Output the full report in the structured format defined in references/report-format.md.

Output Format

The report MUST include:

  1. Findings Summary Table.
  2. Detailed Findings.
  3. Dependency Audit.
  4. Secrets Scan.
  5. Patch Proposals.

Execution Workflow

Step 1 — Scope Resolution

Step 2 — Dependency Audit

Step 3 — Secrets & Exposure Scan

Step 4 — Vulnerability Deep Scan

Step 5 — Cross-File Data Flow Analysis

Step 6 — Self-Verification Pass

Step 7 — Generate Security Report

Step 8 — Propose Patches

Severity Guide

SeverityMeaning
🔴 CRITICALImmediate exploitation risk, data breach likely
🟠 HIGHSerious vulnerability, exploit path exists
🟡 MEDIUMExploitable with conditions or chaining
🔵 LOWBest practice violation, low direct risk
⚪ INFOObservation worth noting

Reference Files

  • references/vuln-categories.md
  • references/secret-patterns.md
  • references/language-patterns.md
  • references/vulnerable-packages.md
  • references/report-format.md

Related Skills

  • critical-thinking
  • robust-commands
  • security-review

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.