Skip to content

Commit 87d670a

Browse files
authored
Merge pull request #295302 from halkazwini/fd-headers2
Update how-to-add-security-headers.md
2 parents 3770d0a + 88cac4d commit 87d670a

File tree

1 file changed

+21
-13
lines changed

1 file changed

+21
-13
lines changed
Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,26 @@
11
---
2-
title: Configure security headers with Azure Front Door Standard/Premium Rule Set
3-
description: This article provides guidance on how to use rule set to configure security headers.
2+
title: Configure security headers with Standard/Premium Rule Set
3+
titleSuffix: Azure Front Door
4+
description: Learn how to use Azure Front Door Standard/Premium rule sets to configure security headers and prevent browser-based vulnerabilities.
45
services: frontdoor
56
author: duongau
67
ms.service: azure-frontdoor
78
ms.topic: how-to
8-
ms.date: 08/31/2023
9+
ms.date: 02/25/2025
910
ms.author: yuajia
1011
---
1112

1213
# Configure security headers with Azure Front Door Standard/Premium Rule Set
1314

1415
This article shows how to implement security headers to prevent browser-based vulnerabilities like HTTP Strict-Transport-Security (HSTS), X-XSS-Protection, Content-Security-Policy, or X-Frame-Options. Security-based attributes can also be defined with cookies.
1516

16-
The following example shows you how to add a Content-Security-Policy header to all incoming requests that matches the path in the Route. Here, we only allow scripts from our trusted site, **https://contoso.azure-api.net** to run on our application.
17+
The following example shows you how to add a Content-Security-Policy header to all incoming requests that matches the path in the Route. Here, we only allow scripts from our trusted site, `https://contoso.azure-api.net` to run on our application.
1718

1819
## Prerequisites
1920

20-
* Before you can configure security headers, you must first create a Front Door. For more information, see [Quickstart: Create a Front Door](create-front-door-portal.md).
21-
* Review how to [Set up a Rule Set](how-to-configure-rule-set.md) if you haven't used the Rule Set feature before.
21+
- Azure Front Door. For more information, see [Quickstart: Create a Front Door](create-front-door-portal.md).
22+
23+
- Review how to [Set up a Rule Set](how-to-configure-rule-set.md) if you're new to the Rule Set feature.
2224

2325
## Add a Content-Security-Policy header in Azure portal
2426

@@ -28,23 +30,29 @@ The following example shows you how to add a Content-Security-Policy header to a
2830

2931
1. Set the operator to **Append** to add this header as a response to all of the incoming requests for this route.
3032

31-
1. Add the header name: **Content-Security-Policy** and define the values this header should accept. In this scenario, we choose *"script-src 'self' https://contoso.azure-api.net"*.
33+
1. Add the header name: **Content-Security-Policy** and define the values this header should accept. In this scenario, we choose `"script-src 'self' https://contoso.azure-api.net"`.
3234

33-
1. Once you've added all of the rules you'd like to your configuration, don't forget to associate the rule set with a route. This step is *required* to allow the rule set to take action.
35+
1. After adding all the rules you want to your configuration, remember to associate the rule set with a route. This step is **required** for the rule set to take action.
3436

3537
> [!NOTE]
36-
> In this scenario, we did not add [match conditions](concept-rule-set-match-conditions.md) to the rule. All incoming requests that match the path defined in the associated route will have this rule applied. If you would like it to only apply to a subset of those requests, be sure to add your specific **match conditions** to this rule.
38+
> In this scenario, we didn't add [match conditions](concept-rule-set-match-conditions.md) to the rule. All incoming requests that match the path defined in the associated route have this rule applied. To apply it only to a subset of those requests, add your specific **match conditions** to this rule.
39+
40+
> [!IMPORTANT]
41+
> If you're using Web Application Firewall (WAF) with your Azure Front Door, and it blocks a request, HSTS headers won't be added to the request even if they're enabled on the Azure Front Door.
3742
3843
## Clean up resources
3944

4045
### Deleting a Rule
4146

42-
In the preceding steps, you configured Content-Security-Policy header with Rule set. If you no longer want a rule, you can select the Rule Set name and then select Delete rule.
47+
In the preceding steps, you configured Content-Security-Policy header with Rule set. If you no longer want a rule, you can select the **Rule Set** and then select **Delete rule**.
4348

4449
### Deleting a Rule Set
4550

46-
If you want to delete a Rule Set, make sure you disassociate it from all routes before deleting. For detailed guidance on deleting a rule set, refer to [Configure your rule set](how-to-configure-rule-set.md).
51+
If you want to delete a Rule Set, make sure you disassociate it from all routes before deleting. For detailed guidance on deleting a rule set, see [Configure rule sets in Azure Front Door](how-to-configure-rule-set.md).
52+
53+
## Next step
4754

48-
## Next steps
55+
To learn how to configure a Web Application Firewall for your Front Door, see:
4956

50-
To learn how to configure a Web Application Firewall for your Front Door, see [Web Application Firewall and Front Door](../../web-application-firewall/afds/afds-overview.md).
57+
> [!div class="nextstepaction"]
58+
> [Web Application Firewall and Front Door](../../web-application-firewall/afds/afds-overview.md)

0 commit comments

Comments
 (0)