You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/frontdoor/front-door-waf.md
+18-18Lines changed: 18 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,15 +20,15 @@ ms.author: tremansdoerfer
20
20
21
21
# Quickly scale and protect a web application using Azure Front Door and Azure Web Application Firewall (WAF)
22
22
23
-
Many web applications have experienced rapid increase of traffic in recent weeks related to Covid 19. In addition, these web applications are also observing a surge in malicious traffic including denial of service attacks. An effective way to handle both these needs, scale out for traffic surges and protect from attacks, is to setup Azure Front Door with Azure WAF as an acceleration, caching and security layer in front of your web application. This article provides guidance on how to quickly get this Azure Front Door with Azure WAF setup for any web applications running in or outside of Azure.
23
+
Many web applications have experienced rapid increase of traffic in recent weeks related to COVID-19. In addition, these web applications are also observing a surge in malicious traffic including denial of service attacks. An effective way to handle both these needs, scale out for traffic surges and protect from attacks, is to set up Azure Front Door with Azure WAF as an acceleration, caching and security layer in front of your web application. This article provides guidance on how to quickly get this Azure Front Door with Azure WAF setup for any web applications running in or outside of Azure.
24
24
25
-
We will be using Azure CLI to set this up in this tutorial, but all these steps are also fully supported in Azure Portal, Azure PowerShell, Azure ARM and Azure REST APIs.
25
+
We will be using Azure CLI to set up the WAF in this tutorial, but all these steps are also fully supported in Azure portal, Azure PowerShell, Azure ARM, and Azure REST APIs.
26
26
27
27
### Prerequisites
28
28
29
29
If you don't have an Azure subscription, create a [free account](https://azure.microsoft.com/free/?WT.mc_id=A261C142F) before you begin.
30
30
31
-
The instructions in this blog use the Azure Command Line Interface (CLI). Please visit this guide to [get started with Azure CLI](https://docs.microsoft.com/cli/azure/get-started-with-azure-cli?view=azure-cli-latest).
31
+
The instructions in this blog use the Azure Command Line Interface (CLI). View this guide to [get started with Azure CLI](https://docs.microsoft.com/cli/azure/get-started-with-azure-cli?view=azure-cli-latest).
32
32
33
33
*Tip: an easy & quick way to get started on Azure CLI is with [Bash in Azure Cloud Shell](https://docs.microsoft.com/azure/cloud-shell/quickstart)*
34
34
@@ -38,7 +38,7 @@ Ensure that the front-door extension is added to your Azure CLI
38
38
az extension add --name front-door
39
39
```
40
40
41
-
Note: For more details of the commands listed below, please refer to the [Azure CLI reference for Front Door](https://docs.microsoft.com/cli/azure/ext/front-door/?view=azure-cli-latest).
41
+
Note: For more details of the commands listed below, refer to the [Azure CLI reference for Front Door](https://docs.microsoft.com/cli/azure/ext/front-door/?view=azure-cli-latest).
42
42
43
43
### Step 1: Create an Azure Front Door (AFD) resource
44
44
@@ -47,15 +47,15 @@ Note: For more details of the commands listed below, please refer to the [Azure
**--backend-address**: This is the Fully Qualified Domain Name (FQDN) name of the application you want to protect. For example myapplication.contoso.com
50
+
**--backend-address**: The backend address is the Fully Qualified Domain Name (FQDN) name of the application you want to protect. For example, myapplication.contoso.com
51
51
52
-
**--accepted-protocols**: This specifies what all protocols you want AFD to support for your web application. An example would be --accepted-protocols Http Https.
52
+
**--accepted-protocols**: The accepted protocols specifies what all protocols you want AFD to support for your web application. An example would be --accepted-protocols Http Https.
53
53
54
54
**--name**: Specify a name for your AFD resource
55
55
56
-
**--resource-group**: The resource group you want to place this AFD resource in. To learn more about resource groups, please visit manage resource groups in Azure
56
+
**--resource-group**: The resource group you want to place this AFD resource in. To learn more about resource groups, visit manage resource groups in Azure
57
57
58
-
In the response you get from successfully executing this command, look for the key "hostName" and note down its value to be used in a later step. This is the DNS name of the AFD resource you had just created
58
+
In the response you get from successfully executing this command, look for the key "hostName" and note down its value to be used in a later step. The hostName is the DNS name of the AFD resource you had created
59
59
60
60
### Step 2: Create an Azure WAF profile to use with Azure Front Door resources
--resource-group The resource group you want to place this WAF resource in.
69
69
70
-
This will create a WAF policy which is enabled and is in the Prevention mode.
70
+
The CLI code above will create a WAF policy that is enabled and is in the Prevention mode.
71
71
72
72
Note: you may also want to create the WAF in Detection mode and observe how it is detecting & logging malicious requests (and not blocking) before deciding to change to Protection mode.
73
73
74
-
In the response you get from successfully executing this command, look for the key "id" and note down its value to be used in a later step. This should be in the format
74
+
In the response you get from successfully executing this command, look for the key "ID" and note down its value to be used in a later step. The ID field should be in the format
75
75
76
76
/subscriptions/**subscription id**/resourcegroups/**resource group name**/providers/Microsoft.Network/frontdoorwebapplicationfirewallpolicies/**WAF policy name**
77
77
78
78
### Step 3: Add managed rulesets to this WAF policy
79
79
80
-
In a WAF policy you can add managed rulesets which are a sets of rules built and managed by Microsoft and gives out of the box protection against entire classes of threats. In this example, we are adding two such rulesets (1) Default ruleset that protects against common web threats and (2) Bot protection ruleset which protects against malicious bots
80
+
In a WAF policy, you can add managed rulesets that are a set of rules built and managed by Microsoft and gives out of the box protection against entire classes of threats. In this example, we are adding two such rulesets (1) Default ruleset that protects against common web threats and (2) Bot protection ruleset, which protects against malicious bots
--resource-group The resource group you had placed the Azure Front Door resource in.
109
109
110
-
--set This is where you update the attribute WebApplicationFirewallPolicyLink for the frontendEndpoint associated with your AFD resource with the newly built WAF policy. The id of the WAF policy can be found from the response you got from step #2 above
110
+
--set This is where you update the attribute WebApplicationFirewallPolicyLink for the frontendEndpoint associated with your AFD resource with the newly built WAF policy. The ID of the WAF policy can be found from the response you got from step #2 above
111
111
112
112
Note: the above example is for the case where you are not using a custom domain, if you are
113
113
114
114
If you are not using any custom domains to access your web applications, you can skip step #5. In that case, you will be providing to your end users the hostname you obtained in step #1 to navigate to your web application
115
115
116
116
### Step 5: Configure custom domain for your web application
117
117
118
-
Initially the custom domain name of your web application (the one that customers use to refer to your application, e.g. www.contoso.com) was pointing towards the place where you had it running before AFD was introduced. After this change of architecture adding AFD+WAF to front the application, the DNS entry corresponding to that custom domain should now point to this AFD resource. This can be done by re-mapping this entry in your DNS server to the AFD hostname you had noted in step #1.
118
+
Initially the custom domain name of your web application (the one that customers use to refer to your application, for example, www.contoso.com) was pointing towards the place where you had it running before AFD was introduced. After this change of architecture adding AFD+WAF to front the application, the DNS entry corresponding to that custom domain should now point to this AFD resource. This can be done by remapping this entry in your DNS server to the AFD hostname you had noted in step #1.
119
119
120
-
Specific steps to do this will depend on your DNS service provider, but if you are using Azure DNS to host your DNS name, you can refer to the documentation for [steps do update a DNS record](https://docs.microsoft.com/azure/dns/dns-operations-recordsets-cli) and point to the AFD hostName.
120
+
Specific steps to update your DNS records will depend on your DNS service provider, but if you are using Azure DNS to host your DNS name, you can refer to the documentation for [steps do update a DNS record](https://docs.microsoft.com/azure/dns/dns-operations-recordsets-cli) and point to the AFD hostName.
121
121
122
-
One key thing to note here is that, if you need your users to navigate to your website using the zone apex, e.g. contoso.com, you have to use Azure DNS and it's [ALIAS record type](https://docs.microsoft.com/azure/dns/dns-alias) to host your DNS name.
122
+
One key thing to note here is that, if you need your users to navigate to your website using the zone apex, for exmaple, contoso.com, you have to use Azure DNS and it's [ALIAS record type](https://docs.microsoft.com/azure/dns/dns-alias) to host your DNS name.
123
123
124
124
In addition, you also need to update your AFD configuration to [add this custom domain](https://docs.microsoft.com/azure/frontdoor/front-door-custom-domain) to it so that AFD understands this mapping.
125
125
126
126
Finally, if you are using a custom domain to reach your web application and want to enable the HTTPS protocol, you need to have the [certificates for your custom domain setup in AFD](https://docs.microsoft.com/azure/frontdoor/front-door-custom-domain-https).
127
127
128
-
### Step 6: Lockdown your web application
128
+
### Step 6: Lock down your web application
129
129
130
-
One optional best practice to follow is to ensure that only AFD edges can communicate with your web application. This will ensure that no one can bypass the AFD protections and access your applications directly. You can accomplish this lockdown by visiting the [FAQ section of AFD](https://docs.microsoft.com/azure/frontdoor/front-door-faq) and referring to the question regarding locking down backends for access only by AFD.
130
+
One optional best practice to follow is to ensure that only AFD edges can communicate with your web application. This action will ensure that no one can bypass the AFD protections and access your applications directly. You can accomplish this lock down by visiting the [FAQ section of AFD](https://docs.microsoft.com/azure/frontdoor/front-door-faq) and referring to the question regarding locking down backends for access only by AFD.
0 commit comments