9 min read Updated May 9, 2026

Sigma Rules

Tamandua EDR uses Sigma rules for behavioral detection based on log and event analysis. Sigma is a generic signature format for log events, enabling cross-platform detection that works across Windows, Linux, and macOS endpoints.

Built-in Rule Sets

Tamandua ships with 100+ Sigma rules organized by MITRE ATT&CK tactic:

CategoryDescriptionRulesKey Techniques
execution/Suspicious process execution20+T1059, T1047, T1218
persistence/Persistence mechanisms25+T1547, T1053, T1543
credential_access/Credential theft15+T1003, T1555, T1558
lateral_movement/Network lateral movement15+T1021, T1550, T1570
defense_evasion/Evasion techniques20+T1070, T1562, T1036
discovery/System/network discovery10+T1087, T1082, T1016
collection/Data collection5+T1560, T1113, T1115
exfiltration/Data exfiltration5+T1048, T1567
command_and_control/C2 communication10+T1071, T1572, T1090
impact/System impact10+T1486, T1485, T1490
ai_runtime/AI/LLM threat detection5+Prompt injection, MCP abuse
serverless/Cloud/serverless threats5+Crypto mining, reverse shells

Example Rules

PowerShell Download Cradle

title: Suspicious PowerShell Download Cradle
id: a0c3d5e2-6789-0abc-def1-234567890123
status: experimental
description: Detects PowerShell download and execute patterns
author: Tamandua Security Team
date: 2024/01/15
references:
    - https://attack.mitre.org/techniques/T1059/001/
logsource:
    category: process_creation
    product: windows
detection:
    selection_powershell:
        Image|endswith:
            - '\powershell.exe'
            - '\pwsh.exe'
    selection_download:
        CommandLine|contains:
            - 'IEX'
            - 'Invoke-Expression'
            - 'DownloadString'
            - 'DownloadFile'
            - 'Net.WebClient'
            - 'Invoke-WebRequest'
            - 'Invoke-RestMethod'
            - 'Start-BitsTransfer'
    selection_flags:
        CommandLine|contains:
            - '-enc'
            - '-encodedcommand'
            - '-nop'
            - '-noprofile'
            - '-w hidden'
            - '-windowstyle hidden'
            - '-exec bypass'
            - '-executionpolicy bypass'
    condition: selection_powershell and (selection_download or selection_flags)
falsepositives:
    - Legitimate administrative scripts
level: high
tags:
    - attack.execution
    - attack.t1059.001

LSASS Memory Access

title: LSASS Memory Access via Process
id: b1d4e6f3-789a-1bcd-ef01-345678901234
status: stable
description: Detects suspicious access to LSASS memory
author: Tamandua Security Team
logsource:
    category: process_access
    product: windows
detection:
    selection:
        TargetImage|endswith: '\lsass.exe'
        GrantedAccess|contains:
            - '0x1010'  # PROCESS_QUERY_LIMITED_INFORMATION + PROCESS_VM_READ
            - '0x1410'  # PROCESS_QUERY_INFORMATION + PROCESS_VM_READ
            - '0x1fffff'  # PROCESS_ALL_ACCESS
    filter_legitimate:
        SourceImage|endswith:
            - '\wmiprvse.exe'
            - '\taskmgr.exe'
            - '\procexp64.exe'
            - '\MsMpEng.exe'
    condition: selection and not filter_legitimate
level: critical
tags:
    - attack.credential_access
    - attack.t1003.001

Scheduled Task Persistence

title: Scheduled Task Creation for Persistence
id: c2e5f7a4-89ab-2cde-f012-456789012345
status: stable
description: Detects creation of scheduled tasks commonly used for persistence
author: Tamandua Security Team
logsource:
    category: process_creation
    product: windows
detection:
    selection_schtasks:
        Image|endswith: '\schtasks.exe'
        CommandLine|contains: '/create'
    selection_suspicious:
        CommandLine|contains:
            - '/sc onlogon'
            - '/sc onstart'
            - '/sc onidle'
            - 'powershell'
            - 'cmd.exe /c'
            - 'mshta'
            - 'wscript'
            - 'cscript'
    condition: selection_schtasks and selection_suspicious
level: high
tags:
    - attack.persistence
    - attack.t1053.005

Supported Modifiers

Tamandua's Sigma parser supports 15+ field modifiers:

String Modifiers

ModifierDescriptionExample
containsSubstring matchCommandLine\|contains: 'cmd'
startswithPrefix matchImage\|startswith: 'C:\Temp'
endswithSuffix matchImage\|endswith: '.exe'
reRegular expressionCommandLine\|re: 'pass.*word'
cidrIP CIDR matchDestinationIp\|cidr: '10.0.0.0/8'

Encoding Modifiers

ModifierDescriptionExample
base64Base64 encodedCommandLine\|base64contains: 'eval'
base64offsetBase64 with offsetCommandLine\|base64offset\|contains: 'cmd'
wideUTF-16 encodingCommandLine\|wide\|contains: 'password'
utf16leUTF-16LE encodingData\|utf16le\|contains: 'secret'
utf16beUTF-16BE encodingData\|utf16be\|contains: 'secret'

Comparison Modifiers

ModifierDescriptionExample
gtGreater thanFileSize\|gt: 1000000
gteGreater than or equalEventID\|gte: 4624
ltLess thanProcessId\|lt: 100
lteLess than or equalCount\|lte: 5

Boolean Modifiers

ModifierDescriptionExample
allAll values must matchTags\|all: ['admin', 'sensitive']
existsField must existParentImage\|exists: true

Condition Syntax

Basic Operators

# AND
condition: selection1 and selection2

# OR
condition: selection1 or selection2

# NOT
condition: selection and not filter

# Parentheses
condition: (selection1 or selection2) and not filter

Quantifiers

# Any of (OR across selections)
condition: 1 of selection_*

# All of (AND across selections)
condition: all of selection_*

# N of them
condition: 2 of them

# N of specific
condition: 3 of (selection_a*, selection_b*)

Count Aggregations

detection:
    selection:
        EventType: login_failure
    timeframe: 5m
    condition: selection | count(SourceIP) > 10

# Supported aggregations:
# count(), count(field)
# sum(field), avg(field)
# min(field), max(field)

Logsource Categories

Windows

CategoryDescriptionEvent IDs
process_creationProcess start eventsSysmon 1, Security 4688
process_accessProcess memory accessSysmon 10
process_terminationProcess end eventsSysmon 5
file_eventFile operationsSysmon 11
file_deleteFile deletionsSysmon 23, 26
registry_eventRegistry modificationsSysmon 12, 13, 14
network_connectionNetwork connectionsSysmon 3
dns_queryDNS lookupsSysmon 22
image_loadDLL/module loadsSysmon 7
driver_loadDriver loadsSysmon 6
create_remote_threadRemote thread creationSysmon 8
pipe_createdNamed pipe creationSysmon 17
wmi_eventWMI activitySysmon 19, 20, 21

Linux

CategoryDescriptionSource
process_creationProcess executionauditd, execve
file_eventFile operationsauditd, fanotify
network_connectionSocket operationsauditd, netfilter
authenticationLogin eventsPAM, auth logs

macOS

CategoryDescriptionSource
process_creationProcess executionESF, audit
file_eventFile operationsESF
network_connectionNetwork activityESF

Custom Rule Creation

Via API

# Create a custom Sigma rule
curl -X POST "https://api.tamandua.io/v1/rules/sigma" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/x-yaml" \
  -d @custom_rule.yml
Response:
{
  "id": "sigma_custom_12345",
  "title": "Custom Detection Rule",
  "status": "active",
  "validation": {
    "syntax_valid": true,
    "logsource_supported": true,
    "modifiers_valid": true
  }
}

Via Dashboard

  1. Navigate to Detection > Rules > Sigma
  2. Click Add Custom Rule
  3. Enter rule in YAML format
  4. Click Validate to check syntax
  5. Click Test to run against sample events
  6. Click Deploy to activate

Via CLI

# Add custom rule
tamanduactl rules sigma add custom_rule.yml

# Validate rule syntax
tamanduactl rules sigma validate custom_rule.yml

# Test against events
tamanduactl rules sigma test custom_rule.yml --events events.json

Rule Conversion

SigmaHQ Integration

Tamandua supports importing rules from the SigmaHQ repository:

# Import from SigmaHQ
tamanduactl rules sigma import --source sigmahq \
  --category windows/process_creation

# Sync with SigmaHQ
tamanduactl rules sigma sync-sigmahq

Conversion from Other Formats

# Convert from Splunk
tamanduactl rules sigma convert --from splunk \
  --input splunk_query.spl \
  --output sigma_rule.yml

# Convert from Elastic
tamanduactl rules sigma convert --from elastic \
  --input elastic_rule.json \
  --output sigma_rule.yml

Aggregations and Timeframes

Timeframe-based Detection

title: Brute Force Detection
detection:
    selection:
        EventID: 4625
        LogonType: 2
    timeframe: 10m
    condition: selection | count(TargetUserName) > 5
level: high
tags:
    - attack.credential_access
    - attack.t1110

Supported Aggregations

AggregationDescriptionExample
count()Count eventscount() > 10
count(field)Count unique valuescount(SourceIP) > 5
sum(field)Sum numeric fieldsum(BytesTransferred) > 1000000
avg(field)Average valueavg(Duration) > 300
min(field)Minimum valuemin(ProcessId) < 100
max(field)Maximum valuemax(FileSize) > 10000000

Timeframe Syntax

FormatDescription
5s5 seconds
10m10 minutes
1h1 hour
24h24 hours
7d7 days

Rule Management

Listing Rules

# List all Sigma rules
tamanduactl rules sigma list

# Filter by tactic
tamanduactl rules sigma list --tactic persistence

# Filter by severity
tamanduactl rules sigma list --level critical

Enabling/Disabling

# Disable a rule
tamanduactl rules sigma disable sigma_rule_id

# Enable a rule
tamanduactl rules sigma enable sigma_rule_id

# Disable by tactic
tamanduactl rules sigma disable --tactic discovery

Rule Updates

# Check for updates
tamanduactl rules sigma check-updates

# Update all rules
tamanduactl rules sigma update

# View changelog
tamanduactl rules sigma changelog

Performance Tuning

Rule Performance Levels

LevelDescriptionRecommendation
LowSimple field matchesEnable everywhere
MediumMultiple conditions, modifiersEnable on servers
HighAggregations, timeframesEnable selectively
Very HighComplex regex, large timeframesReview necessity

Optimization Tips

  1. Use specific logsources
   # Good - specific
   logsource:
       category: process_creation
       product: windows

   # Bad - generic
   logsource:
       category: generic
   

  1. Avoid excessive wildcards
   # Good
   CommandLine|contains: 'powershell.exe -enc'

   # Bad
   CommandLine|re: '.*powershell.*'
   

  1. Use appropriate timeframes
   # For brute force: 5-10 minutes
   timeframe: 10m

   # For data exfil: 1 hour
   timeframe: 1h
   

API Reference

List Rules

GET /api/v1/rules/sigma

# Response
{
  "rules": [
    {
      "id": "sigma_001",
      "title": "PowerShell Download Cradle",
      "level": "high",
      "status": "stable",
      "enabled": true
    }
  ],
  "total": 100
}

Get Rule Details

GET /api/v1/rules/sigma/{id}

# Response
{
  "id": "sigma_001",
  "title": "PowerShell Download Cradle",
  "content": "title: Suspicious PowerShell...",
  "stats": {
    "total_matches": 250,
    "last_match": "2025-01-15T14:30:00Z",
    "false_positives": 5
  }
}

Create Rule

POST /api/v1/rules/sigma
Content-Type: application/x-yaml

title: Custom Rule
...

# Response
{
  "id": "sigma_custom_123",
  "status": "active"
}

Test Rule

POST /api/v1/rules/sigma/test
Content-Type: application/json

{
  "rule": "title: Test Rule...",
  "events": [
    {"Image": "powershell.exe", "CommandLine": "IEX..."}
  ]
}

# Response
{
  "matches": [
    {"event_index": 0, "matched_selections": ["selection_powershell", "selection_download"]}
  ]
}

Related Documentation