-
Notifications
You must be signed in to change notification settings - Fork 81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Loadbalancer Public IP with Zones enabled #149
Comments
The test just seems to look at the https://github.com/Azure/azqr/blob/main/internal/scanners/lb/rules.go#L36 Looks like a bug to me. |
Hi @dkanbier can you please share de JSON for the Load Balancer and the Public IP so I can take a look? (Remember to remove or mask your subscription ID or any other value you want to keep private) |
A
versus one with only private ip:
|
Hi @cmendible , thanks for the reply. The root cause in my opinion is what @nlighten is mentioning. The When you directly get the Public IP object, you do get a
LoadBalancer JSON: {
"name": "kubernetes",
"id": "/subscriptions/***/resourceGroups/MC_deleteMe_deleteAKS_westeurope/providers/Microsoft.Network/loadBalancers/kubernetes",
"etag": "W/\"1fcbefe6-13be-43aa-a09d-f26c7736c332\"",
"type": "Microsoft.Network/loadBalancers",
"location": "westeurope",
"tags": {
"aks-managed-cluster-name": "deleteAKS",
"aks-managed-cluster-rg": "deleteMe"
},
"properties": {
"provisioningState": "Succeeded",
"resourceGuid": "16aeb038-c9c6-4535-973c-d37fd6e8eb09",
"frontendIPConfigurations": [
{
"name": "428f3d97-c114-4fcf-b58a-cb7b127a7e92",
"id": "/subscriptions/***/resourceGroups/MC_deleteMe_deleteAKS_westeurope/providers/Microsoft.Network/loadBalancers/kubernetes/frontendIPConfigurations/428f3d97-c114-4fcf-b58a-cb7b127a7e92",
"etag": "W/\"1fcbefe6-13be-43aa-a09d-f26c7736c332\"",
"type": "Microsoft.Network/loadBalancers/frontendIPConfigurations",
"properties": {
"provisioningState": "Succeeded",
"privateIPAllocationMethod": "Dynamic",
"publicIPAddress": {
"id": "/subscriptions/***/resourceGroups/MC_deleteMe_deleteAKS_westeurope/providers/Microsoft.Network/publicIPAddresses/428f3d97-c114-4fcf-b58a-cb7b127a7e92"
}
}
}
],
"backendAddressPools": [
{
"name": "aksOutboundBackendPool",
"id": "/subscriptions/***/resourceGroups/MC_deleteMe_deleteAKS_westeurope/providers/Microsoft.Network/loadBalancers/kubernetes/backendAddressPools/aksOutboundBackendPool",
"etag": "W/\"1fcbefe6-13be-43aa-a09d-f26c7736c332\"",
"properties": {
"provisioningState": "Succeeded",
"backendIPConfigurations": [
{
"id": "/subscriptions/***/resourceGroups/MC_deleteMe_deleteAKS_westeurope/providers/Microsoft.Compute/virtualMachineScaleSets/aks-nodepool1-38051177-vmss/virtualMachines/2/networkInterfaces/aks-nodepool1-38051177-vmss/ipConfigurations/ipconfig1"
},
{
"id": "/subscriptions/***/resourceGroups/MC_deleteMe_deleteAKS_westeurope/providers/Microsoft.Compute/virtualMachineScaleSets/aks-nodepool1-38051177-vmss/virtualMachines/3/networkInterfaces/aks-nodepool1-38051177-vmss/ipConfigurations/ipconfig1"
},
{
"id": "/subscriptions/***/resourceGroups/MC_deleteMe_deleteAKS_westeurope/providers/Microsoft.Compute/virtualMachineScaleSets/aks-nodepool1-38051177-vmss/virtualMachines/4/networkInterfaces/aks-nodepool1-38051177-vmss/ipConfigurations/ipconfig1"
}
]
},
"type": "Microsoft.Network/loadBalancers/backendAddressPools"
},
{
"name": "kubernetes",
"id": "/subscriptions/***/resourceGroups/MC_deleteMe_deleteAKS_westeurope/providers/Microsoft.Network/loadBalancers/kubernetes/backendAddressPools/kubernetes",
"etag": "W/\"1fcbefe6-13be-43aa-a09d-f26c7736c332\"",
"properties": {
"provisioningState": "Succeeded",
"backendIPConfigurations": [
{
"id": "/subscriptions/***/resourceGroups/MC_deleteMe_deleteAKS_westeurope/providers/Microsoft.Compute/virtualMachineScaleSets/aks-nodepool1-38051177-vmss/virtualMachines/2/networkInterfaces/aks-nodepool1-38051177-vmss/ipConfigurations/ipconfig1"
},
{
"id": "/subscriptions/***/resourceGroups/MC_deleteMe_deleteAKS_westeurope/providers/Microsoft.Compute/virtualMachineScaleSets/aks-nodepool1-38051177-vmss/virtualMachines/3/networkInterfaces/aks-nodepool1-38051177-vmss/ipConfigurations/ipconfig1"
},
{
"id": "/subscriptions/***/resourceGroups/MC_deleteMe_deleteAKS_westeurope/providers/Microsoft.Compute/virtualMachineScaleSets/aks-nodepool1-38051177-vmss/virtualMachines/4/networkInterfaces/aks-nodepool1-38051177-vmss/ipConfigurations/ipconfig1"
}
]
},
"type": "Microsoft.Network/loadBalancers/backendAddressPools"
}
],
"loadBalancingRules": [],
"probes": [],
"inboundNatRules": [],
"inboundNatPools": []
},
"sku": {
"name": "Standard"
}
} Public IP JSON: {
"name": "428f3d97-c114-4fcf-b58a-cb7b127a7e92",
"id": "/subscriptions/***/resourceGroups/MC_deleteMe_deleteAKS_westeurope/providers/Microsoft.Network/publicIPAddresses/428f3d97-c114-4fcf-b58a-cb7b127a7e92",
"etag": "W/\"62b30655-2450-4daa-91b1-ccd8c8ec1fff\"",
"location": "westeurope",
"tags": {
"aks-managed-cluster-name": "deleteAKS",
"aks-managed-cluster-rg": "deleteMe",
"aks-managed-type": "aks-slb-managed-outbound-ip"
},
"properties": {
"provisioningState": "Succeeded",
"resourceGuid": "4ca22ea6-3e5c-4e7a-9967-fe7bdb138c7c",
"ipAddress": "***",
"publicIPAddressVersion": "IPv4",
"publicIPAllocationMethod": "Static",
"idleTimeoutInMinutes": 4,
"ipTags": [],
"ipConfiguration": {
"id": "/subscriptions/***/resourceGroups/MC_deleteMe_deleteAKS_westeurope/providers/Microsoft.Network/loadBalancers/kubernetes/frontendIPConfigurations/428f3d97-c114-4fcf-b58a-cb7b127a7e92"
}
},
"type": "Microsoft.Network/publicIPAddresses",
"sku": {
"name": "Standard"
}
} Please note that in both JSONs there is no mention of
{
"etag": "W/\"62b30655-2450-4daa-91b1-ccd8c8ec1fff\"",
"id": "/subscriptions/***/resourceGroups/MC_deleteMe_deleteAKS_westeurope/providers/Microsoft.Network/publicIPAddresses/428f3d97-c114-4fcf-b58a-cb7b127a7e92",
"idleTimeoutInMinutes": 4,
"ipAddress": "***",
"ipConfiguration": {
"id": "/subscriptions/***/resourceGroups/MC_deleteMe_deleteAKS_westeurope/providers/Microsoft.Network/loadBalancers/kubernetes/frontendIPConfigurations/428f3d97-c114-4fcf-b58a-cb7b127a7e92",
"resourceGroup": "MC_deleteMe_deleteAKS_westeurope"
},
"ipTags": [],
"location": "westeurope",
"name": "428f3d97-c114-4fcf-b58a-cb7b127a7e92",
"provisioningState": "Succeeded",
"publicIPAddressVersion": "IPv4",
"publicIPAllocationMethod": "Static",
"resourceGroup": "MC_deleteMe_deleteAKS_westeurope",
"resourceGuid": "4ca22ea6-3e5c-4e7a-9967-fe7bdb138c7c",
"sku": {
"name": "Standard",
"tier": "Regional"
},
"tags": {
"aks-managed-cluster-name": "deleteAKS",
"aks-managed-cluster-rg": "deleteMe",
"aks-managed-type": "aks-slb-managed-outbound-ip"
},
"type": "Microsoft.Network/publicIPAddresses",
"zones": [
"3",
"2",
"1"
]
} |
Thank you both! Seems like current validation works only for private IP's and will fail for Public IP's. I'll have to query Public IP's with zones and add the results to the scan context in order to fix this rule. |
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days. |
Hey @dkanbier @nlighten can you try the binary from here: https://github.com/Azure/azqr/actions/runs/6768369641 and check if the issue is fixed? |
Ask your question here
I have configured an AKS cluster using Availability Zones following this document.
The
Standard
LoadBalancer calledkubernetes
this creates by default has a frontend-ip configuration using a public-ip which has Availability Zones 1, 2, 3 enabled.When running the
azqr
tool it reports the LoadBalancer to not have Availability Zones enabled. I was wondering if this is expected behavior or if I've made an error in the configuration.Possible cause for
azqr
reporting the issue:When showing the public-ip using
az network public-ip show
I can see theZones
field defined correctly. However when I query the same public-ip usingaz network lb frontend-ip show
I do not see aZones
field.When trying use
az network lb frontend-ip show
for an internal-ip I do get aZones
field. Theazqr
tool reports no issues on a LB using this internal-ip.The text was updated successfully, but these errors were encountered: