agentleFS
andreaswasitaandreaswasita/copilot-agents-dojo/skills/security-audit/SKILL.md

security-audit

Skill54 starsChanged 6 months agoMITView on GitHub

Detects high-confidence security risks in code.

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

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

  • 0

    Common

    Most of the 118 edited versions we read keep these.

  • 6

    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. Distinctive:

    Before opening a PR that touches auth, secrets handling, deserialization, or external calls.

    line 18
  2. Distinctive:

    When reviewing an unfamiliar contribution and you want a cheap first pass.

    line 20
  3. Distinctive:

    NOT as the only security gate, and NOT as evidence that code is secure (see Pitfalls).

    line 23
  4. Distinctive:

    Read access to the target tree.

    line 29
  5. Very specific:

    Use the powershell tool to scan a directory and review the findings:

    line 33
  6. Very specific:

    Run the default (high-confidence) profile over the target with the powershell tool.

    line 71
  7. Very specific:

    Read each finding's rule id, severity, confidence, CWE, and location.

    line 75
  8. Very specific:

    Write a report with --output (and --format json for machine diffing).

    line 83
  9. Distinctive:

    DO NOT: treat a clean scan as "secure".

    line 95
  10. Distinctive:

    DO NOT: commit real token-shaped fixtures to tests.

    line 96

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

Runs a deterministic heuristic scan over a codebase to flag high-confidence security risks — committed secrets, disabled TLS verification, insecure deserialization, and shell-injection sinks — then optionally layers LLM reasoning (OWASP/STRIDE) on top of the machine findings. This is a lightweight heuristic audit assistant, not a pentest, a SAST replacement, or a proof of security: it is a regex line-scanner that cannot follow data flow and will miss anything outside its rules. Treat its output as triage leads for human review, never as assurance.

When to Use

  • Before opening a PR that touches auth, secrets handling, deserialization, or external calls.
  • As a fast pre-commit sweep for accidentally committed credentials.
  • When reviewing an unfamiliar contribution and you want a cheap first pass.
  • To produce a persisted, idempotent report that diffs cleanly across runs.
  • Paired with derive-security-from-risk (which works forward, producing requirements) — this skill is the reverse, scanning existing code.
  • NOT as the only security gate, and NOT as evidence that code is secure (see Pitfalls).

Prerequisites

  • The powershell Copilot tool to invoke the scanner.
  • Python 3 on PATH (the scan logic is one stdlib core; the .sh/.ps1 are thin wrappers).
  • Read access to the target tree.

How to Run

Use the powershell tool to scan a directory and review the findings:

# High-confidence sweep of the repo (exit 1 = findings at/above --fail-on)
bash skills/security-audit/scripts/security-audit.sh . --suggest

# Broader (noisier) profile, fail only on medium-or-higher
bash skills/security-audit/scripts/security-audit.sh src --profile broad --fail-on medium

# Persist a deterministic JSON report for diffing
bash skills/security-audit/scripts/security-audit.sh . --format json --output audit.json

On Windows, call the parity wrapper security-audit.ps1 with the same arguments. Exit codes: 0 clean (below --fail-on), 1 findings at/above it, 2 usage error.

Quick Reference

RuleFlagsConfidence
SA-001..005private keys, AWS/GitHub/Slack/Stripe/Google tokenshigh
SA-010TLS verification disabled (verify=False)high
SA-011shell sink (shell=True, os.system)high
SA-012insecure deserialization (pickle.loads, yaml.load)high
SA-020..024eval/exec, generic creds, weak hash, DEBUG, CORS *low (broad only)
FlagEffect
--profile broad / --include-low-confidenceenable low-confidence rules
--fail-on low|medium|highexit-1 threshold (default high)
--format md|jsonreport shape (default md)
--output PATHpersist report (excluded from its own scan)
--ignore GLOBextra path to skip (repeatable)
--suggestinclude remediation text

Procedure

Step 1: Scan

Run the default (high-confidence) profile over the target with the powershell tool. Start narrow — the default rules are tuned to minimize false positives, so an exit 1 here usually means a real issue.

Step 2: Triage

Read each finding's rule id, severity, confidence, CWE, and location. Confirm whether it is a true positive. For a genuine non-issue, add an inline # security-audit: ignore SA-0NN reason=... on the matched or preceding line; the report then counts it as suppressed rather than dropping it silently.

Step 3: Reason (LLM tier)

For findings that need judgement, layer OWASP/STRIDE reasoning on the machine output: is the eval argument attacker-reachable, is the disabled TLS check on an internal or external call, what is the blast radius. The scanner finds candidates; you decide exploitability.

Step 4: Persist

Write a report with --output (and --format json for machine diffing). The report carries no timestamps, absolute paths, or environment data, so re-running on unchanged code produces byte-identical output and a noise-free diff.

Step 5: Remediate and Re-audit

Apply fixes guided by the --suggest remediation text. The scanner never edits code — suggestions only, by design. After fixing, re-run and confirm the findings clear (and that no new ones appeared).

Step 6: Extend the Rules

Rules live in skills/security-audit/scripts/security_audit.py as one shared core. Add a rule there with a matching case in tests/test_security_audit.py (generate any secret-shaped fixture at runtime — never commit a token-shaped literal), so the .sh and .ps1 wrappers stay in parity.

Pitfalls

  • DO NOT treat a clean scan as "secure". A pass is the absence of a matched pattern, not a proof of safety — the scanner cannot follow data flow or reason about exploitability.
  • DO NOT commit real token-shaped fixtures to tests; generate them at runtime by concatenation, or push protection and secret scanners will block them.
  • DO NOT auto-apply suggestions blindly. They are remediation hints; review each in context.
  • DO NOT widen the default profile until every eval trips it — false positives train reviewers to ignore the tool. Keep noisy rules behind --profile broad.
  • DO NOT edit only one wrapper. The logic lives in the Python core; the .sh/.ps1 are thin and must stay that way.

Verification

  • The scanner was run on the target and its exit code observed.
  • Each finding was triaged as true/false positive; false positives carry an inline ignore with a reason.
  • A persisted report was produced where one was needed, and re-runs are byte-identical.
  • Remediated findings were confirmed cleared on a re-audit, with no new findings introduced.
  • New or changed rules have matching cases in tests/test_security_audit.py.

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.