Generate explainable Sigma rules from suspicious Windows process events.
Project description
sigmorph
Built by YAHIAOUI Hadj Habib (chaos.hh@gmail.com)
sigmorph is a Python library that generates explainable Sigma detection rules from suspicious Windows process events.
It is designed for detection engineers and analysts who want to quickly turn observed suspicious behavior into reusable detection rules.
What it does
Given a set of suspicious events, sigmorph:
- extracts relevant fields
- measures field stability across samples
- removes noisy or environment-specific data
- generalizes patterns into Sigma-compatible conditions
- generates a Sigma rule
- provides:
- rule scoring
- explanation of decisions
- anti-overfitting analysis
Scope (v0.1)
This version is intentionally focused:
- Input: JSON events
- Target: Windows process creation logs
- Output: Sigma rule (YAML)
- No machine learning
- No external dependencies on SIEMs
Example input
[
{
"Image": "C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe",
"CommandLine": "powershell.exe -enc aGVsbG8=",
"ParentImage": "C:\\Program Files\\Microsoft Office\\root\\Office16\\WINWORD.EXE",
"User": "LAB\\bob",
"ComputerName": "WS-22",
"EventID": 1
},
{
"Image": "C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe",
"CommandLine": "powershell.exe -EncodedCommand ZGly",
"ParentImage": "C:\\Program Files\\Microsoft Office\\root\\Office16\\WINWORD.EXE",
"User": "LAB\\alice",
"ComputerName": "WS-30",
"EventID": 1
}
]
## Example output
</> YAML
title: Auto-generated suspicious process pattern
logsource:
product: windows
category: process_creation
detection:
selection_1:
Image|endswith: \powershell.exe
selection_2:
CommandLine|contains:
- -enc
- EncodedCommand
- powershell
selection_3:
ParentImage|endswith: \winword.exe
condition: selection_1 and selection_2 and selection_3
level: medium
metadata:
status: experimental
profile: balanced
selected_fields:
- Image
- CommandLine
- ParentImage
## Installation and Usage
</> Bash
pip install -e .
python -m sigmorph.cli examples/suspicious_powershell.json
</> Python
from sigmorph import SigmaSynth
rule = (
SigmaSynth()
.from_json("examples/suspicious_powershell.json")
.for_logsource(product="windows", category="process_creation")
.generate(profile="balanced")
)
print(rule.yaml())
print(rule.score())
print(rule.explain())
print(rule.overfit_report())
## Profiles
strict → high precision, low noise
balanced → default, best trade-off
broad → more coverage, more noise
## Core concepts
Field stability: evaluates how consistent a field is across events
Generalization: converts raw values into reusable Sigma conditions (contains, endswith, exact)
Noise reduction: removes environment-specific fields like usernames and hostnames
Overfit awareness: detects overly specific rules
## Author
YAHIAOUI Hadj Habib
GitHub: https://github.com/h0bib
Email: chaos.hh@gmail.com
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sigmorph-0.1.0.tar.gz.
File metadata
- Download URL: sigmorph-0.1.0.tar.gz
- Upload date:
- Size: 9.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
20c328b3fb28a2a67c12ebbcfe8dc1f173925b4c3f494d32237937c6eb03c512
|
|
| MD5 |
c9d162ab64813bd267954227d60ebe47
|
|
| BLAKE2b-256 |
1b60772b1c78e15e73b560dabfc3294322b922ab9abf6d8ecd756d29de1e767f
|
File details
Details for the file sigmorph-0.1.0-py3-none-any.whl.
File metadata
- Download URL: sigmorph-0.1.0-py3-none-any.whl
- Upload date:
- Size: 10.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
70cd65bd324c038d57c28ae9460c6361c7670c5b5abfc273026e6c8a1b24ce1a
|
|
| MD5 |
79f8896929d908f80f39fa9c1737c93e
|
|
| BLAKE2b-256 |
ea6f64abb1652b57e72c8cd7432efaacdef8f2418cf46b1739cf2688e34a6540
|