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, 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.

Features

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

Modifier comparison between pySigma and sigmac

Modifier Use sigmac legacy
contains the value is matched anywhere in the field (strings and regular expressions) X
startswith The value is expected at the beginning of the field's content (strings and regular expressions) X
endswith The value is expected at the end of the field's content (strings and regular expressions) X
base64 The value is encoded with Base64 X
base64offset If a value might appear somewhere in a base64-encoded value the representation might change depending on the position in the overall value X
wide transforms value to UTF16-LE encoding X
re value is handled as regular expression by backends X
cidr value is handled as a IP CIDR by backends
all This modifier changes OR logic to AND X
lt Field is less than the value
lte Field is less or egal than the value
gt Field is Greater than the value
gte Field is Greater or egal than the value
expand Modifier for expansion of placeholders in values. It replaces placeholder strings (%something%)

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.

Contributing

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

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-0.3.2.tar.gz (48.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-0.3.2-py3-none-any.whl (54.8 kB view details)

Uploaded Python 3

File details

Details for the file pySigma-0.3.2.tar.gz.

File metadata

  • Download URL: pySigma-0.3.2.tar.gz
  • Upload date:
  • Size: 48.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.0 CPython/3.8.12 Linux/5.11.0-1028-azure

File hashes

Hashes for pySigma-0.3.2.tar.gz
Algorithm Hash digest
SHA256 e349f31450f67364645fe96bf78b5ea42b19c2d25616ffc95db1006bb95acdbd
MD5 ea107e0d64691cfa18c6ec0ea142602e
BLAKE2b-256 df057540122775269849f33331fbea43f577760d41560280e03e1f5a637fc836

See more details on using hashes here.

File details

Details for the file pySigma-0.3.2-py3-none-any.whl.

File metadata

  • Download URL: pySigma-0.3.2-py3-none-any.whl
  • Upload date:
  • Size: 54.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.0 CPython/3.8.12 Linux/5.11.0-1028-azure

File hashes

Hashes for pySigma-0.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 cdb251b2effe46399d274592f9b48bf0f9171ec26ad8e8ef3c23db2846eb25a4
MD5 2bd84f1f46cdc056de24ef00bd5b6b66
BLAKE2b-256 39feb8bd2161a37cfbbd1dc9b2069b8c7a9893da5232f407c5b75904722bfcfd

See more details on using hashes here.

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