Skip to main content

Tests ![Coverage Badge](https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/alexott/GitHub Gist identifier containing coverage badge JSON expected by shields.io./raw/alexott-databricks-sigma-backend.json) Status

Status: experimental, work in progress:

  • Although cidrmatch is generated, you still need to provide corresponding function as UDF (I'll add example later)
  • Requires more testing

pySigma Databricks Backend

This is the Databricks backend for pySigma. It provides the package sigma.backends.databricks with the DatabricksBackend class. Further, it contains the following processing pipelines in sigma.pipelines.databricks:

  • snake_case: convert column names into snake case format

It supports the following output formats:

  • default: plain Databricks/Apache Spark SQL queries
  • dbsql: Databricks SQL queries with rules metadata (title, status) embedded as comment
  • detection_yaml: Yaml markup for my own detection framework
  • lakewatch: Lakewatch detection rules (kind: Rule YAML), batch by default

The backend supports Sigma rules with unbound keywords (values without field names). These keywords search the raw log line.

Configuration

By default, the backend looks for keywords in a field named raw. You can customize this:

Command Line:

sigma convert -t databricks -O raw_log_field=message rule.yml

Programmatic:

from sigma.backends.databricks import DatabricksBackend

backend = DatabricksBackend(raw_log_field="event_data")

Examples

Simple Keywords (OR logic):

detection:
    keywords:
        - 'EVILSERVICE'
        - 'svchost.exe -n evil'
    condition: keywords

Generates: contains(lower(raw), lower('EVILSERVICE')) OR contains(lower(raw), lower('svchost.exe -n evil'))

Keywords with |all (AND logic):

detection:
    keywords:
        '|all':
            - 'Remove-MailboxExportRequest'
            - ' -Identity '
    condition: keywords

Generates: contains(lower(raw), lower('Remove-MailboxExportRequest')) AND contains(lower(raw), lower(' -Identity '))

Mixed with Field Conditions:

detection:
    selection:
        EventID: 4688
    keywords:
        - 'mimikatz'
    condition: selection and keywords

Generates: EventID = 4688 AND contains(lower(raw), lower('mimikatz'))

Wildcards in Keywords:

detection:
    keywords:
        - '*malware*'      # uses contains()
        - 'cmd.exe*'       # uses startswith()
        - '*.dll'          # uses endswith()
    condition: keywords

Regex Patterns:

detection:
    keywords:
        - '|re': '.*evil(cmd|powershell).*'
    condition: keywords

Generates: raw rlike '.*evil(cmd|powershell).*'

Lakewatch Output

Generate Lakewatch detection rules (kind: Rule YAML) from Sigma rules. Intended to run after the OCSF pipeline, which normalizes fields and injects the OCSF class, so the backend can pick the gold table.

sigma convert -t databricks -f lakewatch -p ocsf rules/ -o detections.yaml

Multiple rules are emitted as separate --- documents in one file.

Options (-O key=value)

Option Default Meaning
table_name (derived) FROM table. If unset, derived from the OCSF class the pipeline injected; error if neither is available.
lookback 25 HOUR Batch window (Spark interval syntax) in the time >= now - INTERVAL <lookback> predicate.
schedule 24h spec.schedule.atLeastEvery (Lakewatch duration).
compute_group automatic spec.schedule.computeGroup.
default_fidelity (from status) Override spec.metadata.fidelity.
default_category Static Signature spec.metadata.category.
sigma convert -t databricks -f lakewatch -p ocsf \
  -O table_name=main.security.authentication -O lookback="1 DAY" -O schedule=12h rule.yml

Sigma metadata maps to Lakewatch as: title→displayName, description→comment/objective, level→severity, status→fidelity, and attack.* tags→mitre. Only batch rules are generated (streaming is future work).

Maintainer

This backend is currently maintained by:

Metadata

Release files for pySigma-backend-databricks 0.1.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pySigma-backend-databricks 0.1.6
File Size Uploaded
pysigma_backend_databricks-0.1.6.tar.gz 29.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pySigma-backend-databricks 0.1.6
File Interpreter ABI Platform
pysigma_backend_databricks-0.1.6-py3-none-any.whl Python 3 none any Details

Total release size: 51.5 kB

Release files / pysigma_backend_databricks-0.1.6.tar.gz

Download URL pysigma_backend_databricks-0.1.6.tar.gz
Size 29.0 kB
Tags Source
SHA-256 checksum
How to use checksums
b87e20a6f1edea20bda461c9050fa3a1d2059a557dfa7cd702fde3327c612cf1
BLAKE2b-256 checksum
How to use checksums
ba87dca995f14fd5eb0444e7691f2ae578a4b02f44bfdfe84d191fed6a91df4c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 8, 2026.

Transparency log

Release files / pysigma_backend_databricks-0.1.6-py3-none-any.whl

Download URL pysigma_backend_databricks-0.1.6-py3-none-any.whl
Size 22.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
036163fa956e5ecd0dac284c8c70d1a484cc3525777969eb63d4bc76bf36ac11
BLAKE2b-256 checksum
How to use checksums
d69e704ad5a65068f27168ba6eb1f3900d499c5a52e4a8561c9081107b76d4b9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 8, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.6 This release

2 release files

0.1.5

2 release files

0.1.4

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page