01 Run apim list command (Windows/macOS/Linux) using custom query filters to list the name and the associated resource group for each Azure API Management service instance available in the current subscription:
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
az apim list
--output table
--query '[*].{name:name, resourceGroup:resourceGroup}'
02 The command output should return the requested Azure API Management service names:
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
Name ResourceGroup
---------------------- ------------------------------
cc-main-api-service-instance cloud-shell-storage-westeurope
cc-project5-service-instance cloud-shell-storage-westeurope
03 Run apim show command (Windows/macOS/Linux) using the name of the Azure API Management service instance that you want to examine and its associated resource group as the identifier parameters to determine if the selected service instance is configured with a private endpoint:
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
az apim show
--name cc-main-api-service-instance
--resource-group cloud-shell-storage-westeurope
--output yaml
--query 'privateEndpointConnections'
04 The command output should return the information available for the configured private endoint(s), important information such endpoint identifier, resource provisioning state, and Private Link service status. If the apim show command does not produce an output, the service instance is not configured with a private endpoint. If the apim show command returns an output, as shown in the example above, the API service has a private endpoint, therefore you can continue the Audit process with the next step:
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
- groupIds:
- Gateway
id: /subscriptions/abcd1234-abcd-1234-abcd-1234abcd1234/resourceGroups/cloud-shell-storage-westeurope/providers/Microsoft.ApiManagement/service/cc-main-api-service-instance/privateEndpointConnections/cc-api-service-private-endpoint
name: cc-api-service-private-endpoint
privateEndpoint:
id: /subscriptions/abcd1234-abcd-1234-abcd-1234abcd1234/resourceGroups/cloud-shell-storage-westeurope/providers/Microsoft.Network/privateEndpoints/cc-api-service-private-endpoint
resourceGroup: cloud-shell-storage-westeurope
privateLinkServiceConnectionState:
actionsRequired: null
description: ''
status: Approved
provisioningState: Succeeded
resourceGroup: cloud-shell-storage-westeurope
type: Microsoft.ApiManagement/service/privateEndpointConnections
05 Run apim show command (Windows/macOS/Linux) using the name of the Azure API Management service instance that you want to examine as the identifier parameter to determine if the selected service instance, configured with a private endpoint, is exposed to the public Internet:
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
az apim show
--name cc-main-api-service-instance
--resource-group cloud-shell-storage-westeurope
--query 'publicNetworkAccess'
06 The command output should return the "publicNetworkAccess" configuration attribute value:
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
"Enabled"
If the
publicNetworkAccess value is set to
"Enabled", as shown in the example above, public network access is enabled for the selected Azure API Management service, therefore the service instance is publicly accessible.
07 Repeat steps no. 3 - 6 for each Azure API Management service available within the current Azure subscription.
08 Repeat steps no. 1 – 7 for each subscription created in your Microsoft Azure cloud account.