wfp

package
v1.11.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 23, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Rendered for windows/amd64

Overview

Package wfp installs Windows Filtering Platform (WFP) PERMIT filters in a dynamic, session-scoped sublayer. Because WFP sits below Windows Defender Firewall, a high-weight permit at FWPM_LAYER_ALE_AUTH_RECV_ACCEPT_V4/V6 lets the matching inbound traffic through regardless of WDF rules.

Each Session owns its own engine handle. When the handle closes, every dynamic object added during the session is auto-deleted by Windows, so there are no orphaned filters.

Type definitions and constants are derived from the wireguard-windows firewall package (MIT). Only the subset we exercise is reproduced.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Session

type Session struct {
	// contains filtered or unexported fields
}

Session holds the WFP engine handle for a single bypass operation. The handle owns a dynamic session: when it is closed, every WFP object added during the session (sublayer + filters) is automatically deleted by Windows. That gives us correct cleanup even if the host process is killed hard between Permit* and Close.

func PermitInterface

func PermitInterface(luid uint64) (*Session, error)

PermitInterface installs PERMIT filters at FWPM_LAYER_ALE_AUTH_RECV_ACCEPT_V4 and _V6 scoped to the given network interface LUID. Inbound traffic on that interface bypasses Windows Defender Firewall.

func PermitUDPPort

func PermitUDPPort(port uint16) (*Session, error)

PermitUDPPort installs PERMIT filters at FWPM_LAYER_ALE_AUTH_RECV_ACCEPT_V4 and _V6 scoped to UDP traffic with the given local port. Inbound UDP to that port on any interface bypasses Windows Defender Firewall.

func (*Session) Close

func (s *Session) Close()

Close releases the engine handle. Windows deletes every dynamic object (sublayer + filters) the session installed. Safe to call on a nil receiver.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL