Intune: Windows Firewall Public - Default Inbound Block

πŸ’Ό Management Samenvatting

Windows Firewall Public: Default inbound = BLOCK ALL - strictest setting (public WiFi = zero trust).

Aanbeveling
IMPLEMENT IMMEDIATELY
Risico zonder
Critical
Risk Score
10/10
Implementatie
2u (tech: 1u)
Van toepassing op:
βœ“ Windows 10
βœ“ Windows 11

Public network = hostile: Attacker on same WiFi β†’ port scans, exploit attempts, lateral movement tries, Default block: ALL unsolicited inbound BLOCKED (attacker finds NOTHING), Allow rules: MINIMAL (VPN client only - no SMB, no RDP), Zero Trust: Public WiFi = completely untrusted (block everything by default).

PowerShell Modules Vereist
Primary API: Microsoft Graph API
Connection: Connect-MgGraph
Required Modules: Microsoft.Graph.DeviceManagement

Implementatie

Default inbound block: Policy: Default inbound action: Block, Effect: ALL inbound blocked (except explicit allow rules), Outbound: Allow (web browsing, email, VPN), Exceptions: VPN client (if needed - minimal).

Vereisten

  1. Intune subscription
  2. Windows 10/11
  3. Public firewall enabled

Implementatie

Intune Settings Catalog: Windows Firewall β†’ Public Profile β†’ Default Inbound Action: Block. Minimal allow rules (VPN only).

Compliance

CIS Windows Benchmark L1, Zero Trust, BIO 13.01.

Monitoring

Gebruik PowerShell-script enable-public-network-firewall-default-inbound-action-for-public-profile-is-set-to-block.ps1 (functie Invoke-Monitoring) – Controleren.

Remediatie

Gebruik PowerShell-script enable-public-network-firewall-default-inbound-action-for-public-profile-is-set-to-block.ps1 (functie Invoke-Remediation) – Herstellen.

Compliance & Frameworks

Automation

Gebruik het onderstaande PowerShell script om deze security control te monitoren en te implementeren. Het script bevat functies voor zowel monitoring (-Monitoring) als remediation (-Remediation).

PowerShell
<# .SYNOPSIS Intune Windows Firewall: Public Inbound Block .DESCRIPTION CIS - Public profile inbound MOET blocked. .NOTES Filename: firewall-public-inbound.ps1|Author: Nederlandse Baseline voor Veilige Cloud|NetSH: Public DefaultInboundAction|Expected: Block #> #Requires -Version 5.1 #Requires -RunAsAdministrator [CmdletBinding()]param([switch]$WhatIf, [switch]$Monitoring, [switch]$Remediation, [switch]$Revert) $ErrorActionPreference = 'Stop'; $Profile = "Public"; $ExpectedAction = "Block" function Connect-RequiredServices { $p = New-Object Security.Principal.WindowsPrincipal([Security.Principal.WindowsIdentity]::GetCurrent()); return $p.IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator) } function Test-Compliance { $r = [PSCustomObject]@{ScriptName = "firewall-public-inbound.ps1"; PolicyName = "Firewall Public Inbound"; IsCompliant = $false; CurrentValue = $null; ExpectedValue = $ExpectedAction; Details = @() }; function Invoke-Revert { Set-NetFirewallProfile -Name $Profile -DefaultInboundAction Allow } try { $fw = Get-NetFirewallProfile -Name $Profile -ErrorAction SilentlyContinue; if ($fw) { $r.CurrentValue = $fw.DefaultInboundAction; if ($fw.DefaultInboundAction -eq $ExpectedAction) { $r.IsCompliant = $true; $r.Details += "Public inbound: Block" }else { $r.Details += "Public inbound: $($fw.DefaultInboundAction) - RISK" } }else { $r.Details += "Profile niet gevonden" } }catch { $r.Details += "Error: $($_.Exception.Message)" }; return $r } function Invoke-Remediation { Set-NetFirewallProfile -Name $Profile -DefaultInboundAction Block; Write-Host "Public inbound: Block" -ForegroundColor Green } function Invoke-Monitoring { $r = Test-Compliance; Write-Host "`n$($r.PolicyName): $(if($r.IsCompliant){'COMPLIANT'}else{'NON-COMPLIANT'})" -ForegroundColor $(if ($r.IsCompliant) { 'Green' }else { 'Red' }); return $r } function Invoke-Revert { Set-NetFirewallProfile -Name $Profile -DefaultInboundAction Allow } try { if (-not(Connect-RequiredServices)) { exit 1 }; if ($Monitoring) { $r = Invoke-Monitoring; exit $(if ($r.IsCompliant) { 0 }else { 1 }) }elseif ($Remediation) { if (-not $WhatIf) { Invoke-Remediation } }elseif ($Revert) { Invoke-Revert }else { $r = Test-Compliance; exit $(if ($r.IsCompliant) { 0 }else { 1 }) } }catch { Write-Error $_; exit 1 }

Risico zonder implementatie

Risico zonder implementatie
Critical: KRITIEK: No default block = attacker on public WiFi can reach laptop.

Management Samenvatting

Public firewall: Default inbound BLOCK. Zero trust public WiFi. Implementatie: 1-2 uur.