Windows Firewall & Network Protection via Intune
Configure host-based firewall profiles (Domain, Private, Public), rule merging logic, and SmartScreen Network Protection to safeguard endpoints against network intrusions.
Overview
Microsoft Defender Firewall with Advanced Security provides two-way host-based stateful packet inspection on Windows endpoints.
Managing Firewall through Microsoft Intune Endpoint Security policies provides centralized governance:
- Three Profile Segmentation: Individual settings for Domain (connected to corporate network), Private (home/trusted LAN), and Public (cafes, airports, untrusted Wi-Fi).
- Rule Merging Control: Dictates whether local administrator-created firewall rules or third-party installer rules are merged with corporate Intune baselines (
RuleMerger). - Network Protection (SmartScreen): Extends Microsoft Defender SmartScreen protection to block outbound network connections to known phishing domains, C2 servers, and low-reputation IP addresses across ALL applications (not just Edge browser).
---
When to Use
| Capability | Recommended Setting | Production Rationale |
|---|---|---|
| Inbound Connections | Block All (Default) | Protects endpoints from lateral network scanning and worms when working from untrusted Wi-Fi. |
| Outbound Connections | Allow (Default) | Permits legitimate user internet traffic while monitoring via Network Protection. |
| Local Firewall Rules Merge | Block / Disable | Prevents local users and installers from punching unauthorized holes in the firewall. |
| Network Protection | Enabled (Block Mode) | Intercepts rogue DNS/HTTP/HTTPS calls from PowerShell, malware payloads, or non-browser tools. |
---
Prerequisites
Tenant & Licensing Requirements:
- Intune License: Microsoft 365 E3/E5, Business Premium, or standalone Intune Plan 1.
- Admin Role: Endpoint Security Manager or Intune Administrator.
Endpoint Requirements:
- Windows 11 or Windows 10 (1709+ for basic firewall; 1803+ for Network Protection).
- Windows Defender Antivirus real-time protection must be active (Network Protection hooks into Defender AV network filter driver
WdFilter.sys).
---
Portal Path
Microsoft Intune Admin Center (https://intune.microsoft.com)
└── Endpoint security
├── Firewall
│ ├── Create Policy > Windows 10, Windows 11, and Windows Server
│ │ ├── Profile: Microsoft Defender Firewall (Profile states & rule merging)
│ │ └── Profile: Microsoft Defender Firewall rules (Custom inbound/outbound rules)
└── Attack surface reduction
└── Create Policy > Windows 10 and later
└── Profile: Web protection / Network Protection---
Step-by-Step Implementation
Step 1: Configure Firewall Base Profile & Rule Merging
- In Intune, navigate to Endpoint security > Firewall > Create Policy.
- Platform:
Windows 10, Windows 11, and Windows Server| Profile:Microsoft Defender Firewall. - Name the policy:
Sec-Firewall-Enterprise-Baseline. - Configure settings across Domain, Private, and Public profiles:
- Turn on Defender Firewall:
True. - Default inbound action:
Block. - Default outbound action:
Allow. - Shielded (Block all incoming connections, including rules): Set to
Truefor Public profile. - Disable rule merge from local policy:
True(Locks down firewall against local overrides).
- Assign to
All Corporate Devices.
Step 2: Create Custom Firewall Inbound Rules
- Under Endpoint security > Firewall, click Create Policy.
- Platform:
Windows 10, Windows 11, and Windows Server| Profile:Microsoft Defender Firewall rules. - Click Add Rule (e.g., allow enterprise remote support tool):
- Name:
Allow-Internal-Admin-SSH - Direction:
Inbound - Action:
Allow - Network types:
Domain,Private - Protocol:
TCP(Port22) - Local address:
Any| Remote address:10.50.0.0/16(Management subnet).
Step 3: Enable Network Protection (SmartScreen Web Defense)
- Go to Endpoint security > Attack surface reduction > Create Policy.
- Profile:
Attack Surface Reduction Rules(orWeb Protection). - Find setting: Enable network protection > Set to Enabled (Block).
- Save and assign to all Windows devices.
---
PowerShell Automation
Inspect Active Firewall Profile State Locally:
# Query status of all 3 firewall profiles
Get-NetFirewallProfile | Select-Object Name, Enabled, DefaultInboundAction, DefaultOutboundAction, AllowInboundRules, AllowLocalFirewallRules
# Check if Network Protection is actively running in Block mode
Get-MpPreference | Select-Object EnableNetworkProtection(EnableNetworkProtection value 1 = Enabled/Block; 2 = Audit mode).
Test Network Protection with Microsoft Evaluation URL:
# Attempt network handshake against Microsoft safe evaluation test site
# This will be blocked and log Event ID 1125/1126
Invoke-WebRequest -Uri "https://smartscreentestratings2.net" -UseBasicParsing---
Microsoft Graph Automation
Query Firewall Policy Settings via Graph:
Connect-MgGraph -Scopes "DeviceManagementConfiguration.Read.All"
# List all Endpoint Security Firewall policies
Get-MgDeviceManagementIntent |
Where-Object { $_.DisplayName -like "*Firewall*" } |
Select-Object id, displayName, description, lastModifiedDateTime---
Verification Checklist
Diagnostic Logs & Channels
| Channel / Tool | Log Location | Purpose |
|---|---|---|
| Firewall Advanced Security Log | Applications and Services Logs > Microsoft > Windows > Windows Firewall With Advanced Security > Firewall | Logs rule additions, profile changes, and dropped packet events (Event IDs 2003, 2004). |
| Network Protection Operational Log | Applications and Services Logs > Microsoft > Windows > Windows Defender > Operational | Records network blocks (Event ID 1125 = Block; Event ID 1126 = Audit). |
| Firewall Dropped Packet Log | C:\Windows\System32\LogFiles\Firewall\pfirewall.log | Detailed text log of dropped TCP/UDP packets when logging is enabled. |
---
Troubleshooting Matrix
| Error Code / Symptom | Root Cause | Exact Resolution |
|---|---|---|
| Event ID 2003: Rule skipped | Conflicting GPO exists on machine that takes precedence over Intune MDM policy. | Use MDM wins over GPO policy setting (ControlPolicyConflict/MDMWinsOverGPO = 1) or remove old GPOs. |
| Network Protection blocks legitimate business site | False positive in SmartScreen cloud reputation intelligence. | Add URL/IP to Tenant Allow/Block Lists at security.microsoft.com under Indicators (URLs/Domains). |
| Local apps break after firewall policy | DisableRuleMerge was set to True, blocking rules created automatically by installed apps. | Identify required application ports and author explicit Intune Firewall Rules for those applications. |
---
Production Best Practices
Stage Network Protection in Audit Mode First:
Before setting Enable Network Protection to Block, deploy it in Audit Mode (2) for 14 days. Review Windows Defender Event ID 1126 in your central SIEM/Log Analytics to catch any internal line-of-business applications communicating with low-reputation IP ranges.
---
MD-102 Exam Notes
High-Frequency Exam Objectives & Traps:
- Rule Merge Precedence: If AllowLocalFirewallRules is set to
False, only Intune MDM rules apply; all locally defined rules are completely ignored. - Network Protection Scope: Network Protection operates at the network packet layer (IP/Winsock) and protects ALL processes (including cURL, PowerShell, and third-party browsers like Chrome/Firefox).
- Public Profile Shielding: Setting
ShieldedtoTrueblocks all incoming traffic regardless of whether an explicit Allow rule exists.
---