Skip to content

meltedinhex/analyst-ai-pack / skills/writing-sigma-detection-rules

writing-sigma-detection-rules

Verified

Converts hunt findings into portable Sigma detection rules: choosing the right logsource, expressing robust selection/filter logic, setting level and ATT&CK tags, and validating before converting to a SIEM query. Activates for requests to write a Sigma rule, convert a hunt to a detection, or create portable SIEM detection logic.

FileKindSize
LICENSEother340 B
SKILL.mdskill md3.1 KB
references/api-reference.mdmarkdown1.2 KB
scripts/analyst.pyscript2.0 KB

scripts/analyst.py

View on GitHub
#!/usr/bin/env python3
"""Scaffold a valid Sigma detection rule skeleton.

Emits a Sigma YAML rule with a pinned logsource, a selection/filter pattern, ATT&CK tags, level,
and a falsepositives list for the analyst to complete. It emits text only; it does not validate
or convert (use sigma-cli for that).
"""
from __future__ import annotations

import argparse
import datetime as _dt
import sys


def scaffold(title: str, category: str, technique: str, level: str, author: str) -> str:
    today = _dt.date.today().isoformat()
    tag = technique.lower().replace("t", "attack.t", 1) if technique.startswith("T") else technique
    return f"""title: {title}
id: <generate-a-uuid>
status: experimental
description: Detects {title.lower()} (drafted from a hunt finding).
author: {author}
date: {today}
references:
    - <analysis report or hunt link>
logsource:
    product: windows
    category: {category}
detection:
    selection:
        Image|endswith: '\\powershell.exe'
        CommandLine|contains:
            - '-enc'
            - 'FromBase64String'
    filter_known_good:
        ParentImage|endswith:
            - '\\trusted_admin_tool.exe'
    condition: selection and not filter_known_good
falsepositives:
    - Administrative scripts that legitimately use encoded commands
level: {level}
tags:
    - {tag}
"""


def main(argv: list[str] | None = None) -> int:
    parser = argparse.ArgumentParser(description="Scaffold a Sigma rule")
    sub = parser.add_subparsers(dest="cmd", required=True)
    p = sub.add_parser("scaffold")
    p.add_argument("--title", required=True)
    p.add_argument("--category", default="process_creation")
    p.add_argument("--technique", default="T1059.001")
    p.add_argument("--level", default="high",
                   choices=["informational", "low", "medium", "high", "critical"])
    p.add_argument("--author", default="analyst-ai-pack")
    args = parser.parse_args(argv)
    print(scaffold(args.title, args.category, args.technique, args.level, args.author))
    return 0


if __name__ == "__main__":
    sys.exit(main())
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: 198kUpdated Claude CodeCodexVerifiedInstall
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: 194kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report.Stars: 194kUpdated Claude CodeCodexVerifiedInstall
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: 194kUpdated Claude CodeCodexVerifiedInstall