Skip to main content

pySigma Sumo Logic Cloud SIEM backend

Project description

pySigma Sumo Logic Backend

Status PyPI Python License

Overview

A pySigma backend that converts Sigma detection rules into Sumo Logic Cloud SIEM rule JSON, ready for import via the CSE API. Includes field mappings for 70+ log sources, automatic entity selector assignment, MITRE ATT&CK tag mapping, and confidence scoring.

Quick Start

pip install sigma-cli pysigma-backend-sumologic
sigma convert -t sumologic_cse_rule -p sumologic_cse rule.yml

Supported Log Sources

Full Field Mapping

These log sources have Sigma fields automatically renamed to CSE normalized schema fields:

Log Source Key Field Mappings
Process creation CommandLine→commandLine, Image→baseImage, ParentImage→parentBaseImage, User→user_username
Network connection SourceIp→srcDevice_ip, DestinationIp→dstDevice_ip, SourcePort→srcPort, DestinationPort→dstPort
DNS query QueryName→dns_query, QueryResults→dns_reply
File events TargetFilename→file_path, md5→file_hash_md5, SHA256→file_hash_sha256
Registry events TargetObject→changeTarget
Image load ImageLoaded→baseImage
Proxy / web c-uri→http_url, cs-method→http_method, sc-status→http_response_statusCode, cs-bytes→bytesOut, sc-bytes→bytesIn
Firewall src_ip→srcDevice_ip, dst_ip→dstDevice_ip, action→action
Windows authentication LogonType→logonType, TargetUserName→user_username, IpAddress→srcDevice_ip
Windows Sysmon Inherits process/network/file/registry mappings + EventID→metadata_deviceEventId
Windows PowerShell ScriptBlockText→commandLine
AWS CloudTrail eventName→action, sourceIPAddress→srcDevice_ip, userIdentity.arn→user_username
Azure Activity Logs operationName→action, callerIpAddress→srcDevice_ip
Office 365 Operation→action, ClientIP→srcDevice_ip

Metadata-Only (Vendor/Product Tagging)

These log sources get metadata_vendor and metadata_product injected into the query. Fields pass through as fields['FieldName'] in CSE syntax:

  • Windows (30+ services): powershell-classic, taskscheduler, WMI, DNS-server, windefend, driver-framework, etc.
  • AWS: S3, GuardDuty, VPC, WAF, Route53, Config, EKS, ELB, CloudWatch, SecurityHub, etc.
  • Azure: Sign-in Logs, Audit Logs, Firewall, Risk Detection, PIM, etc.
  • GCP: Audit, GCE, GCS, BigQuery, Security Center
  • Google Workspace: Admin, Login
  • Cisco: ASA, Firepower, ISE, Umbrella, Meraki, Duo, AnyConnect, etc.
  • Palo Alto Networks: Threat, Traffic, Cortex, GlobalProtect, Prisma Cloud, etc.
  • Fortinet: FortiGate, FortiClient
  • Other: Okta, OneLogin, GitHub, Kubernetes, Check Point, Zeek, Exchange

Output Format

Produces complete CSE rule JSON ready for the Rules API:

{
  "rules": [
    {
      "name": "Suspicious PowerShell Execution",
      "expression": "commandLine matches /.*powershell -enc.*/",
      "entity_selectors": [
        {"entity_type": "_hostname", "expression": "device_hostname"},
        {"entity_type": "_username", "expression": "user_username"},
        {"entity_type": "_process", "expression": "baseImage"}
      ],
      "score_mapping": {"default": 6, "type": "constant"},
      "tags": ["_mitreAttackTactic:TA0002", "_mitreAttackTechnique:T1059"],
      "category": "Execution",
      "enabled": true,
      "is_prototype": true,
      "mapping_confidence": {"overall_score": 0.691, "...": "..."}
    }
  ]
}

How It Works

Field Mapping — The sumologic_cse pipeline renames Sigma standard fields to CSE normalized schema fields based on the rule's log source category.

Confidence Scoring — Each field mapping receives a confidence score (0–1). If the lowest score falls below the threshold (default: 0.25), conversion is blocked with a message showing exactly which fields failed and what threshold to use.

Entity Selectors — Automatically assigned based on log source category:

  • Process rules → hostname + username + process
  • Network/firewall rules → hostname + IP
  • DNS rules → hostname + domain
  • Authentication rules → hostname + IP + username
  • File rules → hostname + file path

MITRE ATT&CK — Tags from Sigma rules are mapped to CSE format (attack.execution_mitreAttackTactic:TA0002).

Severity — Sigma levels map to CSE scores: critical=8, high=6, medium=3, low=1, informational=1.

Unmapped Field Handling

Scenario Behavior Confidence
Field mapped by pipeline Renamed to CSE schema field 0.85–1.0
Vendor-specific rule, unmapped field Passes through as fields['FieldName'] 0.8
Generic rule (no product), unmapped field Blocked with warning 0.0
Data field with Key=Value pattern Auto-converted to EventData.Key Normal
Data field with arbitrary string Blocked with helpful error N/A

Installation

From PyPI

pip install pysigma-backend-sumologic

From Source

git clone https://github.com/SumoLogic/pySigma-backend-sumologic
cd pySigma-backend-sumologic
pip install .

Usage

With sigma-cli

# Convert to CSE rule JSON
sigma convert -t sumologic_cse_rule -p sumologic_cse rule.yml

# Convert a directory of rules
sigma convert -t sumologic_cse_rule -p sumologic_cse ./rules/windows/

# Lower confidence threshold for more permissive conversion
sigma convert -t sumologic_cse_rule -p sumologic_cse -O min_confidence=0.0 rule.yml

As Python Library

from sigma.collection import SigmaCollection
from sigma.backends.sumologic import SumoLogicCSERuleBackend
from sigma.pipelines.sumologic import sumologic_cse_pipeline

pipeline = sumologic_cse_pipeline()
backend = SumoLogicCSERuleBackend(processing_pipeline=pipeline)

rule = SigmaCollection.from_yaml(open('rule.yml').read())
result = backend.convert(rule)
print(result[0])  # CSE rule JSON string

Configuration Options

Pass via -O key=value with sigma-cli or as constructor kwargs in Python:

Option Default Description
min_confidence 0.25 Minimum confidence score to allow conversion (0.0 disables threshold)
include_confidence_metadata true Include mapping_confidence object in output
fail_on_unmapped_logsource false Error if rule's log source has no vendor/product mapping

Limitations

  • Correlation rules — Not supported (Sigma correlation features)
  • Data field arbitrary stringsData|contains: 'Net.WebClient' cannot be converted (~12 Sigma rules affected). Structured patterns like Data|contains: 'EngineVersion=2.' are handled automatically.
  • Keywords field — Not supported (CSE requires structured field-based queries)
  • Complex regex — Limited support for advanced regex modifiers

Development

# Install dev dependencies
pip install -e ".[dev]"

# Run tests
pytest

# Run with coverage
pytest --cov=sigma --cov-report=term

Resources

License

LGPL-3.0 — see LICENSE.

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_sumologic-0.2.3.tar.gz (68.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_backend_sumologic-0.2.3-py3-none-any.whl (72.2 kB view details)

Uploaded Python 3

File details

Details for the file pysigma_backend_sumologic-0.2.3.tar.gz.

File metadata

File hashes

Hashes for pysigma_backend_sumologic-0.2.3.tar.gz
Algorithm Hash digest
SHA256 e428da78ddc5cd8ed00cd1ba4c337ee542b81bb50cb0b4f68095cda2ed811ca2
MD5 19fb6b03d66d6cf9ec3b3700e9d1e489
BLAKE2b-256 e1d85d22a0979b8e854aeaa10db1104d41d7b7a08ea7f1ad69076a6f188783cb

See more details on using hashes here.

Provenance

The following attestation bundles were made for pysigma_backend_sumologic-0.2.3.tar.gz:

Publisher: release.yml on SumoLogic/pySigma-backend-sumologic

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

File details

Details for the file pysigma_backend_sumologic-0.2.3-py3-none-any.whl.

File metadata

File hashes

Hashes for pysigma_backend_sumologic-0.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 f04a6c16e4174310ed6e1d09628631e6039c5bffba46adb23d27924b950aae22
MD5 06970697e7c991f528c1ce31f1debf59
BLAKE2b-256 33d356030b13974110cfca0dc425acc35d90b99ed464e2635067a44638fc9ab3

See more details on using hashes here.

Provenance

The following attestation bundles were made for pysigma_backend_sumologic-0.2.3-py3-none-any.whl:

Publisher: release.yml on SumoLogic/pySigma-backend-sumologic

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