Event ID 5156 and 5157: network connections permitted and blocked

Event ID 5156, "The Windows Filtering Platform has permitted a connection", and 5157, "The Windows Filtering Platform has blocked a connection", are written to the Security log for network connections that the Windows firewall engine allowed or blocked, with the program, the direction, the local and remote addresses and ports, and the protocol.

Security logNetworkChecked 2 December 2026

What events 5156 and 5157 record

The Windows Filtering Platform (WFP) is the engine underneath Windows Defender Firewall and many security products. With "Audit Filtering Platform Connection" enabled, it logs every connection it permits (5156) or blocks (5157). Each event names the application by its full path, written with the device form of the drive letter (\device\harddiskvolume3\windows\system32\curl.exe), the direction (inbound or outbound), the source and destination addresses and ports, the protocol number, and the filter and layer that made the decision.

That makes 5156 the built-in Windows equivalent of Sysmon's network connection event: it ties a connection to the program that made it, which firewall logs on a network device cannot do.

The cost: volume

Every DNS query, every update check and every browser connection produces a 5156, so a single workstation can write hundreds of thousands a day and roll the Security log over in hours, destroying the logon and account events you need more. The subcategory is off by default for this reason. Where it is used, organisations usually enable it only on servers, forward the events to a SIEM rather than relying on the local log, or audit only failures (5157) to catch blocked traffic.

Related events cover the rest of the picture: 5158 records a program binding to a local port, 5154 a program permitted to listen, and 5152 a packet dropped by the filter.

Turning it on without flooding the log

Filtering platform auditing is controlled by the "Audit Filtering Platform Connection" subcategory, through Group Policy (Advanced Audit Policy Configuration › Object Access) or auditpol /set /subcategory:"Filtering Platform Connection" /success:enable /failure:enable. Before enabling successes on a workstation, raise the Security log size substantially or forward it, and consider auditing failures only (/success:disable /failure:enable), which records blocked connections at a fraction of the volume. On servers that hold sensitive data, full auditing for a limited period can be a useful way to map which programs talk to which hosts.

Using 5156 and 5157 in an investigation

  • Which program talked to the attacker's address. Filter on the destination address and read the application path: curl, PowerShell, a renamed tool, or a legitimate browser.
  • Lateral movement. Inbound connections to ports 445 (SMB), 3389 (RDP), 5985 and 5986 (WinRM) and 135 (RPC) from other workstations, matched to 4624 network logons at the same time.
  • Blocked command and control. 5157 events for the same program and destination repeating at regular intervals suggest a beacon that the firewall stopped.
  • Scanning. One source address producing blocked inbound connections to many ports in seconds.

Where WFP auditing is off, the nearest substitutes are SRUM (bytes per application per hour), Sysmon event 3 where deployed, and the Windows Firewall log if it was enabled.

Event 5156 fields

The fields an investigator reads first, what they mean, and where Arcsentry stores them.

FieldMeaningArcsentry field
Application Information: Process ID, Application NameThe program, by its device path.process_pid, process_executable
Network Information: DirectionInbound or outbound.event data
Source Address, Source PortFor outbound connections, the local side; for inbound, the remote side.source_ip, source_port
Destination Address, Destination PortThe other side of the connection.destination_ip, destination_port
ProtocolIANA protocol number: 6 is TCP, 17 is UDP.event data
Filter Information: Filter Run-Time ID, Layer NameWhich firewall filter and layer made the decision.filter_id, layer

What event 5156 proves, and what it does not

It shows

  • That this program made or received this connection, with these addresses and ports, and that the filtering platform allowed (5156) or blocked (5157) it.

It does not show

  • What data was sent or how much. Use SRUM, proxy or network logs for volume.
  • Anything when Filtering Platform Connection auditing is off, which is the default.

Attacker activity it reveals

Command and control

A program in a user-writable folder making regular outbound connections to one address, or a built-in tool such as curl or PowerShell connecting to an unfamiliar host. MITRE ATT&CK T1071

Remote services

Inbound SMB, RDP or WinRM connections from a workstation that does not normally administer this host. MITRE ATT&CK T1021

Blocked attempts

5157 events show what the firewall stopped, which is often the first sign of a tool trying to reach out.

Finding event 5156 in Arcsentry

Arcsentry parses every channel in Windows\System32\winevt\Logs, whether it comes from an Arcsentry Collector archive, a KAPE or Velociraptor collection, or a disk image. Security log records are the event type evtx_security. In Hunt, with that event type selected:

filter event_code in ("5156", "5157") && destination_port in ("445", "3389", "5985", "5986")
select {timestamp, event_code, process_executable, source_ip, destination_ip, destination_port}
sort {timestamp}

Connections on remote administration ports, permitted and blocked, with the program and both addresses.

Or ask in plain English, for example "show event 5156 on every host, oldest first", and Arcsentry shows the AQL it wrote before it runs. The AQL reference lists the operators used here, and the AI investigator reads the same events, citing each one by its event ID when it reports a finding.

Related event IDs

All events by investigation question: Windows security event IDs for incident response. Logon types in full: Windows logon types. The log files themselves: Windows event logs.

Frequently asked

What does event ID 5156 mean?

The Windows Filtering Platform permitted a network connection. The event records the program, direction, source and destination addresses and ports, protocol and the filter that allowed it.

What does event ID 5157 mean?

The Windows Filtering Platform blocked a network connection, with the same details as 5156.

How can I tell which program made a connection without 5156?

Use Sysmon event 3 where Sysmon is deployed, SRUM for bytes sent and received per application per hour, or the Windows Firewall log if logging was enabled. EDR telemetry, where present, records it too.

Should I enable event 5156 on workstations?

Only with care: it produces very large volumes that can push other Security events out of the log. Forward it to a SIEM, enable it on servers only, or audit failures (5157) only.

Sources

  • Microsoft Learn: 5156(S) The Windows Filtering Platform has permitted a connection; 5157(F) The Windows Filtering Platform has blocked a connection; Audit Filtering Platform Connection
  • MITRE ATT&CK: T1071 Application Layer Protocol; T1021 Remote Services

Checked 2 December 2026 by Venema Labs against Microsoft's audit documentation and, where an example is shown, the named lab case. Field availability varies by Windows version.

Find event 5156 across every host in minutes.

Load your collections, ask what happened, and check every finding against the event behind it. Free for 7 days.

Request a trial