Free plan available. Set up in minutes with the collectors you already use. Start free
Logthread

Guide

Windows Security events

Beta. Logthread reads the Windows Security event log of your servers and domain controllers and turns each event into the same security fields as your other sources: who signed in, from where, what changed, which process ran. The detections for brute force, password spraying and new accounts then cover Windows, and seven more watch what only Windows reports. For the whole setup of Logthread as your SIEM, start with Logthread as your SIEM.

You set it up in Integrations → Windows server: tick Security events and follow the steps. See Set up a Windows server. It takes four steps: install the agent, turn on the audit policy, check that the events arrive, then use the parser.

1. Install or upgrade the agent#

On each Windows server and domain controller, in PowerShell as Administrator. The setup page shows this command with its own ingest key filled in:

& ([scriptblock]::Create((irm https://downloads.logthread.com/agent/install.ps1))) -Key YOUR_INGEST_KEY -Profiles windows-server,windows-security-siem -Fleet
  • Already running the agent? Answer Yes in the setup. It gives an upgrade command that keeps every profile the agent already runs and adds Security events. An older windows-security profile is replaced.
  • Many servers: agents managed from Logthread can get the same setting by label. Use Data in → Host agents → Configs → Roll out a setting and choose Windows Security events. See Agents.
  • An MSI package follows once a code-signing certificate exists.

The agent runs as LocalSystem, which has the Manage auditing and security log right it needs to read the Security log. It also reads System event 7045 (a service was installed); the rest of the System log stays with the windows-server profile.

Turn on the audit policy#

Windows only writes the events its audit policy asks for. These commands turn on the subcategories the parser and detections read. They use each subcategory's GUID, so they work on Windows in any language, and they only turn settings on: nothing you already audit is switched off.

# Subcategory settings win over the old category settings
New-ItemProperty -Path 'HKLM:\System\CurrentControlSet\Control\Lsa' -Name SCENoApplyLegacyAuditPolicy -Value 1 -PropertyType DWord -Force | Out-Null
auditpol /set /subcategory:"{0CCE9215-69AE-11D9-BED3-505054503030}" /success:enable /failure:enable  # Logon
auditpol /set /subcategory:"{0CCE9216-69AE-11D9-BED3-505054503030}" /success:enable  # Logoff
auditpol /set /subcategory:"{0CCE9217-69AE-11D9-BED3-505054503030}" /failure:enable  # Account Lockout
auditpol /set /subcategory:"{0CCE921B-69AE-11D9-BED3-505054503030}" /success:enable  # Special Logon
auditpol /set /subcategory:"{0CCE921C-69AE-11D9-BED3-505054503030}" /success:enable /failure:enable  # Other Logon/Logoff Events
auditpol /set /subcategory:"{0CCE9235-69AE-11D9-BED3-505054503030}" /success:enable /failure:enable  # User Account Management
auditpol /set /subcategory:"{0CCE9237-69AE-11D9-BED3-505054503030}" /success:enable  # Security Group Management
auditpol /set /subcategory:"{0CCE9242-69AE-11D9-BED3-505054503030}" /success:enable /failure:enable  # Kerberos Authentication Service
auditpol /set /subcategory:"{0CCE9240-69AE-11D9-BED3-505054503030}" /success:enable /failure:enable  # Kerberos Service Ticket Operations
auditpol /set /subcategory:"{0CCE922B-69AE-11D9-BED3-505054503030}" /success:enable  # Process Creation
auditpol /set /subcategory:"{0CCE9211-69AE-11D9-BED3-505054503030}" /success:enable  # Security System Extension
auditpol /set /subcategory:"{0CCE922F-69AE-11D9-BED3-505054503030}" /success:enable /failure:enable  # Audit Policy Change
# The command line in process creation events (4688)
if (-not (Test-Path 'HKLM:\Software\Microsoft\Windows\CurrentVersion\Policies\System\Audit')) { New-Item -Path 'HKLM:\Software\Microsoft\Windows\CurrentVersion\Policies\System\Audit' | Out-Null }
New-ItemProperty -Path 'HKLM:\Software\Microsoft\Windows\CurrentVersion\Policies\System\Audit' -Name ProcessCreationIncludeCmdLine_Enabled -Value 1 -PropertyType DWord -Force | Out-Null
# Check: every line should show the setting above
auditpol /get /category:*

Domain controllers and many servers: set the same in a Group Policy Object, or Group Policy overwrites local settings at its next refresh:

  • Computer Configuration → Policies → Windows Settings → Security Settings → Advanced Audit Policy Configuration → Audit Policies: the subcategories above, under Account Logon, Account Management, Detailed Tracking, Logon/Logoff, Policy Change and System.
  • Computer Configuration → Policies → Windows Settings → Security Settings → Local Policies → Security Options → Audit: Force audit policy subcategory settings to override audit policy category settings: Enabled.
  • Computer Configuration → Policies → Administrative Templates → System → Audit Process Creation → Include command line in process creation events: Enabled.

Keep it on: tick Configuration checks in the setup (the security-config profile) (agent 0.3.2 or later) and every server reports each of these settings twice a day, as a passing or failing configuration check with its fix, next to the password and lockout policy, SMBv1, LLMNR, Remote Desktop, firewall and Defender checks. A Group Policy that switches a subcategory off then shows as a failing check, and the *Configuration check failing* detection opens a finding for the host. On a default Windows Server, expect failing checks for the password length and history, account lockout, LLMNR and the audit subcategories Windows does not turn on by default, until you apply the settings above; upgrading a host that already runs security-config to 0.3.2 starts these records, and each failing host can raise the detection. See Configuration checks on Windows and Security → Hardening.

3. Check that the events arrive#

The check step on the connection page counts the last 24 hours of windows-security records by event id and lists each expected id:

  • Routine events (4624, 4634, 4672, 4688) appear within minutes of a sign-in. When one is missing, the page names the subcategory to turn on.
  • Domain controllers only: Kerberos events (4768, 4769, 4771).
  • When it happens: account, group, service and policy changes, a cleared log and failed sign-ins.

The check works before the parser is on. You can run the same count in Explore:

service:windows-security | stats count() by windows.event.id

4. Use the parser#

On the connection page choose Use parser: Windows Security events. It creates the pipeline from the library preset and opens the activation wizard on the windows-security service: it shows how many recent records match, previews the change on your own records, then activates it. From then on the button reads Parser active.

Then look at sign-ins by user and logon type:

service:windows-security event.action:logon | stats count() by user.name, windows.logon.type_name

Failed sign-ins by address and reason:

service:windows-security event.category:authentication event.outcome:failure | stats count() by source.address, windows.failure_reason

Detections to turn on#

Open Security → SIEM. Each shows its MITRE ATT&CK technique and how many matching records you had in the last 24 hours.

DetectionFires on
Brute force from one addressMore than 10 failed sign-ins from one address in 10 minutes (4625, 4771 and your other sources)
Password sprayingFailed sign-ins for 5 or more users from one address in 15 minutes
Local account created, Local account deleted4720, 4726
Windows Security log cleared1102
Windows audit policy changed4719
Windows service installed4697, 7045
Member added to a privileged Windows group4728, 4732, 4756 into Administrators, Domain Admins, Enterprise Admins, Schema Admins, Account Operators, Server Operators, Print Operators, Backup Operators, Group Policy Creator Owners or DnsAdmins
Kerberos password spraying4771 for 5 or more accounts from one address within an hour
Remote Desktop sign-in from outsideA successful logon type 10 from an address outside the private, loopback and link-local ranges
Windows account lockouts3 or more lockouts (4740) on one host in 15 minutes

Privileged groups are matched by their well-known SIDs, so localized names such as *Administratoren* count too. Each finding opens one incident for its address, user or host, which you can follow in Threads.

What each event becomes#

Every mapped event gets event.category, event.action and event.outcome, observer.vendor: Microsoft, observer.product: Windows, host.name, and a short summary as its body (for example *An account failed to log on: administrator from 203.0.113.7 (Network) reason: wrong password*). The event's own time is kept.

Eventevent.actionOther fields
4624, 4625logon (success, failure)user.name, source.address, source.port, windows.logon.type, windows.logon.type_name, process.name; 4625 adds windows.failure_reason
4634logoffuser.name, windows.logon.type
4648explicit_credentials_logonuser.name, user.target.name, process.name
4672special_privileges_assigneduser.name
4720, 4722, 4725, 4726user_created, user_enabled, user_disabled, user_deleteduser.name (who), user.target.name (the account)
4728, 4732, 4756group_member_addeduser.name, user.target.name (the member), windows.group.name, windows.group.privileged
4740account_locked_outuser.target.name, windows.caller_computer
4768, 4769kerberos_tgt_requested, kerberos_service_ticket_requesteduser.name, source.address, windows.failure_reason when it failed
4771kerberos_preauth_faileduser.name, source.address, windows.failure_reason
4688process_createduser.name, process.name, process.command_line
4697, 7045service_installeduser.name, windows.service.name, windows.service.path, windows.service.account
1102audit_log_cleareduser.name
4719audit_policy_changeduser.name

The event data keeps Microsoft's own field names under windows.event_data.*, for example windows.event_data.TargetUserName and windows.event_data.LogonType. Other event ids keep windows.event.* and windows.event_data.* without event.* fields. To find every sign-in of one user across Windows, Linux and the cloud:

event.category:authentication user.name:alice

Privacy: what Windows Security events keeps#

Kept
Event id, provider, channel, level, task, keywords, hostYes
Account names, domains and SIDsYes
Source addresses and ports, workstation namesYes
Logon type, failure codes, Kerberos ticket typesYes
Process paths and command linesYes
Services installed, group members, privileges, audit policy changesYes
The rendered message and every other event data fieldNo

Logthread keeps an allow-list of event data fields and drops the rest on the server, before anything is sent. Command lines can contain secrets passed as arguments: if yours might, add a redaction pipeline (Pipelines → Library → Redact secrets) on the windows-security service, or limit who can read it (Team → Limit access).

Troubleshooting#

  • No records at all. Check the agent service runs (Get-Service LogthreadAgent) and its log at C:\ProgramData\Logthread\Agent\logs\agent.log. A line about the Security channel being denied means the agent does not run as LocalSystem: give its account the Manage auditing and security log right (Local Policies → User Rights Assignment).
  • Some routine events missing. The check on the connection page names the subcategory. Run auditpol /get /category:* on the server: if your settings are back to the old ones, a Group Policy overwrote them; set them in the GPO.
  • 4688 without a command line. Turn on *Include command line in process creation events* (registry value or GPO above). Only new processes carry it.
  • No Kerberos events. They are written by domain controllers only. Install the agent on each domain controller.
  • Too many records from busy hosts. 4624, 4634 and 4672 are the loudest, mostly from machine and service accounts. Drop what you do not need with a pipeline on the windows-security service, for example records where user.name ends in $, or turn off Logoff and Special Logon on hosts where you do not need them. Check the volume first:
service:windows-security | stats count() by windows.event.id, host.name
  • Fields not mapped. The parser runs on records that arrive after it is activated. Check the route under Pipelines → Routes, and that the records are from service windows-security.