meltedinhex/analyst-ai-pack / skills/writing-suricata-and-snort-rules
writing-suricata-and-snort-rules
VerifiedWrites and validates Suricata/Snort IDS rules for network-based malware detection, covering rule anatomy, content/pcre matching, flow and threshold options, and common mistakes that cause false positives or no matches. Activates for requests to write a Suricata rule, create Snort signatures, or build network detection rules from IOCs or C2 patterns.
| File | Kind | Size |
|---|---|---|
| LICENSE | other | 340 B |
| SKILL.md | skill md | 2.8 KB |
| references/api-reference.md | markdown | 1.1 KB |
| scripts/analyst.py | script | 2.8 KB |
references/api-reference.md
View on GitHub# API Reference: Writing Suricata and Snort Rules
## Overview
`scripts/analyst.py` lints Suricata/Snort rule files for required metadata (`msg`, `sid`, `rev`,
`classtype`), balanced quotes/parentheses, duplicate SIDs, and short free-floating `content`
matches that cause false positives. It parses rule text only and does not load any IDS engine.
## Dependencies
| Package | Version | Purpose |
|---------|---------|---------|
| (stdlib) | — | regex, JSON, file IO |
## Core functions
### `lint(path)`
Returns rules checked, issue count, and per-line problems. Exit code is non-zero when issues exist
(useful in CI).
## Checks
- Presence of `msg`, `sid`, `rev`, `classtype`.
- Unique SIDs across the file.
- Balanced quotes and parentheses.
- `content` ≤ 3 chars must be anchored (`http.uri`, `flow:`, `offset`, `depth`, etc.).
## Usage
```bash
python scripts/analyst.py lint rules.rules
```
## Sources
- Suricata rules documentation — https://docs.suricata.io/en/latest/rules/intro.html
- Snort 3 rule writing guide — https://docs.snort.org/
- Rule anatomy and SID/anchoring best practices from official IDS documentation
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack." | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |