6 min read
Created on

Azure Local - Azure Arc Gateway - Part 4 - Harden outbound firewall rules


Intro

This article is part of a series: Navigate to series page

Once Arc Gateway is enabled and verified in Part 3c, I want to remove redundant direct Azure access and constrain the gateway connection to the local Arc proxy.

There is an important caveat: “only Arc proxy can communicate externally” is not a valid blanket rule for every Azure Local protocol and dependency. We need a narrow gateway-egress policy plus explicit exceptions for traffic that must use another path.

This is a policy design and validation guide, not a tested, ready-made firewall policy for a specific Azure Local release. The PowerShell rule below uses example values and -WhatIf; validate your complete policy and collect allow/deny evidence in a representative test environment before enforcing it.

Define the policy precisely

My target is:

  • Supported HTTPS uses the local Arc proxy and gateway tunnel.
  • Only the approved Arc proxy process can establish the host’s gateway/proxy egress connection.
  • Unneeded direct external access by other host processes is denied.
  • Required HTTP, local bypass, fallback destinations, and internal infrastructure traffic remain explicitly permitted.
  • Resource bridge and AKS have restricted access to the cluster-IP proxy.
  • VM and pod egress is governed separately.

A proxy setting chooses a route for proxy-aware software. It does not stop a process from opening a direct socket. Enforcement requires host firewall rules, network firewall rules, or both.

Understand what each firewall can enforce

An upstream firewall normally sees the Azure Local source IP and destination FQDN or IP. It cannot distinguish arcproxy.exe from another executable using the same host IP.

On the host, Windows Defender Firewall can apply program-scoped rules. That is where process-level restrictions belong. At the perimeter, use source restrictions and destination allowlists.

If the perimeter permits the gateway URL from a host IP, that rule alone does not prove that only Arc proxy can connect. Likewise, an outbound allow rule for Arc proxy does not restrict other applications if the effective profile still allows outbound traffic by default.

Step 1 - Save and inspect the existing policy

Work with the Azure Local and security administrators. Do not replace the product’s managed security baseline with a generic internet-lockdown script.

From an elevated host session, save a baseline and inspect the effective rules:

netsh advfirewall export 'C:\MASLogs\firewall-before-arc-gateway.wfw'

Get-NetFirewallProfile -PolicyStore ActiveStore |
    Format-Table Name, Enabled, DefaultInboundAction, DefaultOutboundAction

Get-NetFirewallRule -PolicyStore ActiveStore -Enabled True -Direction Outbound |
    Format-Table DisplayName, Action, Profile, PolicyStoreSourceType

Confirm that the export succeeded and protect it as an administrative artifact. If policy is centrally managed, save the corresponding GPO or management-policy version too. A local export alone does not provide rollback for centrally enforced policy.

Identify broad outbound allow rules, internal cluster dependencies, DNS, time, domain services, monitoring, certificate validation, OEM services, and emergency administration paths.

Keep out-of-band access and a tested policy rollback procedure available before enforcing changes.

Step 2 - Identify the actual Arc proxy executable

Do not guess the executable path from another agent version:

$arcProxyService = Get-CimInstance Win32_Service -Filter "Name='arcproxy'"
if ($null -eq $arcProxyService -or $arcProxyService.State -ne 'Running') {
    throw 'The Arc proxy service must be present and running before policy planning.'
}

$arcProxyProcess = Get-Process -Id $arcProxyService.ProcessId -ErrorAction Stop
$arcProxyExecutable = $arcProxyProcess.Path
if ([string]::IsNullOrWhiteSpace($arcProxyExecutable)) {
    throw 'Unable to resolve the Arc proxy executable path. Check elevation and service state.'
}

$arcProxyService | Format-List Name, State, PathName, ProcessId
$arcProxyExecutable

Confirm the binary belongs to the installed Azure Connected Machine agent. Recheck the policy after agent updates if the executable path changes.

For an environment with a fixed enterprise proxy endpoint, this illustrates a program-scoped allow rule:

$enterpriseProxyIp = '192.0.2.10'
$enterpriseProxyPort = 8080

New-NetFirewallRule `
    -DisplayName 'Arc proxy to approved enterprise proxy' `
    -Direction Outbound `
    -Action Allow `
    -Program $arcProxyExecutable `
    -Protocol TCP `
    -RemoteAddress $enterpriseProxyIp `
    -RemotePort $enterpriseProxyPort `
    -Profile Any `
    -WhatIf

192.0.2.10 and 8080 are example values, not a working proxy. Replace them with the approved endpoint. -WhatIf does not install the rule or test connectivity. Only remove it as part of a reviewed, complete policy change.

This rule permits Arc proxy to reach the enterprise proxy. The enterprise proxy must still restrict the permitted gateway and fallback FQDNs.

For direct gateway egress, use your firewall’s supported FQDN enforcement mechanism. Do not put the gateway FQDN into a classic -RemoteAddress IP rule or pin one DNS result permanently; gateway addresses can change.

Step 3 - Preserve the complete exception set

Build the expected allow set before removing rules:

PathWhat must remain
Gateway tunnelAssigned gateway URL on TCP 443, or the approved upstream proxy connection
Registration and non-redirected Azure dependenciesCurrent region-specific requirements and actual Key Vault/storage endpoints
HTTP certificate checksRequired HTTP endpoints over their intended non-tunneled route
Local bypassInternal and private destinations over the intended source-subnet route
Gateway bypass and unsupported HTTPSApproved fallback/enterprise proxy paths
Infrastructure communicationsCluster, domain, DNS, time, storage, management, and applicable cross-subnet ports
Existing workloadsTheir currently required paths until separately migrated and verified

Use the current Azure Local non-redirected endpoint guidance, not an assumption that seven endpoints cover the whole system.

An Arc proxy fallback connection is still external egress, even though it does not use the gateway tunnel. Permit only the fallback destinations needed by your services.

Step 4 - Enforce in a controlled policy window

  1. Establish the complete required allow rules and rollback access.
  2. Audit the effective policy for broad rules that would defeat process restrictions.
  3. Have the owning team apply the approved default-deny outbound policy, if supported for this deployment, and narrow the redundant broad allows.
  4. Remove gateway-redundant destination rules in stages, not all at once.
  5. Observe for 24-48 hours between endpoint-removal stages.
  6. Restore the most recently removed rule category immediately if a dependency fails.

Do not add an explicit “block all TCP 443” rule and expect an Arc proxy allow rule to override it. Explicit Windows Firewall block rules take precedence over conflicting allow rules. Default-deny with specific allows is a different policy model.

Microsoft’s guidance describes endpoint allowlist reduction; it is not an endorsement of an arbitrary custom process-lockdown policy on Azure Local. Validate the host restrictions against your release’s managed configuration and support requirements.

Step 5 - Restrict proxy consumers without breaking failover

Permit TCP 40343 to the cluster-IP proxy only from the required infrastructure and AKS sources. Preserve all other documented management ports.

The host serving that cluster IP can change. A rule allowing only the current owner creates a failover problem. Include every eligible owner in the reviewed host policy and validate the path after a planned ownership change in a nonproduction test or approved window.

Ordinary guest VMs use their own Arc proxy. Do not grant every VM subnet access to the infrastructure proxy simply because resource bridge uses it.

Step 6 - Prove both allowed and denied behavior

Repeat the checks from Part 3c after each stage. Also test that an unapproved process cannot reach a previously permitted external destination directly, while Arc proxy still reaches the gateway.

Use an approved benign HTTPS test destination and correlate process, host, time, and deny logs. A request can fail because of DNS or the remote server, so failure alone is not proof that your firewall blocked it.

Then verify fresh extension activity, certificate validation, resource bridge management, and representative workloads. Include failover and lifecycle operations in the applicable lab or maintenance-window checks.

Final remark

I would harden around Arc proxy, not pretend Arc Gateway transports every dependency. Process restrictions on the host and destination restrictions upstream solve different problems, and both need evidence.

Next, I will cover gateway enablement inside Azure Local virtual machines.