Skip to main content
orphan · azure

Flow logs on a GatewaySubnet whose network already has an unfiltered VNet flow log

rule IDs covered
1
severity
medium

What does ZopNight detect here?

A flow log attached to the `GatewaySubnet` records the traffic crossing a VPN or ExpressRoute gateway, and for ExpressRoute it misses outbound VM-to-circuit flows. ZopNight flags such a log only when an unfiltered virtual network flow log already covers the same network, and reports the gateway subnet log's full cost as the saving.

Signal and threshold

How ZopNight evaluates Flow logs on a GatewaySubnet whose network already has an unfiltered VNet flow log.
Field Value
Rule IDsRC-1402
Categoryorphan
Severitymedium
Metricnone — pure configuration read
Thresholdcovering unfiltered VNet flow log exists
SourceZopNight
Permissions usedMicrosoft.Network/networkWatchers/flowLogs/read · Microsoft.Network/virtualNetworks/read

Why gateway subnet logging is expensive and incomplete

Traffic that enters or leaves a network through its VPN or ExpressRoute gateway passes through the GatewaySubnet, so a log there collects all of it, and flow logs are billed per GB collected. It also has a documented blind spot. Microsoft’s VNet flow logs overview states that outbound flows from VMs to an ExpressRoute circuit are not recorded when flow logging is enabled on the ExpressRoute gateway subnet, and that with FastPath enabled traffic bypasses the gateway and is not recorded there either. Those flows must be recorded at the VM’s subnet or NIC.

The same GatewaySubnet name is used for VPN gateways, so the FastPath point applies only when the gateway is ExpressRoute. The cost argument applies to both.

Spotting gateway subnet logs

Terminal window
az network watcher flow-log list --location <region> \
--query "[?contains(targetResourceId, 'GatewaySubnet')].{name:name, enabled:enabled, target:targetResourceId}" \
-o table

For each result, strip the /subnets/GatewaySubnet suffix from the target to get the owning virtual network, and check whether that network has its own enabled flow log.

The redundancy test ZopNight applies

  1. The flow log is enabled and its target is a gateway subnet.
  2. The owning virtual network is derived from the subnet’s resource ID.
  3. Another enabled flow log targets that virtual network as a whole.
  4. That covering log is proven to have no filtering criteria, since a filtered log records only matching flows and is not full coverage.
  5. The gateway subnet log has a positive price.

When it stays quiet

If no network-level log covers the network, there is no finding, even though the gateway subnet log may still be poor value. Moving collection to the VM subnets is not automatically a saving: you would pay to collect those same flows somewhere else, and the net change is unknown. Only proven redundancy makes the whole figure defensible. NSG-level duplicates are handled by Azure Duplicate Flow Logging.

What removing it recovers

Terminal window
saving = full monthly cost of the gateway subnet flow log
cost after fix = 0

The network-level log keeps recording every subnet and interface in the network, gateway traffic included, so no visibility is lost.

Consolidating onto the network-level log

  1. Confirm the covering VNet flow log is healthy and delivering data to its storage account.
  2. If traffic analytics was enabled on the gateway subnet log, enable it on the network-level log.
  3. Delete the gateway subnet log: az network watcher flow-log delete --location <region> --name <flow-log>.
  4. If gateway traffic must be audited separately, capture it at the VM subnets or NICs rather than on the gateway subnet, as Microsoft advises for ExpressRoute.

See it fire on your bill.

Connect an account read-only. The first findings land in minutes.

472 rule families across 353 resource types on 22 platforms. Every threshold, metric, and IAM action is documented on these pages before you grant anything.

472 rule families documented
353 resource types covered
read-only default access level
Multi-cloud automation· Production-ready in 30 min· SOC 2 · ISO 27001· 20–60% off the bill, first month· 4 platforms · 1 console· Multi-cloud automation· Production-ready in 30 min· SOC 2 · ISO 27001· 20–60% off the bill, first month· 4 platforms · 1 console·