Burp Suite User Forum

Create new post

Bad Gateway 502

Martin | Last updated: May 14, 2021 03:06PM UTC

Hi, I've set up portswigger in Azure and gone to the default IP, 10.0.0.10 and I get the Bad Gateway 502 error. The database is Postgres V11 and the URL for the template is https://bsee-cloud-trial.s3-eu-west-1.amazonaws.com/2021.4.1-6864/bsee-2021.4.1-6864.json The deployment logs are: Running on Linux Generate the agent deployment Set up kubectl for Azure [ { "cloudName": "AzureCloud", "homeTenantId": "cbc42766-400c-4096-a867-21466952daca", "id": "87ac7d45-9ece-4b4b-97ef-ae9477e4db34", "isDefault": true, "managedByTenants": [], "name": "Line of Business", "state": "Enabled", "tenantId": "cbc42766-400c-4096-a867-21466952daca", "user": { "name": "http://azure-cli-2021-05-13-12-57-33", "type": "servicePrincipal" } } ] Merged "bseeCluster3814" as current context in /root/.kube/config Running pre deployment Error from server (AlreadyExists): error when creating "https://raw.githubusercontent.com/Azure/aad-pod-identity/master/deploy/infra/deployment.yaml": customresourcedefinitions.apiextensions.k8s.io "azureassignedidentities.aadpodidentity.k8s.io" already exists Error from server (AlreadyExists): error when creating "https://raw.githubusercontent.com/Azure/aad-pod-identity/master/deploy/infra/deployment.yaml": customresourcedefinitions.apiextensions.k8s.io "azureidentities.aadpodidentity.k8s.io" already exists Error from server (AlreadyExists): error when creating "https://raw.githubusercontent.com/Azure/aad-pod-identity/master/deploy/infra/deployment.yaml": customresourcedefinitions.apiextensions.k8s.io "azureidentitybindings.aadpodidentity.k8s.io" already exists Error from server (AlreadyExists): error when creating "https://raw.githubusercontent.com/Azure/aad-pod-identity/master/deploy/infra/deployment.yaml": customresourcedefinitions.apiextensions.k8s.io "azurepodidentityexceptions.aadpodidentity.k8s.io" already exists Error from server (AlreadyExists): error when creating "https://raw.githubusercontent.com/Azure/aad-pod-identity/master/deploy/infra/deployment.yaml": daemonsets.apps "nmi" already exists Error from server (AlreadyExists): error when creating "https://raw.githubusercontent.com/Azure/aad-pod-identity/master/deploy/infra/deployment.yaml": deployments.apps "mic" already exists I see errors there, but I don't know what to do to make this work, can you help?

Liam, PortSwigger Agent | Last updated: May 17, 2021 10:25AM UTC

Hi Martin. Have you attempted multiple deployments? Could you try deleting the entire resource group and redeploying everything again, please?

Martin | Last updated: May 17, 2021 12:13PM UTC

This is my second deployment, I will delete and try again.

Martin | Last updated: May 17, 2021 02:23PM UTC

Thanks Liam, the deployment has completed but I am having issues getting vpn traffic to go to it because of an overlap in my environment. I would like to redeploy with a different network in Azure to get around this. I see a note that says "By default, the application will be made available via your Azure Virtual Network (VNet) on the IP address 10.0.0.10. If you want to use a different IP address, you will need to use a parameters.json file to override the applicationGatewayPrivateIPAddress parameter. Please note that any address you use must still be within the address spaces defined in the addressSpaces parameter (default 10.0.0.0/16), so you may need to update this as well. If you are using a parameters.json file instead of providing the required values individually, the steps may vary slightly." Can you tell me how to populate the paramaters.json file, what to do with it and which steps vary and how they vary please?

Liam, PortSwigger Agent | Last updated: May 18, 2021 09:40AM UTC

Hi Martin. There can be several extra parameters JSON files used as part of an installation to Azure. They contain the keys and values to be overridden, so for example, a parameters file only containing a replacement for the applicationGatewayPrivateIPAddress parameter would look like the following: { "applicationGatewayPrivateIPAddress": {"value": "10.0.0.10"} } (Again note that you may also want to override the default addressSpaces parameter as part of making this change). With 10.0.0.10 replaced by the other IP address, the name of the file is unimportant. It is worth pointing out that a parameters JSON file is created and used as part of the "Create the service principal" section of the Azure instructions. The usage of this JSON file is part of the "Create and deploy the related infrastructure" step. Currently, the installation instructions include running the following command to create the deployment group (with parameter values changed): az deployment group create -g your-resource-group-name -n any-new-deployment-name --template-uri your-copied-template-url --parameters @credentials.json Usage of the extra parameters file is done by adding another --parameters argument, such as the following: az deployment group create -g your-resource-group-name -n any-new-deployment-name --template-uri your-copied-template-url --parameters @credentials.json ---parameters @other.json Where other.json is the JSON file created with the replaced applicationGatewayPrivateIPAddress parameter. The @ symbol marks the parameter as a file to be read.

Martin | Last updated: May 18, 2021 11:08AM UTC

Thank you Liam I will try again with this in an additional file. { "applicationGatewayPrivateIPAddress": {"value": "10.180.6.10"} "addressSpaces parameter": {":value": "10.180.6.0/23"} }

Martin | Last updated: May 18, 2021 11:39AM UTC

Hi Liam, I've tried the install with this additional config file { "applicationGatewayPrivateIPAddress": {"value": "10.180.6.10"}, "addressSpaces": {"value": "10.180.6.0/23"} } and I get this error {"error":{"code":"InvalidTemplate","message":"Deployment template validation failed: 'Template parameter JToken type is not valid. Expected 'Array'. Actual 'String'. Please see https://aka.ms/resource-manager-parameter-files for usage details.'.","additionalInfo":[{"type":"TemplateViolation","info":{"lineNumber":5,"linePosition":26,"path":"parameters.addressSpaces"}}]}} Can you tell me what I have got wrong with the addressSpaces parameter?

Martin | Last updated: May 18, 2021 12:50PM UTC

Hi Liam, I have tried several different formats for my additional config file, including passing the addressSpaces value as an array with 10.80.6.0/23 in it. When I did that I got a long error that contains 'applicationGatewaySubnet' is not valid in virtual network 'bseeVNet' Can you show me a correctly formatted file that will let me user 10.180.6.10 on the application gateway and 10.180.6.0/23 as the network?

Liam, PortSwigger Agent | Last updated: May 19, 2021 12:30PM UTC

Hi Martin Sure, passing address spaces in as an array is what needs to be done here, the correct file will look like: { "applicationGatewayPrivateIPAddress": {"value": "10.180.6.10"}, "addressSpaces": {"value": ["10.180.6.0/23"]} } It looks like you have already tried this already and run into a different error, which also needs to be fixed: "applicationGatewaySubnet" is another setting that needs to be overridden as the default value (which is 10.0.0.0/24) is not valid with the other settings being overridden here. Apologies, we should have suggested this along with overriding the addressSpaces value. Are you attempting to allocate a class-C network to each subnet? Guessing at the correct values, we think the full parameters file that will be needed should look like the following: { "applicationGatewayPrivateIPAddress": {"value": "10.180.6.10"}, "addressSpaces": {"value": ["10.180.6.0/23"]}, "applicationGatewaySubnet": {"value": "10.180.6.0/24"}, "agentNodesSubnet": {"value": "10.180.7.0/24"} } Please note that the values for these extra settings are a guess on our part. You should have this information if they need to be changed.

Martin | Last updated: May 20, 2021 12:58PM UTC

Thank you Liam, trying again with { "applicationGatewayPrivateIPAddress": {"value": "10.180.6.10"}, "addressSpaces": {"value": ["10.180.6.0/23"]}, "applicationGatewaySubnet": {"value": "10.180.6.0/24"}, "agentNodesSubnet": {"value": "10.180.7.0/24"} } I don't know what ApplicationGatewaySubnet or agent Nodes subnet actually do or why they need to be specified. I'll test a deployment as you describe and see what happens.

Martin | Last updated: May 20, 2021 01:47PM UTC

Hi Liam, this has installed but I am trying to set up a VPN to azure to allow access to Portswigger. I try to use bseeVnet as the network but I get told that this is already in use. I'm going to reinstall a default installation to see if I can figure out what is different this time around and what we have to change to make the 10.180.6.0/23 network available

Martin | Last updated: May 20, 2021 03:32PM UTC

Got it, the reason it didn't work is that azure vpn's want to slice off part of the network range for internal connectivity on a virtual network gateway. Going with the below has worked. { "applicationGatewayPrivateIPAddress": {"value": "10.180.6.10"}, "addressSpaces": {"value": ["10.180.0.0/16"]}, "applicationGatewaySubnet": {"value": "10.180.6.0/24"}, "agentNodesSubnet": {"value": "10.180.7.0/24"} }

Liam, PortSwigger Agent | Last updated: May 21, 2021 07:35AM UTC

Good news! Thanks for the update, Martin.

You must be an existing, logged-in customer to reply to a thread. Please email us for additional support.