Skip to main content

Sigma rule processing and conversion tools

Project description

pySigma

Tests Coverage Badge Status

pySigma is a python library that parses and converts Sigma rules into queries. It is a replacement for the legacy Sigma toolchain (sigmac) with a much cleaner design and is almost fully tested. Backends for support of conversion into query languages and processing pipelines for transforming rule for log data models are separated into dedicated projects to keep pySigma itself slim and vendor-agnostic. See the Related Projects section below to get an overview.

Getting Started

To start using pySigma, you need Python 3.10 or later. Install it using your python package manager of choice. Examples:

pip install pysigma
pipenv install pysigma
poetry add pysigma

Documentation with some usage examples can be found here.

Create Your Own Backend for pySigma

The creation of a backend has become much easier with pySigma. We recommend using the "Cookie Cutter Template" and reviewing the existing backends listed in the "Related Projects" section of this README.

pySigma Cookie Cutter Template

Features

pySigma brings a number of additional features compared to the all in one sigmac, as well as some changes.

sigma-cli is the equivalent of sigmac for command-line conversion

Modifier

use sigma list modifiers

Backends

use sigma plugin list --plugin-type backend

Overview

Conversion Overview

Conversion Graph

Pipelines

Conversion Graph

More details are described in the documentation.

Testing

pySigma uses pytest as testing framework. Simply run pytest to run all tests. Run pytest --cov=sigma to get a coverage report.

Building

To build your own package run poetry build.

Linting

To lint the code run poetry run black. To check for linting errors run poetry run black --check.

This project also uses pre-commit, which is installed by poetry as part of dev dependencies. To install the git hooks run poetry run pre-commit install after cloning the repository and installing the dependencies.

Contributing

Pull requests are welcome. Please feel free to lodge any issues/PRs as discussion points.

This blog post by Micah Babinski explains the process from a developer's perspective.

Maintainers

The project is currently maintained by:

Related Projects

pySigma isn't a monolithic library attempting to support everything but the core. Support for target query languages and log data models is provided by additional packages that extend pySigma:

All packages can also be installed from PyPI if not mentioned otherwise by the Python package manager of your choice.

License

GNU Lesser General Public License v2.1. For details, please see the full license file located here.

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pysigma-1.3.3.tar.gz (132.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pysigma-1.3.3-py3-none-any.whl (161.6 kB view details)

Uploaded Python 3

File details

Details for the file pysigma-1.3.3.tar.gz.

File metadata

  • Download URL: pysigma-1.3.3.tar.gz
  • Upload date:
  • Size: 132.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pysigma-1.3.3.tar.gz
Algorithm Hash digest
SHA256 5c66b35a0a72ffcfc9e4e4d7519e10d43a0eec154baa2d35fe12d8a6ff48072f
MD5 4011f7b30d1b4735e4026f857215f4af
BLAKE2b-256 de8bac4ce192992abffce6334d163c57ef6b0d88a087507caee08c1995274f10

See more details on using hashes here.

Provenance

The following attestation bundles were made for pysigma-1.3.3.tar.gz:

Publisher: release.yml on SigmaHQ/pySigma

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pysigma-1.3.3-py3-none-any.whl.

File metadata

  • Download URL: pysigma-1.3.3-py3-none-any.whl
  • Upload date:
  • Size: 161.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pysigma-1.3.3-py3-none-any.whl
Algorithm Hash digest
SHA256 3771aeaf4bc65dc372a754d67607964d8beb0431d438cc76ae380b89d91f261b
MD5 6867e940a2190a7d37f82bed6f4424ea
BLAKE2b-256 8716354c7d1f30d91eae36b0e71841fdb362e86fbb7732a07052dc67d4a9e975

See more details on using hashes here.

Provenance

The following attestation bundles were made for pysigma-1.3.3-py3-none-any.whl:

Publisher: release.yml on SigmaHQ/pySigma

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page