Skip to content

Commit 349afe7

Browse files
committed
Restore enumeration commands in Azure network doc
1 parent 5642a68 commit 349afe7

File tree

1 file changed

+65
-1
lines changed

1 file changed

+65
-1
lines changed

src/pentesting-cloud/azure-security/az-services/vms/az-azure-network.md

Lines changed: 65 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ az network nsg show --name <NSGName> --resource-group <ResourceGroupName> --quer
8585
```bash
8686
# List NSGs
8787
Get-AzNetworkSecurityGroup | Select-Object Name, Location
88+
Get-AzNetworkSecurityGroup -Name <NSGName> -ResourceGroupName <ResourceGroupName>
8889

8990
# Get NSG rules
9091
Get-AzNetworkSecurityGroup -Name <NSGName> -ResourceGroupName <ResourceGroupName> |
@@ -175,7 +176,10 @@ Azure **Route Tables (UDR)** let you override default routing by defining destin
175176
# List Route Tables
176177
az network route-table list --query "[].{name:name, resourceGroup:resourceGroup, location:location}" -o table
177178

178-
# List routes for a table
179+
# List routes for a table (summary)
180+
az network route-table route list --resource-group <ResourceGroupName> --route-table-name <RouteTableName> --query "[].{name:name, addressPrefix:addressPrefix, nextHopType:nextHopType, nextHopIpAddress:nextHopIpAddress}" -o table
181+
182+
# List routes for a table (full)
179183
az network route-table route list --resource-group <ResourceGroupName> --route-table-name <RouteTableName>
180184
```
181185

@@ -299,6 +303,9 @@ Service Endpoints **do not require private IP addresses** for the services and i
299303
{{#tab name="az cli" }}
300304

301305
```bash
306+
# List Virtual Networks with Service Endpoints
307+
az network vnet list --query "[].{name:name, location:location, serviceEndpoints:serviceEndpoints}" -o table
308+
302309
# List Subnets with Service Endpoints
303310
az network vnet subnet list --resource-group <ResourceGroupName> --vnet-name <VNetName> --query "[].{name:name, serviceEndpoints:serviceEndpoints}"
304311

@@ -310,6 +317,9 @@ az network vnet subnet show --resource-group <ResourceGroupName> --vnet-name <VN
310317
{{#tab name="PowerShell" }}
311318

312319
```bash
320+
# List Virtual Networks with Service Endpoints
321+
Get-AzVirtualNetwork
322+
313323
# List Subnets with Service Endpoints
314324
(Get-AzVirtualNetwork -ResourceGroupName <ResourceGroupName> -Name <VNetName>).Subnets
315325
```
@@ -364,6 +374,12 @@ az afd profile list --query "[].{name:name, location:location, resourceGroup:res
364374

365375
# List AFD endpoints
366376
az afd endpoint list --profile-name <ProfileName> --resource-group <ResourceGroupName> --query "[].{name:name, hostName:hostName, state:resourceState}" -o table
377+
378+
# Classic Azure Front Door (v1) profiles
379+
az network front-door list --query "[].{name:name, resourceGroup:resourceGroup, location:location}" -o table
380+
381+
# Classic Azure Front Door WAF policies
382+
az network front-door waf-policy list --query "[].{name:name, resourceGroup:resourceGroup, location:location}" -o table
367383
```
368384

369385
{{#endtab }}
@@ -375,6 +391,42 @@ Get-AzFrontDoorCdnProfile | Select-Object Name, Location, ResourceGroupName
375391

376392
# List AFD endpoints
377393
Get-AzFrontDoorCdnEndpoint -ProfileName <ProfileName> -ResourceGroupName <ResourceGroupName> | Select-Object Name, HostName, ResourceState
394+
395+
# Classic Azure Front Door (v1) profiles
396+
Get-AzFrontDoor
397+
398+
# Classic Azure Front Door WAF policies
399+
Get-AzFrontDoorWafPolicy -Name <policyName> -ResourceGroupName <resourceGroupName>
400+
```
401+
402+
{{#endtab }}
403+
{{#endtabs }}
404+
405+
## Azure Application Gateway and Azure Application Gateway WAF
406+
407+
Azure Application Gateway is a **web traffic load balancer** that enables you to manage traffic to your **web** applications. It offers **Layer 7 load balancing, SSL termination, and web application firewall (WAF) capabilities** in the Application Delivery Controller (ADC) as a service. Key features include URL-based routing, cookie-based session affinity, and secure sockets layer (SSL) offloading, which are crucial for applications that require complex load-balancing capabilities like global routing and path-based routing.
408+
409+
**Example:**
410+
411+
Consider a scenario where you have an e-commerce website that includes multiple subdomains for different functions, such as user accounts and payment processing. Azure Application Gateway can **route traffic to the appropriate web servers based on the URL path**. For example, traffic to `example.com/accounts` could be directed to the user accounts service, and traffic to `example.com/pay` could be directed to the payment processing service.\
412+
And **protect your website from attacks using the WAF capabilities.**
413+
414+
### **Enumeration**
415+
416+
{{#tabs }}
417+
{{#tab name="az cli" }}
418+
419+
```bash
420+
# List the Web Application Firewall configurations for your Application Gateways
421+
az network application-gateway waf-config list --gateway-name <AppGatewayName> --resource-group <ResourceGroupName> --query "[].{name:name, firewallMode:firewallMode, ruleSetType:ruleSetType, ruleSetVersion:ruleSetVersion}" -o table
422+
```
423+
424+
{{#endtab }}
425+
{{#tab name="PowerShell" }}
426+
427+
```bash
428+
# List the Web Application Firewall configurations for your Application Gateways
429+
(Get-AzApplicationGateway -Name <AppGatewayName> -ResourceGroupName <ResourceGroupName>).WebApplicationFirewallConfiguration
378430
```
379431

380432
{{#endtab }}
@@ -399,16 +451,28 @@ A large enterprise with multiple departments (Finance, HR, IT) can create a **Hu
399451
{{#tab name="az cli" }}
400452

401453
```bash
454+
# List all VNets in your subscription
455+
az network vnet list --query "[].{name:name, location:location, addressSpace:addressSpace}" -o table
456+
402457
# List VNet Peerings
403458
az network vnet peering list --resource-group <ResourceGroupName> --vnet-name <VNetName> --query "[].{name:name, remoteVnetId:remoteVirtualNetwork.id, allowForwardedTraffic:allowForwardedTraffic, allowGatewayTransit:allowGatewayTransit}"
459+
460+
# List Shared Resources (e.g., Azure Firewall) in the Hub
461+
az network firewall list --query "[].{name:name, location:location, resourceGroup:resourceGroup}" -o table
404462
```
405463

406464
{{#endtab }}
407465
{{#tab name="PowerShell" }}
408466

409467
```bash
468+
# List all VNets in your subscription
469+
Get-AzVirtualNetwork
470+
410471
# List VNet Peerings
411472
Get-AzVirtualNetworkPeering -ResourceGroupName <ResourceGroupName> -VirtualNetworkName <VNetName>
473+
474+
# List Shared Resources (e.g., Azure Firewall) in the Hub
475+
Get-AzFirewall
412476
```
413477

414478
{{#endtab }}

0 commit comments

Comments
 (0)