Skip to main content

Sigma Command Line Interface (conversion, check etc.) based on pySigma

Project description

Sigma Command Line Interface

Tests Coverage Badge Status

This is the Sigma command line interface using the pySigma library to manage, list and convert Sigma rules into query languages.

Getting Started

Installation

The easiest way to install the Sigma CLI is via pipx or pip. For this purpose run one of the following:

python -m pipx install sigma-cli
python -m pip install sigma-cli

on macOS use

python3 -m pip install sigma-cli

Another way is to run this from source in a virtual environment managed by Poetry:

git clone https://github.com/SigmaHQ/sigma-cli.git
cd sigma-cli
poetry install
poetry shell

Usage

The CLI is available as sigma command. A typical invocation is:

sigma convert -t <backend> -p <processing pipeline 1> -p <processing pipeline 2> [...] <directory or file>

E.g. to convert process creation Sigma rules from a directory into Splunk queries for Sysmon logs run:

sigma convert -t splunk -p sysmon sigma/rules/windows/process_creation

Required backends must be installed using the following command prior to conducting conversions.

To list all available plugins run the following command:

sigma plugin list

Install a plugin of your choice with:

sigma plugin install <backend>

E.g. to install the splunk backend run:

sigma plugin install splunk

Available conversion backends and processing pipelines can be listed with sigma list. Use -O or --backend-option for passing options to the backend as key=value pairs (-O testparam=123) . This backend option parameter can be used multiple times (-O first=123 -O second=456).

Backends can support different output formats, e.g. plain queries and a file that can be imported into the target system. These formats can be listed with sigma list formats <backend> and specified for conversion with the -f option.

In addition, an output file can be specified with -o.

Example for output formats and files:

sigma convert -t splunk -f savedsearches -p sysmon -o savedsearches.conf sigma/rules/windows/process_creation

Outputs a Splunk savedsearches.conf containing the converted searches.

Integration of Backends and Pipelines

Backends and pipelines can be integrated by adding the corresponding packages as dependency with:

poetry add <package name>

A backend has to be added to the backends dict in sigma/cli/backends.py by creation of a Backend named tuple with the following parameters:

  • The backend class.
  • A display name shown to the user in the targets list (sigma list targets).
  • A dict that maps output format names (used in -f parameter) to descriptions of the formats that are shown in the format list (sigma list formats <backend>). The formats must be supported by the backend!

The dict key is the name used in the -t parameter.

A processing pipeline is defined in the pipelines variable dict in sigma/cli/pipelines.py. The variable contains a ProcessingPipelineResolver that is instantiated with a dict that maps identifiers that can be used in the -p parameter to functions that return ProcessingPipeline objects. The descriptive text shown in the pipeline list (sigma list pipelines) is provided from the name attribute of the ProcessingPipeline object.

Maintainers

The project is currently maintained by:

Project details


Download files

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

Source Distribution

sigma_cli-3.0.1.tar.gz (21.1 kB view details)

Uploaded Source

Built Distribution

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

sigma_cli-3.0.1-py3-none-any.whl (25.3 kB view details)

Uploaded Python 3

File details

Details for the file sigma_cli-3.0.1.tar.gz.

File metadata

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

File hashes

Hashes for sigma_cli-3.0.1.tar.gz
Algorithm Hash digest
SHA256 0e3a10170c6c398e2a156a43af1f137c0e1807c4f02a1773d128a662e309ec3c
MD5 abf19a305f7233b4dae84aa4ca521924
BLAKE2b-256 00223d58736a7e5f7ae08dd4694ec21b21ce42900df5ffe787b1ca995af3b85c

See more details on using hashes here.

Provenance

The following attestation bundles were made for sigma_cli-3.0.1.tar.gz:

Publisher: release.yml on SigmaHQ/sigma-cli

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

File details

Details for the file sigma_cli-3.0.1-py3-none-any.whl.

File metadata

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

File hashes

Hashes for sigma_cli-3.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 784eca227885ae6bc4288fa16d0f40699c8f35cd6e505f8d45739d938a7f9813
MD5 dcc8054bf46a72ad1f67480b64080012
BLAKE2b-256 598089be7c9acf3ef3b919052a5307636511a49ba4625370af32ae19908b4735

See more details on using hashes here.

Provenance

The following attestation bundles were made for sigma_cli-3.0.1-py3-none-any.whl:

Publisher: release.yml on SigmaHQ/sigma-cli

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