Lesson 2 of 5 · 25 min read

Windows Event Logs — EVTX, XML Schema, Providers, Channels

Windows Event Logs are the primary telemetry source for endpoint detection on Windows systems. Before you can write a Sigma rule that targets logsource: product: windows, you need to understand what you’re actually reading.


The EVTX Format

Windows stores event logs as binary .evtx files on disk. Each file corresponds to one channel — a named stream of events from related providers.

C:\Windows\System32\winevt\Logs\
├── Security.evtx          ← 4624, 4625, 4688, 4663...
├── System.evtx             ← 7045, 1102...
├── Application.evtx
├── Microsoft-Windows-Sysmon%4Operational.evtx
├── Microsoft-Windows-PowerShell%4Operational.evtx
└── ...hundreds more

Anatomy of a Windows Event (XML)

When Windows writes an event, it stores it as structured XML. Every event has two blocks: System (standardized metadata) and EventData (provider-specific payload).

Windows Event Log (EVTX) — Windows Security Event 4688 — Process Creation
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
  <System>
    <Provider Name="Microsoft-Windows-Security-Auditing"
              Guid="{54849625-5478-4994-A5BA-3E3B0328C30D}" />
    <EventID>4688</EventID>
    <Version>2</Version>
    <Level>0</Level>
    <Task>13312</Task>
    <Opcode>0</Opcode>
    <Keywords>0x8020000000000000</Keywords>
    <TimeCreated SystemTime="2024-03-15T09:23:14.882341200Z" />
    <EventRecordID>84231</EventRecordID>
    <Correlation />
    <Execution ProcessID="4" ThreadID="8044" />
    <Channel>Security</Channel>
    <Computer>WORKSTATION01.corp.local</Computer>
    <Security UserID="S-1-5-18" />
  </System>
  <EventData>
    <Data Name="SubjectUserSid">S-1-5-21-3623811015-3361044348-30300820-1013</Data>
    <Data Name="SubjectUserName">jdoe</Data>
    <Data Name="SubjectDomainName">CORP</Data>
    <Data Name="SubjectLogonId">0x3E7</Data>
    <Data Name="NewProcessId">0x1d8c</Data>
    <Data Name="NewProcessName">C:\Windows\System32\cmd.exe</Data>
    <Data Name="TokenElevationType">%%1938</Data>
    <Data Name="ProcessId">0x16bc</Data>
    <Data Name="CommandLine">cmd.exe /c whoami</Data>
    <Data Name="TargetUserSid">S-1-0-0</Data>
    <Data Name="TargetUserName">-</Data>
    <Data Name="TargetDomainName">-</Data>
    <Data Name="TargetLogonId">0x0</Data>
    <Data Name="ParentProcessName">C:\Windows\explorer.exe</Data>
    <Data Name="MandatoryLabel">S-1-16-8192</Data>
  </EventData>
</Event>

What each System field means

FieldWhat it tells you
Provider/NameWhich software wrote this event
EventIDWhat kind of event this is
TimeCreated/SystemTimeWhen it happened (UTC)
EventRecordIDPosition in this channel’s log (gap detection)
ChannelWhich EVTX file this came from
ComputerWhich machine generated it
Security/UserIDSID of the process that generated the event (usually SYSTEM)

What EventData contains

The EventData block varies by EventID. For 4688 (process creation):


The Four Core Channels

Security Channel (Security.evtx)

The Security channel is generated by Microsoft-Windows-Security-Auditing. It requires audit policies to be configured — disabled policies produce no events.

Key EventIDs:

EventIDWhat it logs
4624Successful logon
4625Failed logon
4627Group membership info
4648Explicit credential use (RunAs, PsExec)
4663File/object access (requires SACL)
4672Special privileges at logon (admin tokens)
4688Process creation (requires audit policy)
4698Scheduled task created
4720User account created
4732User added to security group
5145Network share access

System Channel (System.evtx)

Tracks OS-level events: service start/stop, driver load, hardware errors.

EventIDWhat it logs
7045New service installed
7036Service changed state
1102Audit log cleared (in Security)

PowerShell/Operational

Generated by Microsoft-Windows-PowerShell. Critical for detecting scripting-based attacks.

EventIDWhat it logs
4103Module logging (cmdlets called)
4104Script block logging (actual script content)
53504PowerShell named pipe connection (PSRemoting)

Reading Events in Practice

When a SIEM ingests Windows events, the XML gets flattened into field-value pairs. Elasticsearch/ECS normalizes them like this:

# ECS-normalized 4688 event
winlog.event_id: 4688
winlog.channel: Security
winlog.computer_name: WORKSTATION01.corp.local
winlog.event_data.SubjectUserName: jdoe
winlog.event_data.NewProcessName: C:\Windows\System32\cmd.exe
winlog.event_data.CommandLine: cmd.exe /c whoami
winlog.event_data.ParentProcessName: C:\Windows\explorer.exe
@timestamp: 2024-03-15T09:23:14.882Z

A Sigma rule targeting this event might look like:

detection:
  selection:
    winlog.event_id: 4688
    winlog.event_data.CommandLine|contains: 'whoami'
  condition: selection
Windows Security Auditing— Microsoft Docs Ultimate Windows Security Event Encyclopedia— Ultimate Windows Security