Combining AAD App Proxy with Front Door and Application Gateway for WAF

Published May 06 2022 02:44 AM 2,160 Views
Microsoft

You might have read my previous intro post to the AAD Application Proxy, where I went over a quick intro to this service and a comparison with other reverse proxies available in the Azure portfolio. I finished that post with a very generic diagram describing how to combine multiple proxies to get different capabilities, for example using App Proxy to expose internal applications, and App Gateway or Front Door to provide Web Application Firewall inspection. Today I am going to dive deeper in this use case.

As in previous posts I am testing with a sample Python Flask app that offers some endpoints to analyze the HTTP request from the application perspective, you can find the code here.

 

AAD App Proxy and Application Gateway

 

Let’s start with something relatively easy: Azure Application Gateway is an Azure reverse proxy with optional WAF functionality that can be deployed in Azure Virtual Networks (also known as VNets).

If your application is already running on an Azure VNet, or if your application is running on-premises and you already have network connectivity to an Azure VNet over VPN or ExpressRoute, having the connector and the Azure Application Gateway in Azure might be a good choice. Here the setup I am testing here:

 

image-9.png

 

In essence, the users connect to the App Proxy portal, which “sends” the request to the connector in the VNet (I write “send” in quotes, because it is actually the connector that pulls the request with outbound traffic, as we discussed in the intro post).

The connector will then access a URL pointing to the Application Gateway, which will then create an HTTP connection to the actual application either in the same VNet, or on-premises via VPN or ExpressRoute. The following screenshot shows how I configured the connector to go to the App Gateway (for my test I put “appgw” as a hostname that resolves to the App GW’s private IP address in the Windows hosts file):

 

image-10.png

 

The Application Gateway would then do its magic, such as WAF inspection, and eventually forward the traffic to the application defined as a backend. If we have a look at our sample app, you can see the HTTP headers injected by the Application Gateway, as well as the headers injected by App Proxy with authentication information:

 

image-11.png

 

As you can see, headers like Givenname, Surname and Userprincipalname have been introduced by AAD App Proxy with information relative to the authenticated user. Other headers like X-Appgw-Trace-Id and X-Forwarded-Port have been introduced by the App Gateway.

The X-Forwarded-For header is interesting, because it contains the IP address of the original client (93.104.173.66 in my example), as well as the IP address of the first proxy in the chain, namely the App Proxy connector (172.16.2.4). So the client IP address information is not lost even if going through two reverse proxies here.

One aspect that you need to consider is that the Application Gateway will sit between the connector and the application, you need to take care that it doesn’t break any authentication that may happen between the connector and the app. In my case, the app doesn’t provide any auth, otherwise you need to double check this point.

 

AAD App Proxy and Azure Front Door

 

Let’s make things a bit more complex, by inserting the Web Application Firewall in a different place. Another service in Azure that offers WAF functionality is Azure Front Door. Front Door doesn’t sit on a VNet, but instead it is a multi-tenant service deployed on Microsoft Points-of-Presence across the Internet. As a consequence, it is not ideal to access private applications (an exception to this is if the application is deployed on an Azure VNet, where Front Door support for Private Link is a fantastic tool).

Taking the generic case where the internal app can potentially sit on your local premises, the most intuitive design might be putting Azure Front Door in front of AAD App Proxy, in a constellation similar to this:

 

image-12.png

 

Note the design is now more complex, because Front Door is sitting between the user and the AAD Proxy Portal that provides authentication. For this authentication to work, the redirection URL that Azure Active Directory will provide to the user after successful authentication needs to send them back to Front Door and not to the App Proxy portal, otherwise authentication would break.

Without going into too much detail, the solution to this is using your own custom domain (in my case I bought starkiller.info for a couple of bucks) and your own digital certificates (which I generated from Let’s Encrypt and uploaded to my Azure Key Vault using this method). This way you can define that your application is behind a custom domain name (whoami.starkiller.info), but in your DNS you resolve this FQDN to Front Door via a CNAME record.

Let’s look first at the AAD App Proxy config, where I am using a custom domain that I previously associated to my tenant:

 

image-14.png

 

Note that at the very bottom of the App Proxy config page you will see a blue banner that lets you know the FQDN that you can use to get to the App Proxy portal:

 

image-15.png

 

Now, let’s have a look at the Front Door config. The tricky piece is sending the request to the origin to the right IP address (resolving the FQDN whoami-starkiller.msappproxy.net), but with the hostname that AAD App Proxy expects (whoami.starkiller.info). That is why it is necessary to overwrite the Origin Host Header as the origin configuration in Front Door shows:

 

image-13.png

 

And we are done! When we look at the HTTP headers that the application sees, as before we will see both the headers injected by Azure Front Door as well as the headers injected by App Proxy:

 

image-16.png

 

Again, the X-Forwarded-For header can be used to see the client’s original IP, in this case an IPv6 because my computer and ISP are fully dual stack.

Talking about the XFF header, you might have noticed that we now see there the IP address 147.243.102.107. This actually represents the first proxy in the chain, Azure Front Door, and it is a Microsoft-owned IP address for Front Door backend communication as you can see if you look deep into the Azure IP ranges JSON document, which will be important for the next section.

 

Can you bypass the WAF?

 

What I mean here is whether a malicious actor could bypass Azure Front Door and access App Proxy directly, to fly below the WAF radar? In theory possible, if the malicious actor gets the right HTTP Host header to configure on their request, manipulates their local DNS resolution to resolve whoami.starkiller.info to AAD App Proxy’s public IP address, and has valid AAD credentials authorized to access the app.

A relatively easy way to prevent this from happening is by configuring some filters at the application level, by making sure that the application request actually went through Azure Front Door, by checking that the IP address in the X-Forwarded-For is actually a valid Front Door backend address, and additionally verifying that the X-Azure-Fdid header contains your Front Door instance ID.

For more information on this you can check the Azure Front Door FAQ on How do I lock down the access to my backend to only Azure Front Door?

 

The Three Amigos

 

We could now chain all three reverse proxies we have been talking about in this article. Why? Because we can. Or to show that the two approaches above are not mutually exclusive. If we wanted for any reason to chain Front Door + App Proxy + App Gateway, this is what it would look like:

 

image-17.png

 

 

This setup might actually make sense for example if the first proxy (Front Door in this case) provides global load balancing, the second one (AAD App Proxy) does the authentication, and the third one (App Gateway) some additional functions such as Web Application Firewalling. This design might be combined with other proxies such as Azure API Management.

As you can imagine, now everybody is putting headers in the request, but still you can see the original client IP address in the X-Forwarded-For header:

 

image-18.png

 

When do I do what?

 

I knew you would ask, and you might already know what my answer is going to be (“it depends”). Here some decision criteria:

  • If you have internal applications deployed across multiple world locations, Front Door is a great solution because it can load balance across multiple instances of App Proxy, each located in separate geography.
  • Another benefit of Front Door is that it not only integrates WAF functionality, but it gives CDN options as caching and compression too, potentially improving the application user experience.
  • If your app is running in Azure, or it is running on-prem but you have good Azure connectivity, App Gateway is a good fit. One advantage of App GW is that you are 100% sure that all traffic from AAD Proxy goes through the WAF.
  • Another point for the WAF solution is the fact that if you have Azure DDoS Standard enabled in the VNet, the cost of the WAF component for App Gateway goes away (see this FAQ).

I am sorry I am not giving you a black or white advice (those are rare and in my experience usually not universally applicable), but I hope you learnt something with this post. Thanks for reading!

%3CLINGO-SUB%20id%3D%22lingo-sub-3331650%22%20slang%3D%22en-US%22%3ECombining%20AAD%20App%20Proxy%20with%20Front%20Door%20and%20Application%20Gateway%20for%20WAF%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3331650%22%20slang%3D%22en-US%22%3E%3CP%3EYou%20might%20have%20read%20my%20previous%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fblog.cloudtrooper.net%2F2022%2F03%2F18%2Fwhere-does-aad-app-proxy-fit-with-other-azure-reverse-proxies%2F%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%20target%3D%22_blank%22%3Eintro%20post%20to%20the%20AAD%20Application%20Proxy%3C%2FA%3E%2C%20where%20I%20went%20over%20a%20quick%20intro%20to%20this%20service%20and%20a%20comparison%20with%20other%20reverse%20proxies%20available%20in%20the%20Azure%20portfolio.%20I%20finished%20that%20post%20with%20a%20very%20generic%20diagram%20describing%20how%20to%20combine%20multiple%20proxies%20to%20get%20different%20capabilities%2C%20for%20example%20using%20App%20Proxy%20to%20expose%20internal%20applications%2C%20and%20App%20Gateway%20or%20Front%20Door%20to%20provide%20Web%20Application%20Firewall%20inspection.%20Today%20I%20am%20going%20to%20dive%20deeper%20in%20this%20use%20case.%3C%2FP%3E%3CP%3EAs%20in%20previous%20posts%20I%20am%20testing%20with%20a%20sample%20Python%20Flask%20app%20that%20offers%20some%20endpoints%20to%20analyze%20the%20HTTP%20request%20from%20the%20application%20perspective%2C%20you%20can%20find%20the%20code%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2Ferjosito%2Fazcli%2Fblob%2Fmaster%2Fmyip.py%22%20rel%3D%22noopener%20noreferrer%22%20target%3D%22_blank%22%3Ehere%3C%2FA%3E.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3EAAD%20App%20Proxy%20and%20Application%20Gateway%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ELet%E2%80%99s%20start%20with%20something%20relatively%20easy%3A%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fazure%2Fapplication-gateway%2Foverview%22%20rel%3D%22noopener%20noreferrer%22%20target%3D%22_blank%22%3EAzure%20Application%20Gateway%3C%2FA%3E%26nbsp%3Bis%20an%20Azure%20reverse%20proxy%20with%20optional%20WAF%20functionality%20that%20can%20be%20deployed%20in%20Azure%20Virtual%20Networks%20(also%20known%20as%20VNets).%3C%2FP%3E%3CP%3EIf%20your%20application%20is%20already%20running%20on%20an%20Azure%20VNet%2C%20or%20if%20your%20application%20is%20running%20on-premises%20and%20you%20already%20have%20network%20connectivity%20to%20an%20Azure%20VNet%20over%20VPN%20or%20ExpressRoute%2C%20having%20the%20connector%20and%20the%20Azure%20Application%20Gateway%20in%20Azure%20might%20be%20a%20good%20choice.%20Here%20the%20setup%20I%20am%20testing%20here%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIn%20essence%2C%20the%20users%20connect%20to%20the%20App%20Proxy%20portal%2C%20which%20%E2%80%9Csends%E2%80%9D%20the%20request%20to%20the%20connector%20in%20the%20VNet%20(I%20write%20%E2%80%9Csend%E2%80%9D%20in%20quotes%2C%20because%20it%20is%20actually%20the%20connector%20that%20pulls%20the%20request%20with%20outbound%20traffic%2C%20as%20we%20discussed%20in%20the%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fblog.cloudtrooper.net%2F2022%2F03%2F18%2Fwhere-does-aad-app-proxy-fit-with-other-azure-reverse-proxies%2F%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%20target%3D%22_blank%22%3Eintro%20post%3C%2FA%3E).%3C%2FP%3E%3CP%3EThe%20connector%20will%20then%20access%20a%20URL%20pointing%20to%20the%20Application%20Gateway%2C%20which%20will%20then%20create%20an%20HTTP%20connection%20to%20the%20actual%20application%20either%20in%20the%20same%20VNet%2C%20or%20on-premises%20via%20VPN%20or%20ExpressRoute.%20The%20following%20screenshot%20shows%20how%20I%20configured%20the%20connector%20to%20go%20to%20the%20App%20Gateway%20(for%20my%20test%20I%20put%20%E2%80%9Cappgw%E2%80%9D%20as%20a%20hostname%20that%20resolves%20to%20the%20App%20GW%E2%80%99s%20private%20IP%20address%20in%20the%20Windows%20hosts%20file)%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20Application%20Gateway%20would%20then%20do%20its%20magic%2C%20such%20as%20WAF%20inspection%2C%20and%20eventually%20forward%20the%20traffic%20to%20the%20application%20defined%20as%20a%20backend.%20If%20we%20have%20a%20look%20at%20our%20sample%20app%2C%20you%20can%20see%20the%20HTTP%20headers%20injected%20by%20the%20Application%20Gateway%2C%20as%20well%20as%20the%20headers%20injected%20by%20App%20Proxy%20with%20authentication%20information%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAs%20you%20can%20see%2C%20headers%20like%26nbsp%3BGivenname%2C%26nbsp%3BSurname%26nbsp%3Band%26nbsp%3BUserprincipalname%26nbsp%3Bhave%20been%20introduced%20by%20AAD%20App%20Proxy%20with%20information%20relative%20to%20the%20authenticated%20user.%20Other%20headers%20like%26nbsp%3BX-Appgw-Trace-Id%26nbsp%3Band%26nbsp%3BX-Forwarded-Port%26nbsp%3Bhave%20been%20introduced%20by%20the%20App%20Gateway.%3C%2FP%3E%3CP%3EThe%26nbsp%3BX-Forwarded-For%26nbsp%3Bheader%20is%20interesting%2C%20because%20it%20contains%20the%20IP%20address%20of%20the%20original%20client%20(93.104.173.66%26nbsp%3Bin%20my%20example)%2C%20as%20well%20as%20the%20IP%20address%20of%20the%20first%20proxy%20in%20the%20chain%2C%20namely%20the%20App%20Proxy%20connector%20(172.16.2.4).%20So%20the%20client%20IP%20address%20information%20is%20not%20lost%20even%20if%20going%20through%20two%20reverse%20proxies%20here.%3C%2FP%3E%3CP%3EOne%20aspect%20that%20you%20need%20to%20consider%20is%20that%20the%20Application%20Gateway%20will%20sit%20between%20the%20connector%20and%20the%20application%2C%20you%20need%20to%20take%20care%20that%20it%20doesn%E2%80%99t%20break%20any%20authentication%20that%20may%20happen%20between%20the%20connector%20and%20the%20app.%20In%20my%20case%2C%20the%20app%20doesn%E2%80%99t%20provide%20any%20auth%2C%20otherwise%20you%20need%20to%20double%20check%20this%20point.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3EAAD%20App%20Proxy%20and%20Azure%20Front%20Door%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ELet%E2%80%99s%20make%20things%20a%20bit%20more%20complex%2C%20by%20inserting%20the%20Web%20Application%20Firewall%20in%20a%20different%20place.%20Another%20service%20in%20Azure%20that%20offers%20WAF%20functionality%20is%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fazure%2Ffrontdoor%2Ffront-door-overview%22%20rel%3D%22noopener%20noreferrer%22%20target%3D%22_blank%22%3EAzure%20Front%20Door%3C%2FA%3E.%20Front%20Door%20doesn%E2%80%99t%20sit%20on%20a%20VNet%2C%20but%20instead%20it%20is%20a%20multi-tenant%20service%20deployed%20on%20Microsoft%20Points-of-Presence%20across%20the%20Internet.%20As%20a%20consequence%2C%20it%20is%20not%20ideal%20to%20access%20private%20applications%20(an%20exception%20to%20this%20is%20if%20the%20application%20is%20deployed%20on%20an%20Azure%20VNet%2C%20where%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fazure%2Ffrontdoor%2Fprivate-link%22%20rel%3D%22noopener%20noreferrer%22%20target%3D%22_blank%22%3EFront%20Door%20support%20for%20Private%20Link%3C%2FA%3E%26nbsp%3Bis%20a%20fantastic%20tool).%3C%2FP%3E%3CP%3ETaking%20the%20generic%20case%20where%20the%20internal%20app%20can%20potentially%20sit%20on%20your%20local%20premises%2C%20the%20most%20intuitive%20design%20might%20be%20putting%20Azure%20Front%20Door%20in%20front%20of%20AAD%20App%20Proxy%2C%20in%20a%20constellation%20similar%20to%20this%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ENote%20the%20design%20is%20now%20more%20complex%2C%20because%20Front%20Door%20is%20sitting%20between%20the%20user%20and%20the%20AAD%20Proxy%20Portal%20that%20provides%20authentication.%20For%20this%20authentication%20to%20work%2C%20the%20redirection%20URL%20that%20Azure%20Active%20Directory%20will%20provide%20to%20the%20user%20after%20successful%20authentication%20needs%20to%20send%20them%20back%20to%20Front%20Door%20and%20not%20to%20the%20App%20Proxy%20portal%2C%20otherwise%20authentication%20would%20break.%3C%2FP%3E%3CP%3EWithout%20going%20into%20too%20much%20detail%2C%20the%20solution%20to%20this%20is%20using%20your%20own%20custom%20domain%20(in%20my%20case%20I%20bought%26nbsp%3Bstarkiller.info%26nbsp%3Bfor%20a%20couple%20of%20bucks)%20and%20your%20own%20digital%20certificates%20(which%20I%20generated%20from%20Let%E2%80%99s%20Encrypt%20and%20uploaded%20to%20my%20Azure%20Key%20Vault%20using%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fblog.cloudtrooper.net%2F2020%2F12%2F20%2Fusing-azure-container-instances-to-create-lets-encrypt-certificates%2F%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%20target%3D%22_blank%22%3Ethis%20method%3C%2FA%3E).%20This%20way%20you%20can%20define%20that%20your%20application%20is%20behind%20a%20custom%20domain%20name%20(whoami.starkiller.info)%2C%20but%20in%20your%20DNS%20you%20resolve%20this%20FQDN%20to%20Front%20Door%20via%20a%20CNAME%20record.%3C%2FP%3E%3CP%3ELet%E2%80%99s%20look%20first%20at%20the%20AAD%20App%20Proxy%20config%2C%20where%20I%20am%20using%20a%20custom%20domain%20that%20I%20previously%20associated%20to%20my%20tenant%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ENote%20that%20at%20the%20very%20bottom%20of%20the%20App%20Proxy%20config%20page%20you%20will%20see%20a%20blue%20banner%20that%20lets%20you%20know%20the%20FQDN%20that%20you%20can%20use%20to%20get%20to%20the%20App%20Proxy%20portal%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ENow%2C%20let%E2%80%99s%20have%20a%20look%20at%20the%20Front%20Door%20config.%20The%20tricky%20piece%20is%20sending%20the%20request%20to%20the%20origin%20to%20the%20right%20IP%20address%20(resolving%20the%20FQDN%26nbsp%3Bwhoami-starkiller.msappproxy.net)%2C%20but%20with%20the%20hostname%20that%20AAD%20App%20Proxy%20expects%20(whoami.starkiller.info).%20That%20is%20why%20it%20is%20necessary%20to%20overwrite%20the%20Origin%20Host%20Header%20as%20the%20origin%20configuration%20in%20Front%20Door%20shows%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAnd%20we%20are%20done!%20When%20we%20look%20at%20the%20HTTP%20headers%20that%20the%20application%20sees%2C%20as%20before%20we%20will%20see%20both%20the%20headers%20injected%20by%20Azure%20Front%20Door%20as%20well%20as%20the%20headers%20injected%20by%20App%20Proxy%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAgain%2C%20the%26nbsp%3BX-Forwarded-For%26nbsp%3Bheader%20can%20be%20used%20to%20see%20the%20client%E2%80%99s%20original%20IP%2C%20in%20this%20case%20an%20IPv6%20because%20my%20computer%20and%20ISP%20are%20fully%20dual%20stack.%3C%2FP%3E%3CP%3ETalking%20about%20the%20XFF%20header%2C%20you%20might%20have%20noticed%20that%20we%20now%20see%20there%20the%20IP%20address%26nbsp%3B147.243.102.107.%20This%20actually%20represents%20the%20first%20proxy%20in%20the%20chain%2C%20Azure%20Front%20Door%2C%20and%20it%20is%20a%20Microsoft-owned%20IP%20address%20for%20Front%20Door%20backend%20communication%20as%20you%20can%20see%20if%20you%20look%20deep%20into%20the%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fwww.microsoft.com%2Fen-us%2Fdownload%2Fconfirmation.aspx%3Fid%3D56519%22%20rel%3D%22noopener%20noreferrer%22%20target%3D%22_blank%22%3EAzure%20IP%20ranges%20JSON%20document%3C%2FA%3E%2C%20which%20will%20be%20important%20for%20the%20next%20section.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3ECan%20you%20bypass%20the%20WAF%3F%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWhat%20I%20mean%20here%20is%20whether%20a%20malicious%20actor%20could%20bypass%20Azure%20Front%20Door%20and%20access%20App%20Proxy%20directly%2C%20to%20fly%20below%20the%20WAF%20radar%3F%20In%20theory%20possible%2C%20if%20the%20malicious%20actor%20gets%20the%20right%20HTTP%20Host%20header%20to%20configure%20on%20their%20request%2C%20manipulates%20their%20local%20DNS%20resolution%20to%20resolve%26nbsp%3Bwhoami.starkiller.info%26nbsp%3Bto%20AAD%20App%20Proxy%E2%80%99s%20public%20IP%20address%2C%20and%20has%20valid%20AAD%20credentials%20authorized%20to%20access%20the%20app.%3C%2FP%3E%3CP%3EA%20relatively%20easy%20way%20to%20prevent%20this%20from%20happening%20is%20by%20configuring%20some%20filters%20at%20the%20application%20level%2C%20by%20making%20sure%20that%20the%20application%20request%20actually%20went%20through%20Azure%20Front%20Door%2C%20by%20checking%20that%20the%20IP%20address%20in%20the%26nbsp%3BX-Forwarded-For%26nbsp%3Bis%20actually%20a%20valid%20Front%20Door%20backend%20address%2C%20and%20additionally%20verifying%20that%20the%26nbsp%3BX-Azure-Fdid%26nbsp%3Bheader%20contains%20your%20Front%20Door%20instance%20ID.%3C%2FP%3E%3CP%3EFor%20more%20information%20on%20this%20you%20can%20check%20the%20Azure%20Front%20Door%20FAQ%20on%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fazure%2Ffrontdoor%2Ffront-door-faq%23how-do-i-lock-down-the-access-to-my-backend-to-only-azure-front-door-%22%20rel%3D%22noopener%20noreferrer%22%20target%3D%22_blank%22%3EHow%20do%20I%20lock%20down%20the%20access%20to%20my%20backend%20to%20only%20Azure%20Front%20Door%3F%3C%2FA%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3EThe%20Three%20Amigos%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWe%20could%20now%20chain%20all%20three%20reverse%20proxies%20we%20have%20been%20talking%20about%20in%20this%20article.%20Why%3F%20Because%20we%20can.%20Or%20to%20show%20that%20the%20two%20approaches%20above%20are%20not%20mutually%20exclusive.%20If%20we%20wanted%20for%20any%20reason%20to%20chain%20Front%20Door%20%2B%20App%20Proxy%20%2B%20App%20Gateway%2C%20this%20is%20what%20it%20would%20look%20like%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThis%20setup%20might%20actually%20make%20sense%20for%20example%20if%20the%20first%20proxy%20(Front%20Door%20in%20this%20case)%20provides%20global%20load%20balancing%2C%20the%20second%20one%20(AAD%20App%20Proxy)%20does%20the%20authentication%2C%20and%20the%20third%20one%20(App%20Gateway)%20some%20additional%20functions%20such%20as%20Web%20Application%20Firewalling.%20This%20design%20might%20be%20combined%20with%20other%20proxies%20such%20as%20Azure%20API%20Management.%3C%2FP%3E%3CP%3EAs%20you%20can%20imagine%2C%20now%20everybody%20is%20putting%20headers%20in%20the%20request%2C%20but%20still%20you%20can%20see%20the%20original%20client%20IP%20address%20in%20the%26nbsp%3BX-Forwarded-For%26nbsp%3Bheader%3A%3C%2FP%3E%20%26nbsp%3B%3CP%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3EWhen%20do%20I%20do%20what%3F%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20knew%20you%20would%20ask%2C%20and%20you%20might%20already%20know%20what%20my%20answer%20is%20going%20to%20be%20(%E2%80%9Cit%20depends%E2%80%9D).%20Here%20some%20decision%20criteria%3A%3C%2FP%3EIf%20you%20have%20internal%20applications%20deployed%20across%20multiple%20world%20locations%2C%20Front%20Door%20is%20a%20great%20solution%20because%20it%20can%20load%20balance%20across%20multiple%20instances%20of%20App%20Proxy%2C%20each%20located%20in%20separate%20geography.%20Another%20benefit%20of%20Front%20Door%20is%20that%20it%20not%20only%20integrates%20WAF%20functionality%2C%20but%20it%20gives%20CDN%20options%20as%20caching%20and%20compression%20too%2C%20potentially%20improving%20the%20application%20user%20experience.%20If%20your%20app%20is%20running%20in%20Azure%2C%20or%20it%20is%20running%20on-prem%20but%20you%20have%20good%20Azure%20connectivity%2C%20App%20Gateway%20is%20a%20good%20fit.%20One%20advantage%20of%20App%20GW%20is%20that%20you%20are%20100%25%20sure%20that%20all%20traffic%20from%20AAD%20Proxy%20goes%20through%20the%20WAF.%20Another%20point%20for%20the%20WAF%20solution%20is%20the%20fact%20that%20if%20you%20have%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fazure%2Fddos-protection%2Fddos-protection-overview%22%20rel%3D%22noopener%20noreferrer%22%20target%3D%22_blank%22%3EAzure%20DDoS%20Standard%3C%2FA%3E%26nbsp%3Benabled%20in%20the%20VNet%2C%20the%20cost%20of%20the%20WAF%20component%20for%20App%20Gateway%20goes%20away%20(see%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fddos-protection%2Fddos-faq%23how-does-pricing-work-%22%20rel%3D%22noopener%20noreferrer%22%20target%3D%22_blank%22%3Ethis%20FAQ%3C%2FA%3E).%3CP%3EI%20am%20sorry%20I%20am%20not%20giving%20you%20a%20black%20or%20white%20advice%20(those%20are%20rare%20and%20in%20my%20experience%20usually%20not%20universally%20applicable)%2C%20but%20I%20hope%20you%20learnt%20something%20with%20this%20post.%20Thanks%20for%20reading!%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-3331650%22%20slang%3D%22en-US%22%3E%3CP%3EHow%20do%20you%20expose%20onprem%20or%20Azure%20apps%20securily%3F%20With%20AAD%20Application%20proxy%20of%20course!%20But%20how%20do%20you%20add%20a%20Web%20Application%20Firewall%20to%20the%20design%3F%20Explore%20this%20post%20to%20learn%20it!%3C%2FP%3E%3C%2FLINGO-TEASER%3E%3CLINGO-LABS%20id%3D%22lingo-labs-3331650%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EApp%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EInfra%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Co-Authors
Version history
Last update:
‎May 06 2022 02:44 AM
Updated by: