IntermedioSigmareglasSIEMdetecciónSplunkElastic

Sigma Rules para Detección de Malware: El Estándar Universal de Detección en Logs

Guía de Sigma rules para detección de malware en SIEM. Sintaxis, escritura de reglas, conversión a Splunk/Elastic/Sentinel, repositorio SigmaHQ, y reglas esenciales para ransomware, lateral movement, credential dumping y evasión.

MalwareIntel Research··7 min lectura
Serie: Entornos de Análisis — Parte 11

Sigma: escribir una vez, detectar en cualquier SIEM

El problema antes de Sigma: cada SIEM tiene su propio lenguaje de queries. Una regla de detección en Splunk (SPL) no funciona en Elastic (KQL) ni en Sentinel (KQL diferente). Los equipos de detección escribían la misma regla 3-4 veces para cada plataforma.

Sigma resuelve esto: escribes la regla en formato YAML genérico y la conviertes automáticamente al lenguaje de tu SIEM. Esto democratiza la detección: las reglas de SigmaHQ son accesibles para cualquier organización independientemente de su SIEM.

Anatomía de una regla Sigma

title: Shadow Copy Deletion via Vssadmin
id: c947b146-0abc-4f87-9c64-b17e9d7274a2
status: stable
description: Detects deletion of shadow copies via vssadmin, a common ransomware precursor
references:
    - https://attack.mitre.org/techniques/T1490/
author: MalwareIntel Research
date: 2026/05/21
modified: 2026/05/21
tags:
    - attack.impact
    - attack.t1490

logsource:
    category: process_creation
    product: windows

detection:
    selection_vssadmin:
        Image|endswith: '\vssadmin.exe'
        CommandLine|contains|all:
            - 'delete'
            - 'shadows'
    selection_wmic:
        Image|endswith: '\wmic.exe'
        CommandLine|contains|all:
            - 'shadowcopy'
            - 'delete'
    condition: selection_vssadmin or selection_wmic

falsepositives:
    - Legitimate backup software managing shadow copies
    - System administrators performing maintenance

level: critical

Secciones

SecciónObligatorioDescripción
titleNombre descriptivo de la regla
idUUID único
statustest, experimental, stable, deprecated
descriptionQué detecta y por qué
logsourceTipo de log: category + product
detectionLógica de detección: selections + condition
levelinformational, low, medium, high, critical
tagsNoMITRE ATT&CK tags
falsepositivesNoPosibles falsos positivos
referencesNoURLs de referencia

Logsources comunes

CategoryProductFuente de log
process_creationwindowsSysmon Event ID 1, Event ID 4688
registry_setwindowsSysmon Event ID 13
registry_addwindowsSysmon Event ID 12
network_connectionwindowsSysmon Event ID 3
file_eventwindowsSysmon Event ID 11
image_loadwindowsSysmon Event ID 7
pipe_createdwindowsSysmon Event ID 17
dns_querywindowsSysmon Event ID 22
ps_scriptwindowsPowerShell Event ID 4104
wmi_eventwindowsSysmon Event ID 19/20/21
driver_loadwindowsSysmon Event ID 6
process_creationlinuxauditd, Sysmon for Linux

Modificadores de detección

ModificadorEjemploSignificado
containsCommandLine|contains: 'shadow'Contiene substring
endswithImage|endswith: '\cmd.exe'Termina con
startswithTargetFilename|startswith: 'C:\Temp'Empieza con
allcontains|all: ['delete', 'shadows']Debe contener TODOS
base64CommandLine|base64: 'IEX'Busca la versión base64 del string
reCommandLine|re: 'cmd.*\/c.*del'Regex
cidrDestinationIp|cidr: '10.0.0.0/8'CIDR range

Reglas esenciales para malware

Ransomware pre-cifrado

title: Multiple Ransomware Precursors
id: d1234567-e2f3-a4b5-c678-9def01234567
status: stable
description: Detects combination of shadow copy deletion and service stopping
logsource:
    category: process_creation
    product: windows
detection:
    shadow_delete:
        CommandLine|contains:
            - 'vssadmin delete'
            - 'wmic shadowcopy delete'
            - 'bcdedit /set'
    service_stop:
        Image|endswith: '\net.exe'
        CommandLine|contains: 'stop'
    condition: shadow_delete or service_stop
level: critical
tags:
    - attack.impact
    - attack.t1490
    - attack.t1489

Credential dumping (LSASS)

title: LSASS Memory Access by Suspicious Process
id: a2b3c4d5-e6f7-8901-abcd-ef2345678901
status: stable
logsource:
    category: process_access
    product: windows
detection:
    selection:
        TargetImage|endswith: '\lsass.exe'
        GrantedAccess|contains:
            - '0x1010'
            - '0x1FFFFF'
            - '0x1410'
    filter_legitimate:
        SourceImage|endswith:
            - '\svchost.exe'
            - '\MsMpEng.exe'
            - '\csfalconservice.exe'
    condition: selection and not filter_legitimate
level: critical
tags:
    - attack.credential_access
    - attack.t1003.001

Cobalt Strike named pipes

title: Cobalt Strike Named Pipe
id: b3c4d5e6-f7a8-9012-bcde-f34567890123
status: stable
logsource:
    category: pipe_created
    product: windows
detection:
    selection:
        PipeName|startswith:
            - '\MSSE-'
            - '\postex_'
            - '\status_'
            - '\msagent_'
    condition: selection
level: critical
tags:
    - attack.command_and_control
    - attack.t1071

PowerShell download cradle

title: PowerShell Download and Execute
id: c4d5e6f7-a8b9-0123-cdef-456789012345
status: stable
logsource:
    category: process_creation
    product: windows
detection:
    selection_ps:
        Image|endswith:
            - '\powershell.exe'
            - '\pwsh.exe'
    selection_download:
        CommandLine|contains:
            - 'DownloadString'
            - 'DownloadFile'
            - 'Invoke-WebRequest'
            - 'iwr '
            - 'wget '
            - 'Start-BitsTransfer'
    selection_execute:
        CommandLine|contains:
            - 'IEX'
            - 'Invoke-Expression'
            - '| bash'
            - '| sh'
    condition: selection_ps and (selection_download or selection_execute)
level: high
tags:
    - attack.execution
    - attack.t1059.001

Lateral movement via PsExec

title: PsExec Service Installation
id: d5e6f7a8-b9c0-1234-def0-567890123456
status: stable
logsource:
    product: windows
    service: system
detection:
    selection:
        EventID: 7045
        ServiceName: 'PSEXESVC'
    condition: selection
level: high
tags:
    - attack.lateral_movement
    - attack.t1569.002

Data exfiltration with Rclone

title: Rclone Data Exfiltration
id: e6f7a8b9-c0d1-2345-ef01-678901234567
status: stable
logsource:
    category: process_creation
    product: windows
detection:
    selection:
        Image|endswith: '\rclone.exe'
        CommandLine|contains:
            - 'copy'
            - 'sync'
            - 'move'
    cloud_target:
        CommandLine|contains:
            - 'mega'
            - 'pcloud'
            - 's3'
            - 'ftp'
            - 'sftp'
    condition: selection and cloud_target
level: high
tags:
    - attack.exfiltration
    - attack.t1567

Conversión a SIEM

Instalación de sigma-cli

pip install sigma-cli
pip install pySigma-backend-splunk
pip install pySigma-backend-elasticsearch
pip install pySigma-pipeline-sysmon
pip install pySigma-pipeline-windows

Convertir a Splunk

sigma convert -t splunk -p sysmon rule.yml
# Output:
# Image="*\\vssadmin.exe" CommandLine="*delete*" CommandLine="*shadows*"
# | OR Image="*\\wmic.exe" CommandLine="*shadowcopy*" CommandLine="*delete*"

Convertir a Elastic/KQL

sigma convert -t elasticsearch -p ecs_windows rule.yml
# Output:
# (process.executable:*\\vssadmin.exe AND process.command_line:*delete* AND process.command_line:*shadows*)

Convertir a Microsoft Sentinel

sigma convert -t microsoft365defender rule.yml

Convertir todo el repositorio SigmaHQ

git clone https://github.com/SigmaHQ/sigma
# Convertir todas las reglas a Splunk
sigma convert -t splunk -p sysmon sigma/rules/windows/ -o splunk_rules/

SigmaHQ: el repositorio

URL: github.com/SigmaHQ/sigma

Estructura:

sigma/rules/
├── windows/
│   ├── process_creation/     # Sysmon Event ID 1
│   ├── registry/             # Sysmon Event ID 12/13
│   ├── network_connection/   # Sysmon Event ID 3
│   ├── pipe_created/         # Sysmon Event ID 17
│   ├── ps_script/            # PowerShell Script Block
│   ├── file/                 # Sysmon Event ID 11
│   ├── image_load/           # Sysmon Event ID 7
│   └── ...
├── linux/
│   ├── process_creation/
│   ├── auditd/
│   └── ...
├── cloud/
│   ├── aws/
│   ├── azure/
│   └── gcp/
└── ...

Estadísticas (2026): 3.500+ reglas, 200+ contribuidores, actualizaciones semanales.

Buenas prácticas

PrácticaMotivo
Usar logsources genéricas (category: process_creation)Portabilidad entre SIEMs
Incluir falsepositivesDocumentar excepciones conocidas
Testear con Atomic Red TeamVerificar que la regla detecta la técnica
level: critical solo para detecciones de alta confianzaEvitar alert fatigue
Incluir tags ATT&CKMapeo a framework estándar
Usar id UUID únicoReferenciabilidad
filter_ para exclusionesSeparar la lógica de exclusión de la selección

Mapeo MITRE ATT&CK

Sigma tags mapean directamente a ATT&CK:

tags:
    - attack.execution          # Táctica
    - attack.t1059.001         # Técnica: PowerShell
    - attack.defense_evasion
    - attack.t1562.001         # Técnica: Disable Security Tools

Los tags permiten buscar reglas por técnica ATT&CK en SigmaHQ.


Fuentes y referencias

Preguntas frecuentes

Artículos relacionados

Este contenido tiene fines exclusivamente educativos y de investigación en ciberseguridad defensiva. No se proporcionan binarios maliciosos ni payloads ejecutables. El uso indebido de esta información es responsabilidad exclusiva del usuario. Leer disclaimer completo.