Module 1 of 6Free to explore

SIEM and Correlations: Sigma, Content Rules

60–90 minutesTheory and practiceMedium

Turn process behavior into a small Sigma rule and test positive, negative and legitimate examples. The deliverable is a rule with a defined data scope and test matrix. A match does not establish that a document is malicious; it identifies a combination that an analyst must explain using additional evidence.

A SIEM collects, searches and analyses security events centrally. Telemetry consists of observations such as process-start records. Sysmon can create such Windows records under its configuration. Sigma is a format for detection rules; a target engine needs appropriate conversion. Here correlation combines properties of one event. It is not temporal correlation across several events, which requires other conditions and tests.

Lesson 1. Behavior, source and detector condition

Sysmon creates telemetry; a separate engine performs analysis and correlation. This exercise requires process-creation records with child and parent image paths. Installing Sysmon does not guarantee every desired event category: verify configuration, delivery and normalization. Sigma expresses conditions independently of a SIEM, but converted queries still need field-mapping and operator-semantics tests. Logsource defines the relevant data; detection selects events; condition combines selections. Path comparison must match your normalization rules for case and separators. PowerShell alone can represent routine administration. A WINWORD parent narrows the context but can occur in authorized automation. An exception should describe a particular verified workflow with an owner, rather than suppressing every event from a familiar user. Retain original events so an analyst can explain why a rule matched. When data coverage changes, rerun the tests before trusting the resulting detection.

Lesson 2. Read the rule and three fixtures

This is an original experimental rule. P1, N1 and B1 comments are test fixtures, not additional Sigma schema fields. Windows paths represent field values supplied by the collector.

title: Office Parent Starting PowerShell - Training
status: experimental
logsource:
  category: process_creation
  product: windows
detection:
  child:
    Image|endswith: '\powershell.exe'
  parent:
    ParentImage|endswith: '\WINWORD.EXE'
  condition: child and parent
level: medium
# P1: Image=C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
#     ParentImage=C:\Program Files\Office\WINWORD.EXE
# N1: same Image; ParentImage=C:\Windows\explorer.exe
# B1: same pair as P1; owner-approved document automation

Lesson 3. Turn a match into an explained signal

P1 matches both selections and should alert. N1 matches child but not parent, so it should not alert. B1 also matches: the two selected fields cannot distinguish it from P1, although its business context is approved. This expected false positive needs extra evidence such as a document identifier, approved workflow, signed script and time window. Suppressing all WINWORD events would destroy the detector. After tuning, rerun P1 and N1, include B1 and add an example imitating the approved workflow. A program signature alone does not make every child action safe.

Operational workflow and common errors

  1. Define the input contract. Preserve each original Sysmon event with source, timestamp and identifier. Map Image to the child executable, ParentImage to its parent and ProcessGuid to the stable process reference. Obtain destination field names from the actual index. Similar Image and image fields can have different types or analyzers. Keep originals accessible after normalization.

  2. Test missing data. Add P0 with Image present and ParentImage absent. Its outcome is incomplete coverage rather than a confident claim that nothing suspicious occurred. A separate quality check should count such events. Test case and path-separator normalization, nested directories and the lookalike filename powershell.exe.bak; that last name must not match the required ending.

  3. Map into an operational system. In OpenSearch Security Analytics, select a training index and log type, inspect the proposed mappings and then create a detector. KUMA first transforms source records through a normalizer into its event model. MaxPatrol SIEM likewise requires inspecting the normalized record before correlation. This transfers the mechanism, not a claim that identical Sigma YAML can be pasted into every product. Record product version, field dictionary and transformation method.

  4. Test a narrow exception. For B1 verify the document, approved task, interval and process chain. Add B2 using the same user but another document. B2 must retain the signal. Assign exception ownership and a review date. If an unknown value becomes an empty string, capture that behavior in the test rather than concealing it with another filter.

  5. Preserve the verification package. Include YAML, four original fixtures, mappings, converted query and expected versus actual outcomes. Another analyst should reproduce the same matrix. Fewer alerts alone do not prove improvement: broad suppression can remove useful detections together with noise. In a Russian training environment, local severity and response targets are organizational policy, not statutory values inferred from the PowerShell name. Explain how a failed data-quality test affects the release decision before enabling the detector.

A local control before SIEM deployment

Save rule_matrix.py and run python3 rule_matrix.py with prepared Python 3; use python rule_matrix.py on Windows. It checks only the two selected fields, without starting Word/PowerShell or collecting Sysmon. Sigma string comparisons are ordinarily case-insensitive; regular expressions have distinct semantics. Separator replacement below is an explicit model choice still requiring comparison with your backend.

# rule_matrix.py: two-field educational equivalent, not a Sigma backend
fixtures = {
 'P1': {'Image':r'C:\Windows\powershell.exe', 'ParentImage':r'C:\Office\WINWORD.EXE'},
 'N1': {'Image':r'C:\Windows\powershell.exe', 'ParentImage':r'C:\Windows\explorer.exe'},
 'B1': {'Image':r'C:\Windows\powershell.exe', 'ParentImage':r'C:\Office\WINWORD.EXE'},
 'P0': {'Image':r'C:\Windows\powershell.exe'},
 'N2': {'Image':r'C:\Windows\powershell.exe.bak', 'ParentImage':r'C:\Office\WINWORD.EXE'},
 'CASE': {'Image':'C:/Windows/PowerShell.EXE', 'ParentImage':'C:/Office/WinWord.Exe'},
}
def decide(event):
    if any(not isinstance(event.get(key), str) or not event[key]
           for key in ('Image', 'ParentImage')):
        return 'INCOMPLETE'
    child = event['Image'].replace('/', '\\').casefold()
    parent = event['ParentImage'].replace('/', '\\').casefold()
    return child.endswith('\\powershell.exe') and parent.endswith('\\winword.exe')
expected = {'P1':True, 'N1':False, 'B1':True, 'P0':'INCOMPLETE', 'N2':False, 'CASE':True}
for name, event in fixtures.items():
    result = decide(event)
    assert result == expected[name], name
    print(name, result)
print('six local cases checked; no event collected or SIEM rule deployed')

Expect P1=True, N1=False, B1=True, P0=INCOMPLETE, N2=False and CASE=True. B1 deliberately remains a signal because two fields cannot identify approved automation. In a separate copy replace the condition’s and with or: N1 must break the expected matrix. This verifies a local logical equivalent; actual conversion, indexing and delivery require separate tests.

Practice. Lesson 4. Test conversion and exceptions

Write expected outcomes for every fixture and identify required collector fields. Convert the rule to your test SIEM language or manually express its equivalent Boolean filter. Propose a narrow B1 exception that preserves P1. Record the Sigma version, conversion settings and four test outcomes, including an attempted exception bypass. The tests operate on supplied synthetic events only.

Lesson 5. Verify data quality and decisions

Tests are repeatable and missing fields are detected. Distinguish a rule match from a confirmed attack. Document the exception without relying solely on username or signature. Verify AND semantics, path-ending comparison and parent-field coverage after conversion. Keep source events and expected outcomes alongside the rule so a reviewer can independently assess it.

Primary sources

Try the idea yourself

An event is not yet an incident

Change the conditions and observe this training model. It runs in your browser and does not change your computer.

Select the events you want to include in your explanation.

Observation

Choose conditions above to see an explanation of the result.

Independent exercise · Russian

Две бумажные ленты с отметками лежат под прозрачной линейкой на светлом столе.
Совместите мысленно отметки на двух лентах. В примере такой парой будут исходная запись и её представление в SIEM. Сравните, какие поля сохранились у одной и той же записи.

В декабре 2026 года дежурная смена сети пунктов выдачи проверяет правило перед переносом в рабочую очередь. По замыслу автора сигнал должен появиться при запуске сценарного интерпретатора из табличного редактора. После смены формата выгрузки тест показывает ноль сигналов.

Evidence

Контрольный экспорт содержит три запуска. В E17 редактор породил интерпретатор, в E18 тот же интерпретатор запустил планировщик, в E19 редактор открыл средство печати. В исходных E17–E19 заполнены child и parent. В SIEM все три child перенесены в process.name, а поле process.parent.name пустует. В преобразованном правиле оба условия соединены оператором И.

Assignment

Сдайте таблицу из трёх строк с ожидаемым и фактическим результатом для каждого события. Напишите одно требование к сопоставлению полей и условие передачи правила следующей смене.

Compare your reasoning

Совпадение ожидается только для E17. Пустое поле родителя объясняет пропуск. Простое удаление проверки родителя включит E18. Передача допустима после исправления переноса parent и повторной проверки на тех же трёх запусках. В отчёте сохраните идентификаторы исходных записей.

Personal practice environment

Check an excerpt, find matching lines and compute the SHA-256 of the original text. Temporary data expires after 30 minutes or when you close the environment.