Under AppLocker enforcement a file was prevented from running. Records the full file path, hash, publisher (Fqbn) and the target user.
A block is a strong signal: either a legitimate misconfiguration or an attacker's tool stopped from executing. Repeated 8004 from one user or host suggests attempted execution of disallowed tooling — often unsigned payloads in temp/AppData.
Alert on 8004 clusters. Capture file path, publisher and user. Prioritise blocked binaries in user-writable paths and known offensive tools. A single expected block plus many unexpected ones is the pattern to watch.
FullFilePathFileHashFqbnTargetUser | Tactic | Technique |
|---|---|
| Execution | Malicious File (T1204.002) |
Starting points — adapt the log source, projected fields and thresholds for your environment.
title: AppLocker Enforcement Block
status: stable
logsource:
product: windows
service: applocker
detection:
sel:
EventID: 8004
condition: sel
level: high
Event
| where EventLog == "Microsoft-Windows-AppLocker/EXE and DLL" and EventID == 8004 // AppLocker blocked a file (enforce)
// EventData holds: FullFilePath, FileHash, Fqbn, TargetUser
| project TimeGenerated, Computer, RenderedDescription
| sort by TimeGenerated desc
index=* sourcetype="WinEventLog:Microsoft-Windows-AppLocker/EXE and DLL" EventCode=8004
| stats count earliest(_time) as first_seen latest(_time) as last_seen by ComputerName
| sort - count `# AppLocker blocked a file (enforce) — add EventData fields: FullFilePath, FileHash, Fqbn, TargetUser`
AppLocker blocked a file (enforce). Under AppLocker enforcement a file was prevented from running. Records the full file path, hash, publisher (Fqbn) and the target user.
Event 8004 is written to the Microsoft-Windows-AppLocker/EXE and DLL channel by Microsoft-Windows-AppLocker. Configure AppLocker rules (Audit or Enforce) via GPO; events land in the AppLocker/EXE and DLL channel.
Event 8004 is associated with: Malicious File (T1204.002).
Alert on 8004 clusters. Capture file path, publisher and user. Prioritise blocked binaries in user-writable paths and known offensive tools. A single expected block plus many unexpected ones is the pattern to watch.