agentleFS
kaandgnshkaandgnsh/Claude-Blue/skills/appsec/sast-triage/SKILL.md

sast-triage

Skill0 starsChanged 13 days agoMITView on GitHub

Run and triage static application security testing (Semgrep, CodeQL, SonarQube, Bandit, gosec, Brakeman) — reachability of sources to sinks, framework-provided protections, true/false positive decisions, suppression hygiene and custom rules. Use when a SAST scan produces findings to review, when tuning SAST noise in CI, or writing a custom rule for a recurring bug class.

The file

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Does data reach the sink unsanitized?: Follow the dataflow path the tool reports.

    line 28
  2. Distinctive:

    Never suppress a whole rule globally because of one FP.

    line 35

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “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

SAST Triage

Running scanners

semgrep scan --config p/default --config p/owasp-top-ten --sarif -o semgrep.sarif .
semgrep scan --config p/secrets .                       # secrets ruleset
codeql database create db --language=python --source-root .
codeql database analyze db codeql/python-queries:codeql-suites/python-security-extended.qls --format=sarif-latest --output=codeql.sarif
bandit -r src/ -f json -o bandit.json                    # Python
gosec -fmt sarif -out gosec.sarif ./...                  # Go

Upload SARIF to the code host (GitHub code scanning, GitLab) so findings appear inline in PRs.

Triage decision per finding

  1. Is the source attacker-controlled? (HTTP input, file upload, message queue) — or constant/config/admin-only?
  2. Does data reach the sink unsanitized? Follow the dataflow path the tool reports; check for validation, parameterization, framework auto-escaping (Django/Jinja2 autoescape, React JSX), allow-lists.
  3. Is the code reachable in production? (dead code, tests, scripts, feature-flagged off).
  4. Decide: TP (ticket with fix), FP (suppress with reason), won't-fix (risk-accepted with approver).

Suppression hygiene

  • Inline suppressions with a reason: # nosemgrep: python.lang.security.audit.subprocess-shell-true -- command is constant.
  • Never suppress a whole rule globally because of one FP; tune the rule (path exclusions for tests, pattern-not for known safe wrappers).
  • Review suppressions periodically.

Custom Semgrep rule example

rules:
  - id: corp-missing-ownership-check
    languages: [python]
    severity: WARNING
    message: Order fetched by ID without owner filter — possible IDOR (CWE-639)
    patterns:
      - pattern: Order.objects.get(id=$ID)
      - pattern-not-inside: |
          Order.objects.get(id=$ID, owner=$USER)

Metrics

TP rate per rule (drop/tune rules < 20% TP), time-to-fix by severity, new vs. existing findings (gate only on new findings in PRs to avoid blocking on legacy debt).

Related skills

secure-code-review, sca-dependency-risk, release-gate, github-actions-hardening

References

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.