Backend: splunk
Query Language: SPL (Search Processing Language)
Installation:
pip install pysigma-backend-splunkConversion Example:
python scripts/sigma_convert.py rule.yml --backend splunkOutput Format:
index=windows EventID=4688 Image="*\\powershell.exe" CommandLine IN ("*-enc*", "*-EncodedCommand*", "*FromBase64String*")
Deployment:
- Save as saved search via Splunk Web UI
- Deploy via REST API:
/servicesNS/-/-/saved/searches - Use Splunk Enterprise Security correlation rules
Field Mappings:
- Sigma
Image→ SplunkImage(Sysmon) - Sigma
CommandLine→ SplunkCommandLine - Sigma
User→ SplunkUser
Backend: elasticsearch or elastic
Query Language: Elasticsearch Query DSL / Lucene
Installation:
pip install pysigma-backend-elasticsearchConversion Example:
python scripts/sigma_convert.py rule.yml --backend elasticsearchOutput Format:
{
"query": {
"bool": {
"must": [
{"wildcard": {"Image": "*\\powershell.exe"}},
{"terms": {"CommandLine": ["-enc", "-EncodedCommand"]}}
]
}
}
}Deployment:
- Elastic Security Detection Rules
- Kibana Saved Searches
- ElastAlert rules
Field Mappings (ECS - Elastic Common Schema):
- Sigma
Image→ ECSprocess.executable - Sigma
CommandLine→ ECSprocess.command_line - Sigma
User→ ECSuser.name
Backend: sentinel or kusto
Query Language: KQL (Kusto Query Language)
Installation:
pip install pysigma-backend-microsoft365defenderConversion Example:
python scripts/sigma_convert.py rule.yml --backend sentinelOutput Format:
SecurityEvent
| where EventID == 4688
| where ProcessName endswith "\\powershell.exe"
| where CommandLine contains "-enc" or CommandLine contains "-EncodedCommand"Deployment:
- Azure Sentinel Analytics Rules
- Deploy via ARM templates
- Use Azure Sentinel API
Field Mappings:
- Sigma
Image→ SentinelProcessName - Sigma
CommandLine→ SentinelCommandLine - Sigma
User→ SentinelAccountName
Backend: qradar or aql
Query Language: AQL (Ariel Query Language)
Installation:
pip install pysigma-backend-qradarConversion Example:
python scripts/sigma_convert.py rule.yml --backend qradarOutput Format:
SELECT * FROM events WHERE LOGSOURCETYPENAME(devicetype) = 'Microsoft Windows Security Event Log'
AND "EventID" = '4688'
AND "Image" ILIKE '%\\powershell.exe'Deployment:
- QRadar Custom Rules
- Deploy via QRadar API
- AQL searches
Backend: eql
Query Language: EQL (Event Query Language)
Conversion Example:
python scripts/sigma_convert.py rule.yml --backend eqlOutput Format:
process where process.name == "powershell.exe" and
(process.command_line like~ "*-enc*" or
process.command_line like~ "*-EncodedCommand*")
Deployment:
- Elastic Security Detection Rules
- EQL searches in Kibana
Backend: chronicle
Query Language: YARA-L
Conversion Example:
python scripts/sigma_convert.py rule.yml --backend chronicleAdditional backends available via pySigma plugins:
- LimaCharlie: EDR platform
- OpenSearch: Fork of Elasticsearch
- LogPoint: SIEM platform
- ArcSight: SIEM platform
- Carbon Black: EDR platform
- CrowdStrike: EDR platform (Falcon)
- SentinelOne: EDR platform
- Datadog: Cloud monitoring platform
- Sumo Logic: Cloud SIEM
pip install pysigma# Splunk
pip install pysigma-backend-splunk
# Elasticsearch
pip install pysigma-backend-elasticsearch
# Microsoft 365 Defender / Sentinel
pip install pysigma-backend-microsoft365defender
# QRadar
pip install pysigma-backend-qradar
# Multiple backends
pip install pysigma-backend-splunk pysigma-backend-elasticsearchSome backends may not support all Sigma field modifiers:
Issue: Backend doesn't support regex field modifier |re
Solution:
- Use alternative field modifiers (
contains,endswith) - Implement custom pipeline transformations
- Post-process in SIEM after conversion
| Feature | Splunk | Elasticsearch | Sentinel | QRadar |
|---|---|---|---|---|
| Regex | ✓ | ✓ | ✓ | ✓ |
| Base64 decode | Limited | Limited | ✓ | Limited |
| CIDR matching | ✓ | ✓ | ✓ | ✓ |
| Wildcards | ✓ | ✓ | ✓ | ✓ |
Not all log sources may be available in all backends:
Check availability:
- Verify log source is ingested in your SIEM
- Confirm field mappings match
- Test converted query with sample data
pySigma supports custom processing pipelines for field transformations:
from sigma.pipelines.sysmon import sysmon_pipeline
from sigma.backends.splunk import SplunkBackend
# Apply Sysmon field mappings before conversion
backend = SplunkBackend()
pipeline = sysmon_pipeline()
converted = backend.convert_rule(rule, pipeline)import requests
# Splunk REST API
url = "https://splunk:8089/servicesNS/nobody/search/saved/searches"
auth = ("admin", "password")
data = {
"name": "Sigma - Suspicious PowerShell",
"search": converted_query,
"description": rule.description,
"cron_schedule": "*/5 * * * *", # Every 5 minutes
"actions": "email",
"action.email.to": "soc@company.com"
}
response = requests.post(url, auth=auth, data=data, verify=False)from elasticsearch import Elasticsearch
es = Elasticsearch(["https://elasticsearch:9200"])
# Deploy as Elasticsearch detection rule
rule_doc = {
"name": rule.title,
"description": rule.description,
"query": converted_query,
"severity": rule.level,
"tags": rule.tags
}
es.index(index="detection-rules", document=rule_doc)# ARM template deployment
az sentinel alert-rule create \
--resource-group myResourceGroup \
--workspace-name mySentinelWorkspace \
--rule-name "Sigma - Suspicious PowerShell" \
--query "$converted_query" \
--severity Medium \
--enabled true# Test in Splunk search
index=windows earliest=-24h
| eval match=case(
Image="*\\powershell.exe" AND (CommandLine LIKE "%enc%" OR CommandLine LIKE "%EncodedCommand%"), "MATCH",
1=1, "NO MATCH"
)
| stats count by match
POST /winlogbeat-*/_search
{
"query": {
"bool": {
"must": [
{"wildcard": {"process.executable": "*\\powershell.exe"}},
{"terms": {"process.command_line": ["-enc", "-EncodedCommand"]}}
]
}
}
}SecurityEvent
| where TimeGenerated > ago(24h)
| where EventID == 4688
| where ProcessName endswith "\\powershell.exe"
| summarize count() by bin(TimeGenerated, 1h)Error: Unsupported field modifier for backend
Solution:
# Use debug mode to see detailed error
python scripts/sigma_convert.py rule.yml --backend splunk --debugCheck references/field-modifiers.md for backend compatibility.
Steps:
- Verify log source is ingested
- Check field name mappings
- Test with known-positive sample
- Validate field value case sensitivity
- Check time range in query
Large, complex queries may impact SIEM performance:
Optimization:
- Add index/sourcetype filters early
- Use specific time ranges
- Optimize field modifiers (prefer exact match over regex)
- Test query performance before deployment