How to connect Azure Web Application (App Service/Website) to Network Security Group?

Cam

I'm not sure if I'm missing something simple, or if I'm trying to do the impossible.

I have a Tomcat site deployed on Azure using the Web+Mobile App Services model. This is NOT a VM. I would like to be able to apply firewall rules (network security group) to this App Service.

Here is what I have done within my Resource Group:

  1. Taken my existing App Service (Tomcat) and upgraded it to S1 machine size.
  2. Created a VNET with default settings. This included creating a subnet named "default". All address space suggestions were left at Azure default prompts.
  3. Used the Network settings blade on the App Service to select the VNET I just created.
  4. Created a Network Security Group - added an incoming rule to deny HTTP port 80 from ANY source.
  5. Associated NSG created above with the default subnet
  6. Waited for everything to propogate
  7. Tested hitting the App Service on HTTP Port 80, and got results returned.

This was not what I was hoping to see. To debug this I tested:

  1. Create a Tomcat Virtual Machine
  2. On the VM Network blade, associated the VM with the "default" subnet, and specifically removed the Network Security Group from the VM (leaving it on the subnet - just making sure it's not explicitly attached to the VM)
  3. Tested HTTP access to the VM - traffic rejected
  4. Tested HTTP access to the App Service - traffic still permitted
  5. Changed the Network Security Group rule to allow
  6. Tested HTTP access to the VM and traffic permitted

How do I get the App Service to use the Network Security Group the way the Virtual Machine does? Am I missing somewhere how to configure the subnet on the App Service? Is there another way to associate the NSG with the App Service?

I don't have budget/need to build an ASE. All I need to do is put a firewall in front of my App Service to block out the ports I'm not wanting to see used.

Thanks.

evilSnobu

You are trying to do the impossible. Remember that Web Apps in App Service have to VPN into the VNET, there's nothing sitting between the internet and 80/TCP, 443/TCP in multi-tenant App Service that you have control of.

Client ---> 80/TCP Frontend layer ---> 80/TCP Web App ---> Point-to-site VPN ---> VNET ---> NSG_associated_with_subnet

So, no go.

See if <ipSecurity> works for your use case (my other answer here provides a quick sample - https://stackoverflow.com/a/38808091/4148708). Else you either need an App Service Environment (ASE) or an Internal Load Balancer App Service Environment (ILB ASE).

They both directly sit in a Subnet in the VNET, so you can control traffic with NSGs.

この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。

侵害の場合は、連絡してください[email protected]

編集
0

コメントを追加

0

関連記事

分類Dev

How to connect a Database to an Angular Web Application?

分類Dev

How to connect Azure Paas Database using Powershell with intergrated security

分類Dev

Disabling dependency logging for Application insights on Azure app service (Web app)

分類Dev

Azure associating security group with multiple network interfaces and load balancer with multiple subnets using Terraform

分類Dev

Web app security architecture

分類Dev

How to create a desktop app for the existing web application?

分類Dev

Azure Application Insight Telemetry for On-Premises web app

分類Dev

How to connect to multiple azure active directory account to your application?

分類Dev

How to tail log from go app on Azure Web App

分類Dev

Adding an App Settings to existing Azure Web Application using Azure Power Shell

分類Dev

How to allow my Azure web application to access Active Directory?

分類Dev

How to run command on connect to network

分類Dev

How to host blockchain app for public demo if it requires locally imported cards to connect to business network?

分類Dev

Azure management API: How to change web app pricing tier?

分類Dev

Azure web app application insights query for Operation/Dependency time, Duration and count over a period

分類Dev

Umbraco: An unexpected network error on Azure Web Apps

分類Dev

Cannot connect to KAFKA running on Azure App Service

分類Dev

Azure DevOps unable to deploy to Azure Web App

分類Dev

What should Resource Group and Runtime Stack be set to in order for me to get a simple Bottle web application running on Azure from VS 2019?

分類Dev

How to access web api from another web app which is in same Azure AD?

分類Dev

How to automatically connect to VPN with Network-Manager

分類Dev

How to SSH to and connect back to original network?

分類Dev

Tails: How to connect Tails to a Samba network share?

分類Dev

When I use SSH with web browser on AWS Console. How I can set my security group source?

分類Dev

How to create an Azure Kusto query to group by client OS name only (OS version removed) on App insights?

分類Dev

Azure Application Insights and Web Site projects

分類Dev

How to use curl/postman to access web page behind Azure AD Application Proxy

分類Dev

How to Authenticate WPF Application with AAD B2C to gain access to Azure App Service

分類Dev

how to configure my application with spring security?

Related 関連記事

  1. 1

    How to connect a Database to an Angular Web Application?

  2. 2

    How to connect Azure Paas Database using Powershell with intergrated security

  3. 3

    Disabling dependency logging for Application insights on Azure app service (Web app)

  4. 4

    Azure associating security group with multiple network interfaces and load balancer with multiple subnets using Terraform

  5. 5

    Web app security architecture

  6. 6

    How to create a desktop app for the existing web application?

  7. 7

    Azure Application Insight Telemetry for On-Premises web app

  8. 8

    How to connect to multiple azure active directory account to your application?

  9. 9

    How to tail log from go app on Azure Web App

  10. 10

    Adding an App Settings to existing Azure Web Application using Azure Power Shell

  11. 11

    How to allow my Azure web application to access Active Directory?

  12. 12

    How to run command on connect to network

  13. 13

    How to host blockchain app for public demo if it requires locally imported cards to connect to business network?

  14. 14

    Azure management API: How to change web app pricing tier?

  15. 15

    Azure web app application insights query for Operation/Dependency time, Duration and count over a period

  16. 16

    Umbraco: An unexpected network error on Azure Web Apps

  17. 17

    Cannot connect to KAFKA running on Azure App Service

  18. 18

    Azure DevOps unable to deploy to Azure Web App

  19. 19

    What should Resource Group and Runtime Stack be set to in order for me to get a simple Bottle web application running on Azure from VS 2019?

  20. 20

    How to access web api from another web app which is in same Azure AD?

  21. 21

    How to automatically connect to VPN with Network-Manager

  22. 22

    How to SSH to and connect back to original network?

  23. 23

    Tails: How to connect Tails to a Samba network share?

  24. 24

    When I use SSH with web browser on AWS Console. How I can set my security group source?

  25. 25

    How to create an Azure Kusto query to group by client OS name only (OS version removed) on App insights?

  26. 26

    Azure Application Insights and Web Site projects

  27. 27

    How to use curl/postman to access web page behind Azure AD Application Proxy

  28. 28

    How to Authenticate WPF Application with AAD B2C to gain access to Azure App Service

  29. 29

    how to configure my application with spring security?

ホットタグ

アーカイブ