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
title: 'Tutorial: Add security headers with Rules Engine - Azure Front Door'
3
-
description: This tutorial teaches you how to configure a security header via Rules Engine on Azure Front Door
2
+
title: 'Tutorial: Add security headers with Rules Engine'
3
+
titleSuffix: Azure Front Door
4
+
description: In this tutorial, you learn how to configure a security header via Rules Engine on Azure Front Door using the Azure portal.
4
5
author: halkazwini
5
6
ms.author: halkazwini
6
7
ms.service: azure-frontdoor
7
8
ms.topic: tutorial
8
-
ms.date: 11/15/2024
9
+
ms.date: 04/10/2025
9
10
10
11
# Customer intent: As an IT admin, I want to learn about Front Door and how to configure a security header via Rules Engine.
11
12
---
12
13
13
-
# Tutorial: Add Security Headers with Rules Engine
14
+
# Tutorial: Add security headers with rules engine
14
15
15
16
[!INCLUDE [Azure Front Door (classic) retirement notice](../../includes/front-door-classic-retirement.md)]
16
17
17
18
This tutorial demonstrates how to implement security headers to prevent browser-based vulnerabilities such as HTTP Strict-Transport-Security (HSTS), X-XSS-Protection, Content-Security-Policy, and X-Frame-Options. Security attributes can also be defined with cookies.
18
19
19
-
The example below shows how to add a Content-Security-Policy header to all incoming requests that match the path defined in the route associated with your Rules Engine configuration. In this scenario, only scripts from the trusted site **https://apiphany.portal.azure-api.net** are allowed to run on the application.
20
+
The example in this tutorial shows how to add a Content-Security-Policy header to all incoming requests that match the path defined in the route associated with your rules engine configuration. In this scenario, only scripts from the trusted site `https://apiphany.portal.azure-api.net` are allowed to run on the application.
20
21
21
-
In this tutorial, you will learn how to:
22
+
In this tutorial, you learn how to:
22
23
> [!div class="checklist"]
23
-
> - Configure a Content-Security-Policy within Rules Engine.
24
+
> - Configure a Content-Security-Policy within rules engine.
24
25
25
26
## Prerequisites
26
27
27
28
* An Azure subscription.
28
-
* An Azure Front Door. To complete this tutorial, you must have an Azure Front Door configured with Rules Engine. For more information, see [Quickstart: Create an Azure Front Door](quickstart-create-front-door.md) and [Configure your Rules Engine](front-door-tutorial-rules-engine.md).
29
+
* An Azure Front Door. To complete this tutorial, you must have an Azure Front Door configured with rules engine. For more information, see [Create an Azure Front Door](quickstart-create-front-door.md) and [Configure your rules engine](front-door-tutorial-rules-engine.md).
29
30
30
31
## Add a Content-Security-Policy header in Azure portal
31
32
32
-
1. In your Azure Front Door resource, go to **Settings** and select **Rules engine configuration**. Choose the rules engine where you want to add the security header.
33
+
1. In your Azure Front Door resource, select **Rules engine configuration** under **Settings**. Choose the rules engine where you want to add the security header.
33
34
34
-
2.Click**Add rule** to create a new rule. Name the rule and then select **Add an Action** > **Response Header**.
35
+
2.Select**Add rule** to create a new rule. Name the rule and then select **Add an Action** > **Response Header**.
35
36
36
37
3. Set the Operator to **Append** to add this header to all incoming requests for this route.
37
38
38
-
4. Enter the header name: *Content-Security-Policy* and specify the values for this header. In this example, use *`script-src 'self' https://apiphany.portal.azure-api.net`*. Click**Save**.
39
+
4. Enter the header name: *Content-Security-Policy* and specify the values for this header. In this example, use *`script-src 'self' https://apiphany.portal.azure-api.net`*. Select**Save**.
39
40
40
41
:::image type="content" source="./media/front-door-security-headers/front-door-security-header.png" alt-text="Screenshot showing the added security header.":::
41
42
@@ -51,11 +52,9 @@ In this tutorial, you will learn how to:
51
52
52
53
## Clean up resources
53
54
54
-
If you no longer need the security header rule configured in the previous steps, you can remove it. To do this, go to the rules engine in your Azure Front Door resource and select **Delete rule**.
55
+
If you no longer need the security header rule configured in the previous steps, you can remove it by selecting **Delete rule** in the rules engine.
55
56
56
-
## Next steps
57
-
58
-
To learn how to configure a Web Application Firewall for your Azure Front Door, proceed to the next tutorial.
57
+
## Next step
59
58
60
59
> [!div class="nextstepaction"]
61
60
> [Web Application Firewall and Azure Front Door](front-door-waf.md)
0 commit comments