Azure networking audit

From LeoYeAI/openclaw-master-skills · View interactive version

Azure networking audit is an AI agent skill from the GitHub repository LeoYeAI/openclaw-master-skills. Azure VNet networking audit covering address space design, NSG rule evaluation, Azure Firewall policy analysis, ExpressRoute and VPN Gateway connectivity, VNet Peering topology, and UDR validation using read-only Azure CLI commands.

How to use this skill

Skill file

Azure VNet Networking Security Audit

Cloud resource audit for Azure Virtual Network (VNet) architecture,

network security posture, and hybrid connectivity. This skill evaluates

provider-specific Azure networking constructs — VNet design, NSG priority-

based rules, Azure Firewall rule collection groups, ExpressRoute circuits,

VNet Peering topology, UDR forced tunneling, and Application Gateway

placement — not generic cloud networking advice.

Scope covers VNet-layer networking: address space planning, subnet

delegation, NSG filtering, Azure Firewall inspection, hybrid connectivity

via ExpressRoute and VPN Gateway, and route management. Out of scope:

Azure Front Door CDN policies, Azure WAF custom rule authoring,

application-layer routing in Application Gateway path rules, and Azure

DNS zone management. Reference references/cli-reference.md for read-only

Azure CLI commands organized by audit step, and references/vnet-architecture.md

for the VNet packet flow model, NSG evaluation order, and ExpressRoute

routing architecture.

When to Use

Prerequisites

Procedure

Follow these six steps sequentially. Each step builds on prior findings,

moving from inventory through security analysis to optimization.

Step 1: VNet Inventory and Design Assessment

Enumerate all VNets in the target subscription and assess architectural design.

az network vnet list --output table
az network vnet show --name <vnet-name> --resource-group <rg>
az network vnet subnet list --vnet-name <vnet-name> --resource-group <rg>

For each VNet, evaluate:

Step 2: NSG Rule Audit

Audit Network Security Groups using Azure's priority-based evaluation model.

az network nsg list --output table
az network nsg rule list --nsg-name <nsg-name> --resource-group <rg> --include-default --output table

NSG rules evaluate by priority (lowest number = highest priority, range 100–4096). First match wins.

Step 3: Azure Firewall and Network Security

Evaluate Azure Firewall policies, rule collection groups, and threat intelligence.

az network firewall list --output table
az network firewall policy rule-collection-group list --policy-name <policy> --resource-group <rg>

Step 4: Connectivity Analysis

Evaluate hybrid and inter-VNet connectivity through ExpressRoute, VPN Gateway, and VNet Peering.

ExpressRoute:

az network express-route show --name <circuit> --resource-group <rg>
az network express-route peering list --circuit-name <circuit> --resource-group <rg>

VPN Gateway:

az network vpn-connection show --name <conn> --resource-group <rg>

VNet Peering:

az network vnet peering list --vnet-name <vnet> --resource-group <rg> --output table

Step 5: UDR and Routing Validation

Audit User-Defined Routes for correctness, forced tunneling, and conflicts.

az network route-table list --output table
az network route-table route list --route-table-name <rt> --resource-group <rg>
az network nic show-effective-route-table --name <nic> --resource-group <rg>

Step 6: Report and Optimization

Compile findings and identify resource optimization opportunities.

az network nic list --query "[?virtualMachine==null]" --output table
az network public-ip list --query "[?ipConfiguration==null]" --output table

Compile the findings report using the Report Template section.

Threshold Tables

NSG Rule Severity

| Finding | Severity | Rationale |

|---------|----------|-----------|

| NSG allows SSH (22) from Internet | Critical | Direct shell access from internet |

| NSG allows RDP (3389) from Internet | Critical | Remote desktop open to internet |

| NSG allows all ports from * source | Critical | No port or source restriction |

| NIC with no NSG, subnet NSG allows broad access | High | No NIC-level filtering |

| Allow rule at lower priority than conflicting Deny | High | Priority ordering undermines deny intent |

| NSG allows database ports from non-app subnets | High | Database access not restricted to app tier |

| NSG with >50 custom rules | Medium | Excessive complexity |

| NSG not associated with any subnet or NIC | Medium | Unused — cleanup candidate |

ExpressRoute Circuit Health

| Metric | Severity | Action |

|--------|----------|--------|

| Circuit status NotProvisioned | Critical | No connectivity — engage provider |

| BGP peering state Idle | High | Negotiation failure — check ASN and VLAN |

| Learned routes missing expected prefixes | High | On-prem routes not advertised |

| Circuit utilization >80% sustained | Medium | Plan upgrade or second circuit |

Subnet Utilization

| Available IPs (% of address space) | Severity | Action |

|-------------------------------------|----------|--------|

| <10% remaining | High | Exhaustion risk — plan expansion |

| 10–25% remaining | Medium | Monitor growth proactively |

| >75% unused | Low | Over-provisioned |

Decision Trees

Is This NSG Rule Overly Permissive?

NSG rule under review
├── Source is * or Internet service tag?
│   ├── Yes
│   │   ├── Port = 22 (SSH) or 3389 (RDP)?
│   │   │   ├── Yes → CRITICAL: Use Azure Bastion instead
│   │   │   └── No
│   │   │       ├── Port = 443 on Application Gateway subnet?
│   │   │       │   ├── Yes → Acceptable for public services
│   │   │       │   └── No → HIGH: Review necessity
│   │   │       └── Port = * (all)?
│   │   │           └── CRITICAL: All ports open
│   │   └── Higher-priority Deny covering same traffic?
│   │       ├── Yes → Verify Deny priority < Allow priority
│   │       └── No → Classify severity by port
│   └── No (specific CIDR or ASG)
│       ├── ASG? → Review ASG membership scope
│       └── Broad CIDR (/8, /16)? → Medium — verify intent

Is This VNet Design Following Azure Best Practices?

VNet under review
├── Hub-spoke topology?
│   ├── No → Acceptable for small deployments
│   └── Yes
│       ├── Hub has Azure Firewall? → Verify UDRs route spoke traffic through hub
│       ├── VNet Peering correct?
│       │   ├── AllowGatewayTransit on hub? → Required for shared gateway
│       │   ├── UseRemoteGateways on spokes? → Required for hub gateway
│       │   └── AllowForwardedTraffic on both? → Required for transit
│       └── Spoke-to-spoke via Azure Firewall? → Best practice
├── NSGs on all workload subnets?
│   ├── No → HIGH: No network filtering
│   └── Yes → Audit rules per Step 2
├── Network Watcher enabled?
│   ├── No → CRITICAL: No diagnostics
│   └── Yes → Verify NSG Flow Logs
└── Address space overlaps peered VNets? → Blocks VNet Peering

Report Template

AZURE VNET NETWORKING AUDIT REPORT
======================================
Subscription: [id] ([name])
Resource Group(s): [list]
VNet: [name] ([resource-id])
Address Spaces: [list]
Audit Date: [timestamp]  Performed By: [operator]

VNET ARCHITECTURE:
Subnets: [total] (workload:[n] gateway:[n] firewall:[n] bastion:[n])
DDoS Protection: [Basic/Standard]
Private Endpoints: [n] | Service Endpoints: [n]

NSGs:
Total: [n] | Internet inbound: [n] | Unused: [n]
Effective rule conflicts: [n]

AZURE FIREWALL:
Deployed: [yes/no] | SKU: [Standard/Premium]
Threat intelligence: [Alert/Deny] | IDPS: [on/off]
Rule collections: DNAT:[n] Network:[n] Application:[n]

CONNECTIVITY:
ExpressRoute: [circuit or N/A] | BGP: [Connected/Idle]
VPN Gateway: [name or N/A] | Connections: [n]
VNet Peering: [n] | Gateway transit: [yes/no]

ROUTING:
UDR Tables: [n] | Forced tunneling: [n subnets]
BGP propagation disabled: [n tables]

OPTIMIZATION:
Orphaned NICs: [n] | Unassociated public IPs: [n]
Application Gateway utilization: [assessment]

FINDINGS:
1. [Severity] [Category] — [Description]
   Resource: [id] → Recommendation: [action]

NEXT AUDIT: [CRITICAL: 30d, HIGH: 90d, clean: 180d]

Troubleshooting

NSG Flow Logs Not Enabled

If Network Watcher NSG Flow Logs are not configured, traffic visibility is

limited to NSG hit counts. NSG Flow Logs require Network Watcher enabled

and a storage account. Version 2 includes throughput data. Document

missing Flow Logs as High.

Effective Security Rules Show Unexpected Allows

Use az network nic show-effective-nsg for combined subnet and NIC NSG

rules. Check for: higher-priority Allow in NIC NSG overriding subnet Deny,

default rules (65000+) permitting VNet-to-VNet traffic, or ASG membership

including unintended NICs.

ExpressRoute BGP Session Not Established

Verify VLAN ID matches between Azure and provider. Check BGP ASN matches

on-premises router. Use az network express-route peering show to compare

settings. Both primary and secondary should show "Connected".

VNet Peering Shows Initiated But Not Connected

Both peering links must be created. "Initiated" means only one side is

configured. Create the reciprocal link. Cross-subscription peering requires

RBAC on both subscriptions.

UDR Causing Asymmetric Routing

When ExpressRoute delivers inbound traffic directly but UDR routes return

traffic through Azure Firewall, asymmetric routing occurs — the firewall

drops return packets with no session state. Ensure UDR routes both

directions through the firewall, or configure Azure Firewall SNAT.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.