Skip to main content

Clickhouse backend for sigma

Project description

pySigma Clickhouse Backend

This is the Clickhouse backend for pySigma. It provides the package sigma.backends.clickhouse with the ClickhouseBackend class.

It supports the following output formats for Sigma rules:

  • default: plain clickhouse SQL querie
  • clickdetect: rule format for clickdetect

Thanks

To implement this Clickhouse backend I have leanerd a lot of code, and this is my thanks to most helpful to me.

How To

Converting sigma to clickhouse

from sigma.backends.clickhouse.clickhouse import ClickhouseBackend
from sigma.collection import SigmaCollection

rule = """
title: Run Whoami Showing Privileges
id: 97a80ec7-0e2f-4d05-9ef4-65760e634f6b
status: experimental
description: Detects a whoami.exe executed with the /priv command line flag instructing the tool to show all current user privieleges. This is often used after a privilege escalation attempt. 
references:
    - https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/whoami
author: Florian Roth
date: 2021/05/05
modified: 2022/05/13
tags:
    - attack.privilege_escalation
    - attack.discovery
    - attack.t1033
logsource:
    category: process_creation
    product: windows
detection:
    selection_img:
        - Image|endswith: '\whoami.exe'
        - OriginalFileName: 'whoami.exe'
    selection_cli:
        CommandLine|contains: '/priv'
    condition: all of selection*
falsepositives:
    - Administrative activity (rare lookups on current privileges)
level: high
"""

backend = ClickhouseBackend()
rule_sigma = SigmaCollection.from_yaml(rule)
print(backend.convert(rule_sigma)[0])

Maintainer

Created an maintaned by souzo

Dev

Setup your dev environment

uv sync
source .venv/bin/activate

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

pysigma_backend_clickhouse-1.1.0.tar.gz (44.1 kB view details)

Uploaded Source

Built Distribution

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

pysigma_backend_clickhouse-1.1.0-py3-none-any.whl (11.0 kB view details)

Uploaded Python 3

File details

Details for the file pysigma_backend_clickhouse-1.1.0.tar.gz.

File metadata

  • Download URL: pysigma_backend_clickhouse-1.1.0.tar.gz
  • Upload date:
  • Size: 44.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.31 {"installer":{"name":"uv","version":"0.11.31","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for pysigma_backend_clickhouse-1.1.0.tar.gz
Algorithm Hash digest
SHA256 1bb7f55c1a19823f31df06e9d74b61529607a2a58a7e70725f8eb4cf53b24121
MD5 233a808a8bdc97ad456e3d1b4d374821
BLAKE2b-256 fca38ec68027bc45d44950f15fc4ccf5c430266160da24f751bb72fd2c7b1007

See more details on using hashes here.

File details

Details for the file pysigma_backend_clickhouse-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: pysigma_backend_clickhouse-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 11.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.31 {"installer":{"name":"uv","version":"0.11.31","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for pysigma_backend_clickhouse-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bc4f89d145738e4a18d2cff63812ff23dbb91da27e3ab7688a7e903b7888c065
MD5 1f1f19f3d689775e02cbc0efdf8601f2
BLAKE2b-256 2d2fcb48a1c9d6d6260a1cf863baaf19451e27ab2cabbc1850a76106d692dd29

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