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/application-gateway/for-containers/how-to-waf-gateway-api.md
+75-69Lines changed: 75 additions & 69 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
---
2
-
title: Web Application Firewall on Application Gateway for Containers - Gateway API
3
-
description: This document provides an example scenario for testing the Web Application Firewall (WAF) on Application Gateway for Containers.
2
+
title: Azure Web Application Firewall on Application Gateway for Containers - Gateway API
3
+
description: This article provides an example scenario for testing Azure Web Application Firewall on Application Gateway for Containers.
4
4
services: application-gateway
5
5
author: jackstromberg
6
6
ms.service: azure-appgw-for-containers
@@ -9,42 +9,46 @@ ms.date: 7/21/2025
9
9
ms.author: jstrom
10
10
---
11
11
12
-
# Web Application Firewall on Application Gateway for Containers with Gateway API
12
+
# Azure Web Application Firewall on Application Gateway for Containers with the Gateway API
13
13
14
-
This document helps set up an example application that uses the following resources from Gateway API. Steps are provided to:
14
+
This article helps you set up an example application that uses resources from the Gateway API. The article provides steps to:
15
15
16
-
- Create a [Gateway](https://gateway-api.sigs.k8s.io/concepts/api-overview/#gateway) resource with one HTTPS listener.
17
-
- Create an [HTTPRoute](https://gateway-api.sigs.k8s.io/api-types/httproute) that references a backend service.
18
-
- Create a `WebApplicationFirewallPolicy` resource that references an HTTPRoute.
16
+
- Create a [`Gateway`](https://gateway-api.sigs.k8s.io/concepts/api-overview/#gateway) resource with one HTTPS listener.
17
+
- Create an [`HTTPRoute`](https://gateway-api.sigs.k8s.io/api-types/httproute)resource that references a back-end service.
18
+
- Create a `WebApplicationFirewallPolicy` resource that references an `HTTPRoute` resource.
19
19
20
20
## Background
21
21
22
-
Application Gateway for Containers leverages web application firewall to block a malicious request from being proxied to the backend target. See the following example scenario:
22
+
Application Gateway for Containers uses Azure Web Application Firewall to block a malicious request from being proxied to the back-end target. The following diagram shows an example scenario.
23
23
24
-

24
+

25
25
26
26
## Prerequisites
27
27
28
-
1. If following the BYO deployment strategy, ensure you have set up your Application Gateway for Containers resources and [ALB Controller](quickstart-deploy-application-gateway-for-containers-alb-controller.md)
29
-
2. If following the ALB managed deployment strategy, ensure you have provisioned your [ALB Controller](quickstart-deploy-application-gateway-for-containers-alb-controller.md) and provisioned the Application Gateway for Containers resources via the [ApplicationLoadBalancer custom resource](quickstart-create-application-gateway-for-containers-managed-by-alb-controller.md).
30
-
3. Deploy sample HTTP application
31
-
Apply the following deployment.yaml file on your cluster to create a sample web application to demonstrate the header rewrite.
28
+
- If you're following the bring-your-own (BYO) deployment strategy, ensure that you set up your Application Gateway for Containers resources and [ALB Controller](quickstart-deploy-application-gateway-for-containers-alb-controller.md).
- If you're following the Application Load Balancer (ALB) managed deployment strategy, ensure that you:
31
+
32
+
- Provisioned your [ALB Controller](quickstart-deploy-application-gateway-for-containers-alb-controller.md).
33
+
- Provisioned the Application Gateway for Containers resources via the [`ApplicationLoadBalancer` custom resource](quickstart-create-application-gateway-for-containers-managed-by-alb-controller.md).
34
+
35
+
- Apply the following `deployment.yaml` file on your cluster to create a sample web application that demonstrates the header rewrite:
RESOURCE_GROUP='<resource group name of the Application Gateway For Containers resource>'
79
-
RESOURCE_NAME='alb-test'
80
-
81
-
RESOURCE_ID=$(az network alb show --resource-group $RESOURCE_GROUP --name $RESOURCE_NAME --query id -o tsv)
82
-
FRONTEND_NAME='frontend'
83
-
```
81
+
```bash
82
+
RESOURCE_GROUP='<resource group name of the Application Gateway For Containers resource>'
83
+
RESOURCE_NAME='alb-test'
84
+
85
+
RESOURCE_ID=$(az network alb show --resource-group $RESOURCE_GROUP --name $RESOURCE_NAME --query id -o tsv)
86
+
FRONTEND_NAME='frontend'
87
+
```
84
88
85
-
2. Create a Gateway
89
+
2. Create a `Gateway` resource:
86
90
87
-
```bash
88
-
kubectl apply -f - <<EOF
89
-
apiVersion: gateway.networking.k8s.io/v1
90
-
kind: Gateway
91
-
metadata:
92
-
name: gateway-01
93
-
namespace: test-infra
94
-
annotations:
95
-
alb.networking.azure.io/alb-id: $RESOURCE_ID
96
-
spec:
97
-
gatewayClassName: azure-alb-external
98
-
listeners:
99
-
- name: http-listener
100
-
port: 80
101
-
protocol: HTTP
102
-
allowedRoutes:
103
-
namespaces:
104
-
from: Same
105
-
addresses:
106
-
- type: alb.networking.azure.io/alb-frontend
107
-
value: $FRONTEND_NAME
108
-
EOF
109
-
```
91
+
```bash
92
+
kubectl apply -f - <<EOF
93
+
apiVersion: gateway.networking.k8s.io/v1
94
+
kind: Gateway
95
+
metadata:
96
+
name: gateway-01
97
+
namespace: test-infra
98
+
annotations:
99
+
alb.networking.azure.io/alb-id: $RESOURCE_ID
100
+
spec:
101
+
gatewayClassName: azure-alb-external
102
+
listeners:
103
+
- name: http-listener
104
+
port: 80
105
+
protocol: HTTP
106
+
allowedRoutes:
107
+
namespaces:
108
+
from: Same
109
+
addresses:
110
+
- type: alb.networking.azure.io/alb-frontend
111
+
value: $FRONTEND_NAME
112
+
EOF
113
+
```
110
114
111
115
---
112
116
113
-
Once the gateway resource is created, ensure the status is valid, the listener is _Programmed_, and an address is assigned to the gateway.
117
+
After you create the `Gateway` resource, ensure that the status is valid, the listener has a status of `Programmed`, and an address is assigned to it:
114
118
115
119
```bash
116
120
kubectl get gateway gateway-01 -n test-infra -o yaml
117
121
```
118
122
119
-
Example output of successful gateway creation.
123
+
Here's example output for successful creation of a `Gateway` resource:
120
124
121
125
```yaml
122
126
status:
@@ -163,7 +167,7 @@ status:
163
167
kind: HTTPRoute
164
168
```
165
169
166
-
Once the gateway is created, create an HTTPRoutethat listens for hostname contoso.com.
170
+
Create an `HTTPRoute` resource that listens for the host name `contoso.com`:
167
171
168
172
```bash
169
173
kubectl apply -f - <<EOF
@@ -185,13 +189,13 @@ spec:
185
189
EOF
186
190
```
187
191
188
-
Once the HTTPRoute resource is created, ensure the route is _Accepted_ and the Application Gateway for Containers resource is _Programmed_.
192
+
After you create the `HTTPRoute` resource, ensure that the status of the route is `Accepted` and the status of the Application Gateway for Containers resource is `Programmed`:
189
193
190
194
```bash
191
195
kubectl get httproute header-rewrite-route -n test-infra -o yaml
192
196
```
193
197
194
-
Verify the status of the Application Gateway for Containers resource has been successfully updated.
198
+
Verify that the status of the Application Gateway for Containers resource was successfully updated:
195
199
196
200
```yaml
197
201
status:
@@ -225,7 +229,7 @@ status:
225
229
226
230
### Configure WebApplicationFirewallPolicy
227
231
228
-
Application Gateway for Containers uses a custom resource called `WebApplicationFirewallPolicy` to define WAF protection. In this example, WAF will protect a specific HTTPRoute.
232
+
Application Gateway for Containers uses a custom resource called `WebApplicationFirewallPolicy` to define Azure Web Application Firewall protection. In this example, Azure Web Application Firewall helps protect a specific `HTTPRoute` resource:
229
233
230
234
```bash
231
235
kubectl apply -f - <<EOF
@@ -240,12 +244,13 @@ spec:
240
244
kind: HTTPRoute
241
245
name: contoso-waf-route
242
246
namespace: test-infra
243
-
#sectionNames: ["listenerA"] # defined if targeting a specific listener on a gateway resource or path
247
+
#sectionNames: ["listenerA"] # defined if you're targeting a specific listener on a gateway resource or path
Now we're ready to send some traffic to our sample application, via the FQDN assigned to the frontend. Use the following command to get the FQDN:
274
+
Now you're ready to send some traffic to the sample application, via the fully qualified domain name (FQDN) assigned to the frontend resource. Use the following command to get the FQDN:
269
275
270
276
```bash
271
277
fqdn=$(kubectl get gateway gateway-01 -n test-infra -o jsonpath='{.status.addresses[0].value}')
272
278
```
273
279
274
-
If you specify the server name indicator using the curl command, `contoso.com` for the frontend FQDN, the output should return a response from the backend-v1 service.
280
+
If you specify the server name indicator by using the `curl` command, with `contoso.com` for the frontend resource's FQDN, the output should return a response from the `backend-v1` service:
Congratulations, you have installed ALB Controller, deployed a backend application and used Web Application Firewall functionality to block a malicious request.
333
+
Congratulations! You installed an ALB Controller, deployed a back-end application, and used Azure Web Application Firewall functionality to block a malicious request.
title: Web Application Firewall on Application Gateway for Containers
3
-
description: This page provides an overview of the Web Application Firewall (WAF) on Application Gateway for Containers, including setup, limitations, known issues, and more.
2
+
title: Azure Web Application Firewall on Application Gateway for Containers
3
+
description: This article provides an overview of Azure Web Application Firewall on Application Gateway for Containers, including setup, limitations, and pricing.
4
4
services: application-gateway
5
5
author: jackstromberg
6
6
ms.service: azure-appgw-for-containers
7
-
ms.topic: how-to
7
+
ms.topic: concept-article
8
8
ms.date: 7/22/2025
9
9
ms.author: jstrom
10
10
---
11
11
12
-
# Web Application Firewall on Application Gateway for Containers
12
+
# Azure Web Application Firewall on Application Gateway for Containers
13
13
14
-
Web Application Firewall (WAF) provides centralized protection of your web applications from common exploits and vulnerabilities. All WAF functionality exists inside of a WAF policy, which can be referenced at listener or path-based routing rules within Gateway API yaml configuration.
14
+
Azure Web Application Firewall provides centralized protection of your web applications from common exploits and vulnerabilities. All Azure Web Application Firewall functionality exists inside a policy, which can be referenced at listener or path-based routing rules within the Gateway API YAML configuration.
15
15
16
-

16
+

17
17
18
18
## Application Gateway for Containers implementation
19
19
20
-
### Security Policy
20
+
### Security policy
21
21
22
-
Application Gateway for Containers introduces a new child resource in Azure Resource Manager (ARM), called a SecurityPolicy. The SecurityPolicy is what brings scope to which WAF policies may be referenced by the ALB Controller.
22
+
Application Gateway for Containers introduces a new child resource called `SecurityPolicy`in Azure Resource Manager. The `SecurityPolicy` resource brings scope to which Azure Web Application Firewall policies the ALB Controller can reference.
23
23
24
-
### Kubernetes Custom Resource
24
+
### Kubernetes custom resource
25
25
26
-
Application Gateway for Containers introduces a new custom resource called `WebApplicationFirewallPolicy`. The custom resource is responsible for defining which WAF Policy should be used at which scope.
26
+
Application Gateway for Containers introduces a new custom resource called `WebApplicationFirewallPolicy`. The custom resource is responsible for defining which Azure Web Application Firewall policy should be used at which scope.
27
27
28
-
The following scopes may be defined:
28
+
The resource can define the following scopes:
29
29
30
-
* Gateway
31
-
* HTTPRoute
30
+
*`Gateway`
31
+
*`HTTPRoute`
32
32
33
-
In addition, the following sections may be referenced by name for each of the parent resources:
33
+
In addition, the resource can reference the following sections by name for each of the parent resources:
34
34
35
-
* Gateway - Listener
36
-
* HTTPRoute - Path
35
+
*`Gateway`: `Listener`
36
+
*`HTTPRoute`: `Path`
37
37
38
-
Here is an example YAML configuration that shows targeting a specific path called `pathA` on an HTTPRoute resource:
38
+
Here's an example YAML configuration that shows targeting a specific path called `pathA` on an `HTTPRoute` resource:
39
39
40
40
```yaml
41
41
apiVersion: alb.networking.azure.io/v1
@@ -56,23 +56,22 @@ spec:
56
56
57
57
## Limitations
58
58
59
-
The following functionality is not supported on a WAF Policy associated with Application Gateway for Containers:
59
+
The following functionality is not supported on an Azure Web Application Firewall policy that's associated with Application Gateway for Containers:
60
60
61
-
* WAF Security Copilot
62
-
* JavaScript (JS) Challenge Actions
63
-
* CRS 3.2 and lower ruleset
61
+
* Azure Web Application Firewall integration in Microsoft Security Copilot
62
+
* JavaScript challenge actions
63
+
* Core Rule Set (CRS) 3.2 and earlier rule sets
64
64
65
65
## Pricing
66
66
67
-
WAF is incrementally billed in addition to Application Gateway for Containers. Two meters track WAF consumption:
67
+
Azure Web Application Firewall is incrementally billed in addition to Application Gateway for Containers. Two metrics track Azure Web Application Firewall consumption:
68
68
69
-
* AGC WAF Hour
70
-
* AGC 1M WAF Requests
69
+
* `AGC WAF Hour`
70
+
* `AGC 1M WAF Requests`
71
71
72
-
An AGC WAF Houris incurred for the duration a security policy has a WAF policy referenced.
72
+
An `AGC WAF Hour` rate is incurred for the duration that a security policy references an Azure Web Application Firewall policy.
73
73
74
-
As each request is processed by WAF rules or Bot Protection, a consumption rate is billed per 1 million requests.
74
+
As Azure Web Application Firewall rules or bot protection processes each request, a consumption rate is billed per 1 million requests.
75
75
76
76
> [!NOTE]
77
-
> Application Gateway for Containers + WAF is in PREVIEW.
78
-
> See the [Supplemental Terms of Use for Microsoft Azure Previews](https://azure.microsoft.com/support/legal/preview-supplemental-terms/) for legal terms that apply to Azure features that are in beta, preview, or otherwise not yet released into general availability.
77
+
> The association of Application Gateway for Containers with Azure Web Application Firewall is in preview. For legal terms that apply to Azure features that are in beta, in preview, or otherwise not yet released into general availability, see [Supplemental Terms of Use for Microsoft Azure Previews](https://azure.microsoft.com/support/legal/preview-supplemental-terms/).
Copy file name to clipboardExpand all lines: includes/application-gateway-for-containers-frontend-naming.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@ ms.topic: include
5
5
ms.date: 08/14/2023
6
6
ms:author: mbender
7
7
---
8
-
> [!Note]
9
-
> When the ALB Controller creates the Application Gateway for Containers resources in ARM, it'll use the following naming convention for a frontend resource: fe-\<8 randomly generated characters\>
8
+
> [!NOTE]
9
+
> When the ALB Controller creates the Application Gateway for Containers resources in Azure Resource Manager, it uses the following naming convention for a frontend resource: `fe-<eight randomly generated characters>`.
10
10
>
11
-
> If you would like to change the name of the frontend created in Azure, consider following the [bringyourown deployment strategy](../articles/application-gateway/for-containers/overview.md#deployment-strategies).
11
+
> If you want to change the name of the frontend resource created in Azure, consider following the [bring-your-own deployment strategy](../articles/application-gateway/for-containers/overview.md#deployment-strategies).
0 commit comments