Skip to content
10 · Audit & LoggingPart 1 of 4Foundation

Windows audit policy and Sysmon: a logging baseline

Configure advanced audit policy subcategories, command-line capture, log sizes, Sysmon and Windows Event Forwarding so Windows logs can answer who, what, where and when.

Florian Amette7 min read

When something goes wrong on a Windows network, the first questions are always the same: which account logged on where, what ran, what changed, and where did it connect? With default settings, Windows answers few of them. Process creation isn't logged, command lines aren't captured, the Security log wraps within hours on a busy server, and nothing leaves the host.

This guide builds a logging baseline in four layers: advanced audit policy, a few extra settings, Sysmon, and forwarding.

Layer 1: advanced audit policy

First, make advanced audit policy authoritative. Under Computer Configuration > Policies > Windows Settings > Security Settings > Local Policies > Security Options, enable Audit: Force audit policy subcategory settings (Windows Vista or later) to override audit policy category settings.

Then configure subcategories under Security Settings > Advanced Audit Policy Configuration > Audit Policies. A solid starting point, broadly aligned with Microsoft's baseline recommendations:

CategorySubcategorySettingKey events
Account LogonCredential ValidationSuccess, Failure4776 (NTLM validation)
Account LogonKerberos Authentication ServiceSuccess, Failure (DCs)4768, 4771
Account LogonKerberos Service Ticket OperationsSuccess, Failure (DCs)4769
Account ManagementSecurity Group ManagementSuccess4728, 4732, 4756 (member added)
Account ManagementUser Account ManagementSuccess, Failure4720, 4722, 4724, 4738, 4740
Account ManagementComputer Account ManagementSuccess (DCs)4741, 4742
Detailed TrackingProcess CreationSuccess4688
Detailed TrackingPNP ActivitySuccess6416 (new device)
DS AccessDirectory Service ChangesSuccess (DCs)5136, 5137
DS AccessDirectory Service AccessSuccess, Failure (DCs)4662 (with SACLs)
Logon/LogoffLogonSuccess, Failure4624, 4625
Logon/LogoffSpecial LogonSuccess4672 (admin-equivalent logon)
Logon/LogoffAccount LockoutFailure4625 (status 0xC0000234)
Logon/LogoffOther Logon/Logoff EventsSuccess, Failure4778, 4779 (RDP reconnect/disconnect)
Object AccessOther Object Access EventsSuccess, Failure4698-4702 (scheduled tasks)
Object AccessRemovable StorageSuccess, Failure4663 on removable media
Policy ChangeAudit Policy ChangeSuccess4719
Policy ChangeAuthentication Policy ChangeSuccess4706, 4713, 4739
Policy ChangeMPSSVC Rule-Level Policy ChangeSuccess4946-4950 (firewall)
Privilege UseSensitive Privilege UseSuccess, Failure4673, 4674 (noisy; consider failures only)
SystemSecurity System ExtensionSuccess4697 (service installed)
SystemSecurity State ChangeSuccess4608, 4616
SystemSystem IntegritySuccess, Failure4612, 5038

Check the effective policy on a host:

PowerShell
auditpol /get /category:*
auditpol /get /subcategory:"Process Creation"

For a lab, you can set individual subcategories directly (GPO remains the source of truth in production):

PowerShell
auditpol /set /subcategory:"Process Creation" /success:enable

Layer 2: the settings that make events useful

SettingPathWhy
Include command line in process creation eventsAdministrative Templates > System > Audit Process CreationAdds the full command line to 4688. Without it you see powershell.exe, not what it ran.
PowerShell script block and module loggingSee the PowerShell guideEvents 4104, 4103
Security log maximum sizeAdministrative Templates > Windows Components > Event Log Service > Security > Specify the maximum log file size1 GB+ on servers, several GB on DCs
System and Application log sizesSame location128 MB or more
Retain old events / backup log automaticallyLeave off unless you manage the disk spaceOtherwise the log stops or fills the disk

Command lines can contain secrets (passwords passed as parameters). That is a reason to restrict who reads the logs and to fix those scripts, not to leave command-line logging off.

Also watch for evidence destruction: 1102 (Security log cleared) and 104 (another log cleared, in System) should always alert.

Layer 3: Sysmon

Sysmon (System Monitor, from Microsoft Sysinternals) is a free driver and service that records detailed process, network, file and registry activity to Applications and Services Logs > Microsoft > Windows > Sysmon > Operational. Since 2026 it is also a built-in optional feature of Windows 11 and Windows Server 2025, off by default and configured with the same XML; the Sysmon deployment guide covers choosing between the two. Its most useful events:

IDEventUse
1Process creation (with hashes, parent command line)Execution chains
3Network connectionWhich process talked to which IP/port
7Image loadedDLL side-loading (filter heavily)
8CreateRemoteThreadProcess injection
10Process accessLSASS access attempts
11File createdPayload drops, dump files
12 / 13 / 14Registry create/delete, value set, renamePersistence keys
22DNS queryWhich process resolved which domain
23 / 26File delete (archived / logged)Tool clean-up
25Process tamperingProcess hollowing / herpaderping

Sysmon is only as good as its configuration: an empty config logs very little, a naive one floods your SIEM. Start from a maintained community configuration, such as the SwiftOnSecurity sysmon-config or Olaf Hartong's sysmon-modular, then tune for your environment.

PowerShell
# Install with a configuration
Sysmon64.exe -accepteula -i sysmonconfig.xml
# Update the configuration later
Sysmon64.exe -c sysmonconfig.xml
# Show the active configuration
Sysmon64.exe -c

Deploy Sysmon through your software distribution tool, pin the version, and monitor that the Sysmon64 service is running: stopping it is an obvious attacker move (Sysmon logs event 4 for service state changes and 16 for configuration changes).

Layer 4: get the events off the host

Local logs can be cleared by anyone with admin rights. Forward them.

Windows Event Forwarding (WEF) is built in and needs no agent:

  1. On a collector server: wecutil qc to configure the Windows Event Collector service.
  2. Create source-initiated subscriptions (XPath queries selecting the event IDs above).
  3. By GPO on sources: Administrative Templates > Windows Components > Event Forwarding > Configure target Subscription Manager = Server=http://wec01.corp.example:5985/wsman/SubscriptionManager/WEC,Refresh=60.
  4. Grant the Network Service account read access to the Security log on sources, by adding it to the Event Log Readers group through Restricted Groups or Group Policy Preferences.

From the collector, ship ForwardedEvents to your SIEM. If you already run a SIEM or EDR agent, point it at the same event IDs instead; the important thing is that events leave the host within minutes.

What good looks like

A quick way to test the baseline is to ask the questions from an imaginary incident and see whether your logs answer them:

  • Who logged on to server X last Tuesday, from where? 4624 with logon type and source IP, forwarded.
  • What did that session run? 4688 with command lines, Sysmon 1, PowerShell 4104.
  • Did anything touch LSASS? Sysmon 10 filtered on lsass.exe.
  • Was persistence added? 4697 / 7045 (service), 4698 (scheduled task), Sysmon 13 on Run keys.
  • Where did it connect? Sysmon 3 and 22.
  • Did someone try to hide it? 1102, 104, Sysmon 4/16, Defender 5001/5007.

Checklist

  • Advanced audit policy forced to override; subcategories set as above
  • Command-line capture in 4688 enabled
  • Security log sized for days, not hours; clear-log events alerted
  • Sysmon deployed with a maintained, tuned configuration
  • Events forwarded (WEF or agent) and retained centrally
  • Incident questions answered end-to-end in a tabletop test

Logging doesn't prevent anything, but every other control on this map is easier to trust when you can see it working, and see the moment it stops.

Frequently asked questions

Do I need Sysmon if I have an EDR?

Not strictly: most EDRs collect similar telemetry. Sysmon is still valuable where no EDR is deployed, as an independent source during investigations, or to feed your own SIEM with process, network and DNS events at no licence cost.

How large should the Security log be?

Large enough to hold at least several days locally even if forwarding breaks. On workstations 256 MB to 1 GB is common; on domain controllers and busy servers, several GB. Forward events centrally so local size is a buffer, not your retention.

Why use advanced audit policy instead of the basic audit policy?

The nine basic categories are too coarse: enabling one turns on noisy subcategories you don't need. Advanced audit policy has about sixty subcategories, so you collect what matters without drowning. Force it to take precedence so the two don't conflict.

Windows audit policy and Sysmon: a logging baseline

Related guides

Audit & Logging

Deploying and tuning Sysmon at scale

Choose a Sysmon configuration, cut noise without creating blind spots, roll out updates safely across thousands of hosts and monitor Sysmon itself.

Intermediate
Audit & Logging

Windows security event IDs that matter

A practical reference to the Windows event IDs worth collecting and alerting on: logons, failure codes, Kerberos, account changes, persistence and tampering.

Foundation