Collecting Windows Security Events
This lesson compares direct collection with Windows Event Forwarding, and explains why the destination table matters.
Learning outcomes
After completing this lesson, you will be able to:
- Compare direct and forwarded collection.
- Explain which table each method uses.
- Choose an event set.
- Describe the setup for WEF.
Two collection paths
Windows machines record security events such as sign-ins and privilege use. There are two ways of bringing them into Microsoft Sentinel. Direct collection installs the Azure Monitor Agent on each machine. Windows Event Forwarding (WEF) uses a built-in Windows feature to send events from many machines to a central Windows Event Collector (WEC), where AMA forwards them. The two paths use different connectors, and they write to different tables, which has real consequences.
Direct or forwarded?
Why the table matters
Microsoft is clear on this point. Events collected through WEF go to the WindowsEvent table, including forwarded Security log events, and not to SecurityEvent. Many built-in analytics rules query SecurityEvent, so they do not match data held only in WindowsEvent. An organization that sets up WEF and installs the Windows solution may therefore believe that it is protected, when its rules are matching nothing.
There is a third destination as well. A plain DCR with a Windows Event Logs source, created in Azure Monitor rather than through the Sentinel connector, writes to the Event table, even for the Security log. The following table summarizes this.
| Method | Table |
|---|---|
| Windows Security Events via AMA connector | SecurityEvent |
| Windows Forwarded Events connector | WindowsEvent |
| Azure Monitor DCR with Windows Event Logs | Event |
Check the table
A scenario that says built-in rules are not firing, although Windows events are visible in the workspace, should make you check which table the data is in.
Choosing what to collect
Collecting every event is expensive, so select carefully. The Windows Security Events via AMA connector offers these options.
| Option | Coverage | Use |
|---|---|---|
| All events | All Windows security and AppLocker events | Full coverage at the highest cost |
| Common | A standard set of events, for auditing | A sensible default for most machines |
| Minimal | A small set that may indicate threats | Lower cost, with less visibility |
| Custom | XPath queries | Exact control |
A custom query uses XPath. AMA supports XPath 1.0 only, and a DCR supports up to 20 expressions in each box. Up to 100 boxes are allowed in a rule. The following expression collects failed sign-ins, with event ID 4625.
Security!*[System[(EventID=4625)]]Test an expression on a machine with Get-WinEvent -LogName Security -FilterXPath before putting it into a DCR. Analytic and Debug channels are not supported, and event logs must be on local disk.
Choosing Windows events
Setting up WEF collection
Windows Event Forwarding needs a Windows Event Collector server, with the WEC service enabled and running, and a subscription that defines which machines forward which events. Install AMA on the collector, and configure the Windows Forwarded Events connector. The DCR on that connector collects from the Forwarded Events channel.
Non-Azure machines, including a collector or a directly collected server, need Azure Arc before enabling the AMA connector. Read and write permission on the workspace is required. WEF suits environments with thousands of servers or with restricted networks, because only the collector needs to reach Azure.
Rules that never match
An organization forwards Security logs from 2,000 servers to a Windows Event Collector with AMA, through the Windows Forwarded Events connector. Analysts can see events in the workspace, but built-in rules for Windows sign-in attacks produce no incidents. What is the cause, and what are the options?
Forwarded events land in WindowsEvent, and the rules query SecurityEvent. One option is to install AMA on the servers, or on those that matter most, and to use the Windows Security Events via AMA connector, which writes to SecurityEvent. Another is to rewrite the analytics rules to query WindowsEvent, or to use normalized parsers that cover both.
Raising the event set to All would not change the table. Waiting would not help, as the rules are looking in the wrong place. Copying the data would double the cost.
Which table receives events from a plain Azure Monitor DCR with Windows Event Logs?
Show answer
The Event table, even for the Security log.
Exam Tips
Remember for the exam
- Direct collection goes to SecurityEvent; WEF goes to WindowsEvent.
- Many built-in rules query SecurityEvent.
- A plain DCR with Windows Event Logs writes to the Event table.
- AMA supports XPath 1.0 only.