Skip to content

Commit 559acbd

Browse files
authored
feat: Add pseudo-variables to F5 WAF for NGINX (#1402)
This commit uses the shortcode psuedo-variable pattern to make multiple component versions for F5 WAF for NGINX into strings. This allows for content in multiple locations to be changed at once by updating the file relating to the version. Many of the versions are currently identical: if the individual components all use the same version, then the amount of shortcode files can be reduced accordingly. - Closes #1318 by replacing the string with a shortcode - Closes #1364 by creating shortcode psuedovariables for each item
1 parent 2f9809e commit 559acbd

13 files changed

+46
-64
lines changed

content/waf/configure/compiler.md

Lines changed: 6 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@ weight: 300
77
toc: true
88
# Types have a 1:1 relationship with Hugo archetypes, so you shouldn't need to change this
99
nd-content-type: how-to
10-
# Intended for internal catalogue and search, case sensitive:
11-
# Agent, N4Azure, NIC, NIM, NGF, NAP-DOS, NAP-WAF, NGINX One, NGINX+, Solutions, Unit
12-
nd-product: NAP-WAF
10+
nd-product: WAF
1311
---
1412

1513
This document describes how to use the F5 WAF for NGINX compiler, a tool for converting security policies and logging profiles from JSON to a bundle file that F5 WAF can process and apply.
@@ -64,7 +62,7 @@ This example Dockerfile is based on a Debian image.
6462

6563
```dockerfile
6664
# syntax=docker/dockerfile:1
67-
ARG BASE_IMAGE=private-registry.nginx.com/nap/waf-compiler:<version-tag>
65+
ARG BASE_IMAGE=private-registry.nginx.com/nap/waf-compiler:{{< version-waf-compiler >}}
6866
FROM ${BASE_IMAGE}
6967

7068
# Installing packages as root
@@ -114,23 +112,6 @@ Replace `<path-to-your-nginx-repo.key>` with the location of your client key and
114112
curl -s https://private-registry.nginx.com/v2/nap/waf-compiler/tags/list --key <path-to-your-nginx-repo.key> --cert <path-to-your-nginx-repo.crt>
115113
```
116114

117-
```json
118-
{
119-
"name": "nap/waf-compiler",
120-
"tags": [
121-
"1.0.0",
122-
"5.1.0",
123-
"5.2.0"
124-
]
125-
}
126-
```
127-
128-
{{< call-out "note" >}}
129-
130-
The [jq](https://jqlang.github.io/jq/) command was used to format the example output.
131-
132-
{{< /call-out >}}
133-
134115
## Build the container image
135116

136117
Run the following command to build your image, where `waf-compiler-<version-tag>:custom` is an example of the image tag:
@@ -190,7 +171,7 @@ To compile a policy with global settings, add the `-g` parameter:
190171
```shell
191172
docker run --rm \
192173
-v $(pwd):$(pwd) \
193-
waf-compiler-1.0.0:custom \
174+
waf-compiler-<version-tag>:custom \
194175
-g $(pwd)/global_settings.json -p $(pwd)/policy.json -o $(pwd)/compiled_policy.tgz
195176
```
196177

@@ -199,7 +180,7 @@ You can incorporate the source of the policy (as `policy.json`) or logging profi
199180
```shell
200181
docker run --rm \
201182
-v $(pwd):$(pwd) \
202-
waf-compiler-1.0.0:custom \
183+
waf-compiler-<version-tag>:custom \
203184
-include-source -full-export -g $(pwd)/global_settings.json -p $(pwd)/policy.json -o $(pwd)/compiled_policy.tgz
204185
```
205186

@@ -236,6 +217,7 @@ When [configuring policies]({{< ref "/waf/policies/configuration.md">}}), you ma
236217
There are ways to remediate them based on the context:
237218

238219
{{< table >}}
220+
239221
| Description | Solution |
240222
| ----------------------- | -------- |
241223
| _Expected declarative policy_ | Ensure the JSON of the policy is well-formed |
@@ -248,6 +230,7 @@ There are ways to remediate them based on the context:
248230
| _Duplicate policy name found_ | Don't compile multiple policies with the same name, or one policy to multiple bundles. Each policy can be compiled once but a bundle can be re-used. |
249231
| _Duplicate logging profile name found_ | Don't compile the same logging profile to multiple bundles. Each profile can be compiled once but a bundle can be re-used. |
250232
| _Timeout waiting for enforcer_ | Likely an internal issue: [contact Support]({{< ref "/waf/support.md" >}}) |
233+
251234
{{< /table >}}
252235

253236
## Global settings

content/waf/fundamentals/technical-specifications.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ nd-product: NAP-WAF
1414

1515
This page outlines the technical specifications for F5 WAF for NGINX, which includes the minimum requirements and supported platforms.
1616

17+
The latest version of F5 WAF for NGINX is {{< version-waf >}}.
18+
1719
## Resource limitations
1820

1921
- F5 WAF for NGINX supports a **maximum** of **127** CPU cores.

content/waf/install/disconnected-environment.md

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@ weight: 500
77
toc: false
88
# Types have a 1:1 relationship with Hugo archetypes, so you shouldn't need to change this
99
nd-content-type: how-to
10-
# Intended for internal catalogue and search, case sensitive:
11-
# Agent, N4Azure, NIC, NIM, NGF, NAP-DOS, NAP-WAF, NGINX One, NGINX+, Solutions, Unit
12-
nd-product: NAP-WAF
10+
nd-product: WAF
1311
---
1412

1513
This topic describes how to install F5 WAF for NGINX in a disconnected or air-gapped environment.
@@ -48,7 +46,6 @@ You will need `git` and `wget` in your connected environment.
4846

4947
Run the following two commands: replace `<hugo-release>` with the tarball appropriate to the environment from [the release page](https://github.com/gohugoio/hugo/releases/tag/v0.147.8):
5048

51-
5249
```shell
5350
git clone git@github.com:nginx/documentation.git
5451
wget <hugo-release>
@@ -97,10 +94,10 @@ Once you've obtained the package files and transferred them to your disconnected
9794
After pulling or building Docker images in a connected environment, you can save them to `.tar` files:
9895

9996
```shell
100-
docker save -o waf-enforcer.tar waf-enforcer:5.2.0
101-
docker save -o waf-config-mgr.tar waf-config-mgr:5.2.0
97+
docker save -o waf-enforcer.tar waf-enforcer:{{< version-waf-enforcer >}}
98+
docker save -o waf-config-mgr.tar waf-config-mgr:{{< version-waf-config-mgr >}}
10299
# Optional, if using IP intelligence
103-
docker save -o waf-ip-intelligence.tar waf-ip-intelligence:5.2.0
100+
docker save -o waf-ip-intelligence.tar waf-ip-intelligence:{{< version-waf-ip-intelligence >}}
104101
```
105102

106103
You can then transfer the files and load the images in your disconnected environment:
@@ -112,5 +109,4 @@ docker load -i waf-config-mgr.tar
112109
docker load -i waf-ip-intelligence.tar
113110
```
114111

115-
Ensure your Docker compose files use the tagged images you've transferred.
116-
112+
Ensure your Docker compose files use the tagged images you've transferred.

content/waf/install/docker.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@ weight: 400
77
toc: true
88
# Types have a 1:1 relationship with Hugo archetypes, so you shouldn't need to change this
99
nd-content-type: how-to
10-
# Intended for internal catalogue and search, case sensitive:
11-
# Agent, N4Azure, NIC, NIM, NGF, NAP-DOS, NAP-WAF, NGINX One, NGINX+, Solutions, Unit
12-
nd-product: NAP-WAF
10+
nd-product: WAF
1311
---
1412

1513
This page describes how to install F5 WAF for NGINX using Docker.
@@ -466,7 +464,7 @@ services:
466464

467465
waf-enforcer:
468466
container_name: waf-enforcer
469-
image: waf-enforcer:5.2.0
467+
image: waf-enforcer:{{< version-waf-enforcer >}}
470468
environment:
471469
- ENFORCER_PORT=50000
472470
ports:
@@ -479,7 +477,7 @@ services:
479477

480478
waf-config-mgr:
481479
container_name: waf-config-mgr
482-
image: waf-config-mgr:5.2.0
480+
image: waf-config-mgr:{{< version-waf-config-mgr >}}
483481
volumes:
484482
- /opt/app_protect/bd_config:/opt/app_protect/bd_config
485483
- /opt/app_protect/config:/opt/app_protect/config

content/waf/install/kubernetes-plm.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,7 @@ nd-banner:
1111
md: /_banners/waf-early-availability.md
1212
# Types have a 1:1 relationship with Hugo archetypes, so you shouldn't need to change this
1313
nd-content-type: reference
14-
# Intended for internal catalogue and search, case sensitive:
15-
# Agent, N4Azure, NIC, NIM, NGF, NAP-DOS, NAP-WAF, NGINX One, NGINX+, Solutions, Unit
16-
nd-product: NAP-WAF
14+
nd-product: WAF
1715
---
1816

1917
There are two new features available for Kubernetes through early access:
@@ -278,7 +276,7 @@ appprotect:
278276
## The image repository of the WAF Config Mgr
279277
repository: private-registry.nginx.com/nap/waf-config-mgr
280278
## The tag of the WAF Config Mgr image
281-
tag: 5.9.0
279+
tag: {{< version-waf-config-mgr >}}
282280
## The pull policy for the WAF Config Mgr image
283281
imagePullPolicy: IfNotPresent
284282
## The resources of the Waf Config Manager container
@@ -295,7 +293,7 @@ appprotect:
295293
## The image repository of the WAF Enforcer
296294
repository: private-registry.nginx.com/nap/waf-enforcer
297295
## The tag of the WAF Enforcer image
298-
tag: 5.9.0
296+
tag: {{< version-waf-enforcer >}}
299297
## The pull policy for the WAF Enforcer image
300298
imagePullPolicy: IfNotPresent
301299
## The environment variable for enforcer port to be set on the WAF Enforcer container
@@ -316,7 +314,7 @@ appprotect:
316314
## The image repository of the WAF IP Intelligence
317315
repository: private-registry.nginx.com/nap/waf-ip-intelligence
318316
## The tag of the WAF IP Intelligence
319-
tag: 5.9.0
317+
tag: {{< version-waf-ip-intelligence >}}
320318
## The pull policy for the WAF IP Intelligence
321319
imagePullPolicy: IfNotPresent
322320
## The resources of the WAF IP Intelligence container
@@ -336,16 +334,16 @@ appprotect:
336334
## The image repository of the WAF Policy Controller
337335
image:
338336
repository: private-registry.nginx.com/nap/waf-policy-controller
339-
## The tag of the WAF Policy COntroller
340-
tag: 5.9.0
337+
## The tag of the WAF Policy Controller
338+
tag: {{< version-waf-policy-controller >}}
341339
## The pull policy for the WAF Policy Controller
342340
imagePullPolicy: IfNotPresent
343341
wafCompiler:
344342
## The image repository of the WAF Compiler
345343
image:
346344
repository: private-registry.nginx.com/nap/waf-compiler
347345
## The tag of the WAF Compiler image
348-
tag: 5.9.0
346+
tag: {{< version-waf-compiler >}}
349347
## Save logs before deleting a job or not
350348
enableJobLogSaving: false
351349
## The resources of the WAF Policy Controller
@@ -710,13 +708,15 @@ kubectl apply -f apple-usersig.yaml -n <namespace>
710708
You can check the status of your resources using `kubectl get` or `kubectl describe`.
711709

712710
The Policy Controller will show status information including:
711+
713712
- Bundle location
714713
- Compilation status
715714
- Signature update timestamps
716715

717716
```shell
718717
kubectl get appolicy dataguard-blocking -n <namespace> -o yaml
719718
```
719+
720720
```yaml
721721
apiVersion: appprotect.f5.com/v1
722722
kind: APPolicy
@@ -744,6 +744,7 @@ status:
744744
```shell
745745
kubectl describe appolicy dataguard-blocking -n <namespace>
746746
```
747+
747748
```text
748749
Name: dataguard-blocking
749750
Namespace: localenv-plm
@@ -1323,7 +1324,6 @@ The Policy Controller will detect the file changes and recompile automatically.
13231324

13241325
Regardless of the policy type used, you can monitor the status of your policies using standard Kubernetes commands:
13251326

1326-
13271327
```shell
13281328
kubectl get appolicy -n <namespace>
13291329
kubectl describe appolicy <policy-name> -n <namespace>
@@ -1358,19 +1358,19 @@ status:
13581358

13591359
## Possible issues
13601360

1361-
**Policy Controller does not start**
1361+
_Policy Controller does not start:_
13621362

13631363
- Verify the CRDs are installed: `kubectl get crds | grep appprotect.f5.com`
13641364
- Check the pod logs: `kubectl logs <policy-controller-pod> -n <namespace>`
13651365
- Ensure proper RBAC permissions are configured
13661366

1367-
**Policies fail to compile**
1367+
_Policies fail to compile:_
13681368

13691369
- Check Policy Controller logs for compilation errors
13701370
- Verify the WAF compiler image is accessible
13711371
- Ensure the policy syntax is valid
13721372

1373-
**Issues with bundle storage**
1373+
_Issues with bundle storage:_
13741374

13751375
- Verify the persistent volume is properly mounted
13761376
- Check storage permissions (Should be 101:101)

content/waf/install/kubernetes.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@ weight: 200
77
toc: true
88
# Types have a 1:1 relationship with Hugo archetypes, so you shouldn't need to change this
99
nd-content-type: how-to
10-
# Intended for internal catalogue and search, case sensitive:
11-
# Agent, N4Azure, NIC, NIM, NGF, NAP-DOS, NAP-WAF, NGINX One, NGINX+, Solutions, Unit
12-
nd-product: NAP-WAF
10+
nd-product: WAF
1311
---
1412

1513
This page describes how to install F5 WAF for NGINX using Kubernetes.
@@ -237,6 +235,7 @@ To get the Helm chart, first configure Docker for the F5 Container Registry.
237235
{{< include "waf/install-services-registry.md" >}}
238236

239237
Then use `helm pull` to get the chart, replacing `<release-version>`:
238+
240239
```shell
241240
helm pull oci://private-registry.nginx.com/nap/nginx-app-protect --version <release-version> --untar
242241
```
@@ -305,6 +304,7 @@ This table lists the configurable parameters of the F5 WAF for NGINX Helm chart
305304
To understand the _mTLS Configuration_ options, view the [Secure traffic using mTLS]({{< ref "/waf/configure/secure-mtls.md" >}}) topic.
306305

307306
{{< table >}}
307+
308308
| **Topic** | **Parameter** | **Description** | **Default value** |
309309
|-------------|---------|-----------------|-------------------|
310310
| **Namespace** | _namespace_ | The target Kubernetes namespace where the Helm chart will be deployed. | N/A |
@@ -316,17 +316,17 @@ To understand the _mTLS Configuration_ options, view the [Secure traffic using m
316316
| | _appprotect.nginx.imagePullPolicy_ | Image pull policy. | IfNotPresent |
317317
| | _appprotect.nginx.resources_ | The resources of the NGINX container. | requests: cpu=10m,memory=16Mi |
318318
| **WAF Config Manager** | _appprotect.wafConfigMgr.image.repository_ | Docker image repository for the WAF Configuration Manager. | private-registry.nginx.com/nap/waf-config-mgr |
319-
| | _appprotect.wafConfigMgr.image.tag_ | Docker image tag for the WAF Configuration Manager. | 5.6.0 |
319+
| | _appprotect.wafConfigMgr.image.tag_ | Docker image tag for the WAF Configuration Manager. | {{< version-waf-config-mgr >}} |
320320
| | _appprotect.wafConfigMgr.imagePullPolicy_ | Image pull policy. | IfNotPresent |
321321
| | _appprotect.wafConfigMgr.resources_ | The resources of the WAF Config Manager container. | requests: cpu=10m,memory=16Mi |
322322
| **WAF Enforcer** | _appprotect.wafEnforcer.image.repository_ | Docker image repository for the WAF Enforcer. | private-registry.nginx.com/nap/waf-enforcer |
323-
| | _appprotect.wafEnforcer.image.tag_ | Docker image tag for the WAF Enforcer. | 5.6.0 |
323+
| | _appprotect.wafEnforcer.image.tag_ | Docker image tag for the WAF Enforcer. | {{< version-waf-enforcer >}} |
324324
| | _appprotect.wafEnforcer.imagePullPolicy_ | Image pull policy. | IfNotPresent |
325325
| | _appprotect.wafEnforcer.env.enforcerPort_ | Port for the WAF Enforcer. | 50000 |
326326
| | _appprotect.wafEnforcer.resources_ | The resources of the WAF Enforcer container. | requests: cpu=20m,memory=256Mi |
327327
| **WAF IP Intelligence** | _appprotect.wafIpIntelligence.enable | Enable or disable the use of the IP intelligence container | false |
328328
| | _appprotect.wafIpIntelligence.image.repository_ | Docker image repository for the WAF IP Intelligence. | private-registry.nginx.com/nap/waf-ip-intelligence |
329-
| | _appprotect.wafIpIntelligence.image.tag_ | Docker image tag for the WAF Enforcer. | 5.6.0 |
329+
| | _appprotect.wafIpIntelligence.image.tag_ | Docker image tag for the WAF Enforcer. | {{< version-waf-ip-intelligence >}} |
330330
| | _appprotect.wafIpIntelligence.imagePullPolicy_ | Image pull policy. | IfNotPresent |
331331
| | _appprotect.wafIpIntelligence.resources_ | The resources of the WAF Enforcer container. | requests: cpu=10m,memory=256Mi |
332332
| **Config** | _appprotect.config.name_ | The name of the ConfigMap used by the NGINX container. | nginx-config |
@@ -353,6 +353,7 @@ To understand the _mTLS Configuration_ options, view the [Secure traffic using m
353353
| | _appprotect.storage.pvc.bundlesPvc.storageClass_ | Storage class for PVC. | manual |
354354
| | _appprotect.storage.pvc.bundlesPvc.storageRequest_ | Storage request size. | 2Gi |
355355
| **Docker Configuration** | _dockerConfigJson_ | A base64-encoded string representing the Docker registry credentials in JSON format. | N/A |
356+
356357
{{< /table >}}
357358

358359
## Use Manifests to install F5 WAF for NGINX
@@ -538,7 +539,6 @@ spec:
538539

539540
{{< /tabs >}}
540541

541-
542542
### Start the Manifest deployment
543543

544544
From the folder containing the YAML files from the previous step (Suggested as `/manifests`), deploy F5 WAF for NGINX using `kubectl`:

content/waf/policies/ip-intelligence.md

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@ weight: 1600
77
toc: true
88
# Types have a 1:1 relationship with Hugo archetypes, so you shouldn't need to change this
99
nd-content-type: reference
10-
# Intended for internal catalogue and search, case sensitive:
11-
# Agent, N4Azure, NIC, NIM, NGF, NAP-DOS, NAP-WAF, NGINX One, NGINX+, Solutions, Unit
12-
nd-product: NAP-WAF
10+
nd-product: WAF
1311
---
1412

1513
F5 WAF for NGINX has an IP intelligence feature which allows you to customize enforcement based on the source IP address of a request. This allows you to limit access from specific IP addresses.
@@ -106,7 +104,7 @@ Modify the _original docker-compose.yml_ file to include the IP intelligence con
106104
services:
107105
waf-enforcer:
108106
container_name: waf-enforcer
109-
image: waf-enforcer:5.7.0
107+
image: waf-enforcer:{{< version-waf-enforcer >}}
110108
environment:
111109
- ENFORCER_PORT=50000
112110
ports:
@@ -122,7 +120,7 @@ services:
122120
123121
waf-config-mgr:
124122
container_name: waf-config-mgr
125-
image: waf-config-mgr:5.7.0
123+
image: waf-config-mgr:{{< version-waf-config-mgr >}}
126124
volumes:
127125
- /opt/app_protect/bd_config:/opt/app_protect/bd_config
128126
- /opt/app_protect/config:/opt/app_protect/config
@@ -135,7 +133,7 @@ services:
135133
136134
waf-ip-intelligence:
137135
container_name: waf-ip-intelligence
138-
image: waf-ip-intelligence:5.7.0
136+
image: waf-ip-intelligence:{{< version-waf-ip-intelligence >}}
139137
volumes:
140138
- /var/IpRep:/var/IpRep
141139
networks:
@@ -238,7 +236,6 @@ spec:
238236
claimName: nap5-bundles-pvc
239237
```
240238
241-
242239
Once complete, you can now [Configure policies for IP intelligence](#configure-policies-for-ip-intelligence).
243240
244241
## Configure policies for IP intelligence
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
5.9.0
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
5.9.0
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
5.7.0

0 commit comments

Comments
 (0)