Free readiness test
Home / Tool labs / Sigma

Sigma hands-on lab Detect encoded PowerShell in every SIEM

Write a detection once, run it in any SIEM.

SIEM & DetectionIntermediatePro live lab4 objectives
detect-eng@lab:~/detections$
$ sigma check rules/
Parsing Sigma rules  [####################################]  100%
Checking Sigma rules  [####################################]  100%
Found 0 errors, 0 condition errors and 0 issues.
No rule errors found.

What is Sigma?

Sigma is an open, vendor-neutral format for detection rules. Write the logic in YAML once and convert it to Splunk, Microsoft Sentinel/Defender KQL, Elastic and more with sigma-cli (pySigma).

1 Detection as code

Rules live in Git with reviews, tests and versioning, like software.

2 logsource + detection

logsource says which logs; detection holds selections and a condition.

3 Backends & pipelines

Backends produce the query language; pipelines map field names to your data (e.g. Sysmon).

The scenario: Detect encoded PowerShell in every SIEM

Your company runs Splunk on-prem and Microsoft Defender XDR in the cloud. Turn the team's Sigma rule for encoded PowerShell into working queries for both, after validating it.

Run this lab live in the platform

A simulated terminal with 4 objectives, hints and scenario questions. Included with NERvE Pro.

Open the Sigma lab

Step-by-step: Sigma commands used in this lab

1Read the Sigma rule

It's in rules/.

cat rules/proc_creation_win_powershell_encoded.yml

2Validate the rules

sigma check validates syntax and conventions.

sigma check rules/

3Convert it for Splunk (Sysmon data)

Target splunk, pipeline sysmon.

sigma convert -t splunk -p sysmon rules/proc_creation_win_powershell_encoded.yml

4Convert it for Microsoft Defender XDR (KQL)

Target kusto, pipeline microsoft_xdr.

sigma convert -t kusto -p microsoft_xdr rules/proc_creation_win_powershell_encoded.yml

Key takeaways

Install Sigma and practise for real

pipx install sigma-cli && sigma plugin install splunk kusto sysmon microsoft365defender

Thousands of community rules are on github.com/SigmaHQ/sigma to learn from. Only scan or test systems you own or are explicitly authorised to assess. Official site: sigmahq.io · Licence: DRL 1.1 / LGPL.

Scenario questions

What's the main benefit of Sigma?

Answer: One rule can be converted to many SIEM query languages. Sigma separates detection logic from the SIEM, so teams share and reuse rules.

Why does the rule have filter_sccm?

Answer: To exclude a known legitimate source and reduce false positives. Tuning out known-good activity keeps alerts trustworthy.

What does the processing pipeline (-p sysmon / microsoft_xdr) do?

Answer: Maps generic Sigma field names to the fields in your data. Pipelines translate fields like Image to FolderPath for each data source.

More open-source tool labs