The knowledge base / All cheat sheets
● Always in your toolkitAbout the project ↗

Windows firewall policy inspection cheat sheet

Inspect active Windows firewall profiles, rules and port filters when investigating a blocked connection.

Windows with the NetSecurity PowerShell module; policy visibility depends on permissions.

Updated · Windows · 6 min read

CommandWhat it does
Get-NetConnectionProfileIdentify network connection profiles
Get-NetFirewallProfile -PolicyStore ActiveStoreInspect effective profile settings
Get-NetFirewallRule -PolicyStore ActiveStore -Enabled True -Direction InboundList enabled inbound rules
Get-NetFirewallRule -PolicyStore ActiveStore -DisplayName 'Example service' | Get-NetFirewallPortFilterInspect ports for a selected rule
Get-NetFirewallRule -PolicyStore ActiveStore -DisplayName 'Example service' | Get-NetFirewallAddressFilterInspect address restrictions for a selected rule

Walkthrough

Run on the affected endpoint with authorized read access. Replace the example rule display name. These commands inspect policy and do not change rules.

Step 1: Identify network connection profiles

Get-NetConnectionProfile

Record the interface and network category for the affected path. An endpoint can have multiple interfaces with different categories, so identify which one carries the incident traffic.

Step 2: Inspect effective profile settings

Get-NetFirewallProfile -PolicyStore ActiveStore

Compare enabled state and default inbound and outbound actions for the active profile. Profile settings alone do not evaluate every rule, application filter or IPsec condition.

Step 3: List enabled inbound rules

Get-NetFirewallRule -PolicyStore ActiveStore -Enabled True -Direction Inbound

Review relevant rule names, actions and profiles in the active policy store. A matching display name does not establish that every address, port or program filter matches the connection.

Step 4: Inspect ports for a selected rule

Get-NetFirewallRule -PolicyStore ActiveStore -DisplayName 'Example service' | Get-NetFirewallPortFilter

Replace the display name with the confirmed rule. Check protocol and local and remote port filters, then separately inspect address, program, service and profile conditions.

Step 5: Inspect address restrictions for a selected rule

Get-NetFirewallRule -PolicyStore ActiveStore -DisplayName 'Example service' | Get-NetFirewallAddressFilter

Compare allowed local and remote address ranges with the actual flow. Effective policy can include multiple rules, block rules and other conditions; this is not a complete effective-access calculation.

WORKED INCIDENT

Practical case: A service is reachable from one subnet only

Fictional teaching scenario; observations are examples, not captured production output.

Situation

A Windows service accepts connections from one approved subnet but not another.

Investigation sequence

1. Identify network connection profiles

Get-NetConnectionProfile

Identify the network profile on the interface carrying the affected connection.

2. Inspect effective profile settings

Get-NetFirewallProfile -PolicyStore ActiveStore

Review effective defaults for that profile in the active store.

3. Inspect ports for a selected rule

Get-NetFirewallRule -PolicyStore ActiveStore -DisplayName 'Example service' | Get-NetFirewallPortFilter

Check the relevant service rule protocol and port filter.

4. Inspect address restrictions for a selected rule

Get-NetFirewallRule -PolicyStore ActiveStore -DisplayName 'Example service' | Get-NetFirewallAddressFilter

Compare the rule remote address filter with both client subnets.

Example findings

Illustrative findings: the rule covers the correct TCP port but its remote address filter includes only the working subnet.

Interpret the findings

The address restriction is a supported explanation in this example. Other matching block rules or network controls still need consideration before changing policy.

Verify the outcome

After the policy owner approves a scoped correction, test from both authorized subnets and inspect the active rule again.

Escalation handoff

Provide the endpoint, interface profile, connection tuple and relevant sanitized rule filters to the security owner.

Primary references

Documented reference; examples above are teaching scenarios. Confirm behavior against your deployed version.