semgrep-rule-creator (trailofbits)

Authors a custom Semgrep static-analysis rule for one specific bug or vulnerability pattern — building the match (or a taint-mode source-to-sink data flow), then the paired vulnerable-and-safe test cases that keep false positives in check. Its output is a reusable detection rule, not a finished audit: it does not run existing Semgrep rulesets over your repo, triage the findings a scan produces, or review a diff by hand.

A situation it fits

At a security audit you discover your app mishandles a proprietary protocol in a way command-line scanners default ignore. You need to codify a narrowly scoped gatekeeper with paired illustrations to avoid noisy CI runs.
semgrep-rule-creator (trailofbits). The skill is designed for narrowing the focus to exactly one novel weakness in code, teaching how to build a pair of contrasting code snippets and package them into a portable, reusable gatekeeper that plugs into CI. That fits here because the bug is proprietary and off-the-shelf checkers are blind to it, so you need a self-contained, narrowly scoped artifact with paired positive and negative illustrations rather than a supply-chain sweep, a generic error-message rewrite, or an identity breach lookup.

Skills it gets confused with

These share a family with semgrep-rule-creator (trailofbits), which is another way of saying they are the ones you might reach for by mistake.

Knowing what semgrep-rule-creator (trailofbits) does is the easy half. Telling it apart from the others under time pressure is the game.

Today's session

semgrep-rule-creator (trailofbits) is part of trailofbits/skills. Licence: CC-BY-SA-4.0. The description above was written for this game, not taken from the skill.

← All skills