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

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

Available conversion backends and processing pipelines can be listed with sigma list.

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-0.4.7.tar.gz (5.9 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-0.4.7-py3-none-any.whl (7.0 kB view details)

Uploaded Python 3

File details

Details for the file sigma-cli-0.4.7.tar.gz.

File metadata

  • Download URL: sigma-cli-0.4.7.tar.gz
  • Upload date:
  • Size: 5.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.0 CPython/3.8.13 Linux/5.15.0-1014-azure

File hashes

Hashes for sigma-cli-0.4.7.tar.gz
Algorithm Hash digest
SHA256 246e45bd91a7906c3eac90e92c1fc546ccf5a7ce6388f8dcc452c1b8bf265a92
MD5 71e7f59b4937e07ffb7cab8efd5ab784
BLAKE2b-256 94eb1efd96a321a1beb97c43425c3f394efca401843e20f6a43d15f38a48e28a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: sigma_cli-0.4.7-py3-none-any.whl
  • Upload date:
  • Size: 7.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.0 CPython/3.8.13 Linux/5.15.0-1014-azure

File hashes

Hashes for sigma_cli-0.4.7-py3-none-any.whl
Algorithm Hash digest
SHA256 40001872dcc40b78a1493ba6da256c8e31a2d71357901b22ef73b83bf0c97e8e
MD5 d30512a4dfeac168cf734c4854cc1b9b
BLAKE2b-256 29e650bc8b0e519429d0efb33a4da1c07c10fba23e16ec405640867fd7987729

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