Ingesting events from the Windows event log is not a complicated process, but you'll typically need to make adjustments to how you configure these logs for Splunk Enterprise Security to ensure you get the most out of this log source. Whether you're looking to ingest these logs for the first time, or you're looking to revisit this log source, you might have questions about ingesting and filtering these logs, including:
This article answers these questions and provides some tips for getting started, as well as acts as a reference for a few of the Windows inputs that can be valuable to security professionals.
This article assumes knowledge of how to install the universal forwarder and how to push out configurations via the deployment server.
Windows audit policies are essential within a Windows environment. They tell the host operating system which events to write to the event log, which is a crucial function for incident response and detection. See Configuring Windows security audit policies for Enterprise Security visibility to see which audit policies are required, and how to deploy the policies via group policy object (GPO) within a Windows domain environment.
In order to enable an audit trail from Active Directory, both audit policies and System Access Control Lists (SACLs) are required. See Enabling an audit trail from Active Directory for guidance on enabling the necessary configurations.
PowerShell script block logging provides visibility into scripts that are run on the host, even when the entire script is downloaded and run in memory, never touching the disk. This is one of the most important Windows log sources and it compliments Sysmon or other endpoint telemetry log sources. Follow the process described in Hunting for malicious PowerShell using script block logging to deploy PowerShell script block logging policies via GPO.
Process command line logging enhances the Windows event ID 4688, providing visibility into any parameters passed through to the process at run time. This additional context is often required to differentiate between benign process execution events and malicious activity. See Enabling Windows event log process command line logging via group policy object to enable this logging enhancement via group policy.
There are two approaches to tuning Windows event log inputs - the allow list approach, and the deny list approach. Pros and cons to each method are detailed in the table below.
The allow list approach:
The deny list approach:
The following deny list-based inputs.conf serves as a recommended baseline configuration for Windows endpoints. You should review and tune it to your environment.
[WinEventLog] renderXml = true index = windows start_from = oldest current_only = 0 checkpointInterval = 5 evt_resolve_ad_obj = 1 ###### Core OS Logs ###### [WinEventLog://Application] disabled = 0 [WinEventLog://Security] disabled = 0 # Filter out noisy Splunk Communication #blacklist1 = $XmlRegex="(?ms)5156.*\\device\\harddiskvolume\d+\\program\sfiles\\splunkuniversalforwarder\\(bin\\splunkd\.exe|etc\\apps\\splunk_ta_stream\\windows_x86_64\\bin\\streamfwd\.exe)(9997|443|8000)<" # Filter out link local & loopback communication #blacklist2 = $XmlRegex="(?ms)5156.*(127.0.0.1|::1|0:0:0:0:0:0:0:1|169.254.*?|fe80:.*?)<" # Filter out noisy Splunk process execution events #blacklist3 = $XmlRegex="(?ms)4688.*C:\\Program Files\\SplunkUniversalForwarder\\(etc\\apps\\Splunk_TA_stream\\windows_x86_64\\bin\\streamfwd.exe|bin\\(splunk-powershell.exe|splunk-MonitorNoHandle.exe|splunk-netmon.exe|splunk-regmon.exe|splunkd.exe|btool.exe|splunk.exe|splunk-winevtlog.exe|splunk-admon.exe|splunk-perfmon.exe|splunk-winprintmon.exe|splunk-wmi.exe))<" # Domain Controller only: Filter out noisy AD Read Events from service account - update ldap_svc with offending account #blacklist4 = $XmlRegex="(?ms)4662.*ldap_svc.*(0x4|0x10|0x20000)C:\\Users\\Administrator\\example.ps1$" [WinEventLog://PowerShellCore/Operational] disabled = 0 ###### Windows Security Extension ###### [WinEventLog://Microsoft-Windows-Windows Firewall With Advanced Security/Firewall] disabled = 0 [WinEventLog://Microsoft-Windows-AppLocker/EXE and DLL] disabled = 0 [WinEventLog://Microsoft-Windows-AppLocker/MSI and Script] disabled = 0 [WinEventLog://Microsoft-Windows-CodeIntegrity/Operational] disabled = 0 [WinEventLog://Microsoft-Windows-Windows Defender/Operational] disabled = 0 [WinEventLog://Microsoft-Windows-BitLocker/BitLocker Management] disabled = 0 [WinEventLog://Microsoft-Windows-Security-Mitigations/KernelMode] disabled = 0 [WinEventLog://Microsoft-Windows-Security-Mitigations/UserMode] disabled = 0 ###### Persistence ###### ### Process Execution Events from reg run keys [WinEventLog://Microsoft-Windows-Shell-Core/Operational] disabled = 0 ### Scheduled Tasks [WinEventLog://Microsoft-Windows-TaskScheduler/Operational] disabled = 0 ###### Data Exfiltration ###### ### Removable Media [WinEventLog://Microsoft-Windows-Kernel-PnP/Configuration] disabled = 0 ### BITS [WinEventLog://Microsoft-Windows-Bits-Client/Operational] disabled = 0 ###### Lateral Movement ###### ### WMI [WinEventLog://Microsoft-Windows-WMI-Activity/Operational] disabled = 0 ### WinRM [WinEventLog://Microsoft-Windows-WinRM/Operational] disabled = 0 ### SSH [WinEventLog://OpenSSH/Operational] disabled = 0 ### RDP [WinEventLog://Microsoft-Windows-RemoteDesktopServices-RdpCoreTS/Operational] disabled = 0 ### RDP [WinEventLog://Microsoft-Windows-TerminalServices-LocalSessionManager/Operational] disabled = 0 ### RDP [WinEventLog://Microsoft-Windows-TerminalServices-RDPClient/Operational] disabled = 0 ### RDP [WinEventLog://Microsoft-Windows-TerminalServices-RemoteConnectionManager/Operational] disabled = 0 ###### Additional Log Sources ###### ### Domain Controller only: Directory Service [WinEventLog://Directory Service] disabled = 1 ### Key Management Service [WinEventLog://Key Management Service] disabled = 1 ### DHCP [monitor://$WINDIR\System32\DHCP] disabled = 1 whitelist = DhcpSrvLog* crcSalt = sourcetype = DhcpSrvLog index = dhcp ### DNS Server [WinEventLog://DNS Server] disabled = 1 [WinEventLog://Microsoft-Windows-DNSServer/Audit] disabled = 1 index = dns
This allow list inputs.conf file created by @mdecrevoisier is an excellent example of an advanced configuration (and is the reference for the example deny list configuration above).