Skip to content

Conversation

@Alan-Jowett
Copy link
Member

Description

This PR introduces a comprehensive design document for eBPF for Windows Listen Hook functionality, which enables intercepting and controlling socket listen operations through the Windows Filtering Platform (WFP) ALE Authorization Listen layers. The proposal defines a new BPF_PROG_TYPE_SOCK_LISTEN program type with IPv4 and IPv6 attach types (BPF_CGROUP_INET4_LISTEN and BPF_CGROUP_INET6_LISTEN), complete with unique GUID identifiers for Windows integration. The hook provides access to comprehensive socket and process information through a dedicated bpf_sock_addr_listen_t context structure and helper functions, enabling security solutions to implement port access control, process whitelisting, network monitoring, and resource management policies. The design integrates seamlessly with existing eBPF for Windows infrastructure while leveraging WFP's granular control capabilities, offering verdict-based control (reject, proceed soft/hard) over listen operations with minimal performance impact, making it suitable for enterprise security products and network monitoring solutions.

Testing

N/A

Documentation

Yes

Installation

N/A

Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
Copy link
Member

@keith-horton keith-horton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Initial feedback

Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
@Alan-Jowett Alan-Jowett marked this pull request as draft October 27, 2025 23:32
@dthaler
Copy link
Collaborator

dthaler commented Oct 27, 2025

I'll observe that this PR passed all checks but the check should have posted a warning in a comment. Specifically,
https://github.com/microsoft/ebpf-for-windows/actions/runs/18857561079/job/53809000202?pr=4761 should have added a warning comment, but didn't due to a bug in the check (expand "Validate issue references" to see the error it hit... the bug in the check is issue #4726).

- **LSM hooks**: Linux Security Module hooks for socket operations

However, these approaches have limitations:
- Linux hooks operate at different abstraction levels than Windows WFP
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you elaborate on this? Maybe just give an example?

However, these approaches have limitations:
- Linux hooks operate at different abstraction levels than Windows WFP
- Different network stack architecture between Linux and Windows
- Linux cgroup model doesn't directly map to Windows process/session model
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That didn't stop us from using BPF_PROG_TYPE_CGROUP_SOCK_ADDR or BPF_PROG_TYPE_CGROUP_SOCK_OPS.


However, these approaches have limitations:
- Linux hooks operate at different abstraction levels than Windows WFP
- Different network stack architecture between Linux and Windows
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As phrased this seems to be an internal implementation detail. Can you rephrase into something that is API-visible?

- Linux hooks operate at different abstraction levels than Windows WFP
- Different network stack architecture between Linux and Windows
- Linux cgroup model doesn't directly map to Windows process/session model
- WFP provides more granular control and integration with Windows security model
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems vague. Can you elaborate here on why you can't use the Linux progtype, say with additional helper functions? E.g., is the set of return values necessarily different from the program compared to what the Linux progtypes have?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants