Author a Python detection rule using Panther's pypanther framework and deploy it as versioned detection-as-code

domain: docs.panther.com · 5 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. Define a rule as a single Python class using pypanther, Panther's current Python-native detection framework (which superseded its earlier YAML-plus-Python rule format), specifying the applicable log type(s) and a rule() method returning true or false.
  2. Set severity, tags, and other metadata as class-level attributes, and extend or override built-in base rules via inheritance rather than duplicating logic.
  3. Add unit tests with sample log events, including both positive and negative cases, alongside the rule so CI validates detection logic before deployment.
  4. Deploy the rule set to the Panther backend through the pypanther CLI/CI pipeline, keeping the rules repository in git so every detection change goes through pull-request review and is revertible.
  5. Apply the same detection-as-code discipline — rules in git, PR review, unit tests, CI-driven deploy — on any other log-pipeline platform in this space, adapting to that platform's specific rule authoring format.

Known gotchas

Related routes

Publish a Python package to PyPI with a provenance attestation using Trusted Publishing (OIDC) from a GitHub Actions workflow
docs.pypi.org · 5 steps · unrated

Give your agent this knowledge — and 15,500+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans