Skip to content

Commit 8471c7e

Browse files
committed
feat: Finish editing remaining documents
1 parent 7310b8c commit 8471c7e

File tree

3 files changed

+70
-99
lines changed

3 files changed

+70
-99
lines changed

content/waf/changelog/_index.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
title: "Changelog"
44
url: /waf/changelog/
55
# Weights are assigned in increments of 100: determines sorting order
6-
weight: 500
6+
weight: 600
77
# Creates a table of contents and sidebar, useful for large documents
88
nd-landing-page: true
99
# Types have a 1:1 relationship with Hugo archetypes, so you shouldn't need to change this
@@ -27,9 +27,9 @@ _September 29th, 2025_
2727

2828
### Important notes
2929

30-
- Renamed NGINX App Protect WAF to F5 for NGINX
30+
- Renamed NGINX App Protect WAF to F5 WAF for NGINX
3131
- Aligned F5 WAF for NGINX versions
32-
- Package and container artefacts now share the same version numbers
32+
- Package and container artifacts now share the same version numbers
3333
- Upgrade processes remain the same as earlier releases
3434
- No breaking changes
3535
- Restructured documentation

content/waf/logging/custom-dimensions.md

Lines changed: 22 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,25 @@ nd-content-type: reference
66
nd-product: NAP-WAF
77
---
88

9-
Custom dimensions log entries feature refers to the new configuration in F5 WAF for NGINX, where the new directive called `app_protect_custom_log_attribute` is assigned to a particular location or server or http level in the `nginx.conf` file. The need is to be able to add custom identifiers to the respective location and/or server and identify requests in the Security Log by those identifiers.
9+
F5 WAF for NGINX can configure custom dimensions for log entries using the directive `app_protect_custom_log_attribute`.
1010

11-
The `app_protect_custom_log_attribute` directive will be used to track the assigned location/server/http dimension of each request by adding the `app_protect_custom_log_attribute` to the **Security Logs** a.k.a **Request Logs**. Since it is a custom attribute a customer can set, that custom attribute will appear for every request log entry that was handled by that location/server.
11+
This directive can be added to the NGINX configuration file in the `http`, `server` and `location` scopes. The custom dimensions become part of every request in the [Security logs]({{< ref "/waf/logging/security-logs.md" >}}) based on the scope used.
1212

13-
### Configuration
13+
The `app_protect_custom_log_attribute` directive takes a key/value pair, such as `app_protect_custom_log_attribute 'customDimension' '1'`. The directive can cascade and override entries based on scope order: _location_, _server_ then. _http_.
1414

15-
A new directive `app_protect_custom_log_attribute` will be added to the `nginx.conf` file. You can set this directive at all scopes: http, server and location. The setting at the location scope overrides the setting in the server and/or http scopes and the server scope overrides the http scope. The `app_protect_custom_log_attribute` directive syntax will consist of a **name/value** or **key/value** pair i.e. "app_protect_custom_log_attribute <name> <value>".
15+
For example, attributes at the _http_ level applies to all servers and locations unless a specific server or location overrides the same key with a different value.
1616

17-
Example Configuration:
17+
When a custom dimension is assigned to a scope, it will appear in the `json_log` field as a new JSON property called "customLogAttributes" at the top level. This properly only appears if the `app_protect_custom_log_attribute` directive is used.
1818

19-
In the below example, we are configuring the `app_protect_custom_log_attribute` directive at the server and location level where we define the **key/value** pair as one string.
19+
In the configuration example, the "environment" attribute will appear in logs of all locations under that server block.
2020

21-
```nginx
21+
```json
22+
""customLogAttribute"":[{""name"":""component"",""value"":""comp1""},{""name"":""gateway"",""value"":""gway1""}]}"
23+
```
2224

25+
The following example defines the `app_protect_custom_log_attribute` directive at the server and location level, with key/value pairs as strings.
26+
27+
```nginx
2328
user nginx;
2429
load_module modules/ngx_http_app_protect_module.so;
2530
error_log /var/log/nginx/error.log debug;
@@ -45,13 +50,13 @@ server {
4550
}
4651
```
4752

48-
The **key/value** pair will be 'environment env1', ‘gateway gway1’ and ‘component comp1’ in the above examples, i.e.
53+
The key/value pairs are 'environment env1', ‘gateway gway1’ and ‘component comp1’ in the above examples:
4954

5055
- app_protect_custom_log_attribute environment env1;
5156
- app_protect_custom_log_attribute gateway gway1;
5257
- app_protect_custom_log_attribute component comp1;
5358

54-
The above key/value pair will be parsed as below:
59+
The key/value pairs are parsed as follows:
5560

5661
```shell
5762
"customLogAttributes": [
@@ -66,35 +71,21 @@ The above key/value pair will be parsed as below:
6671
]
6772
```
6873

69-
### Things to Remember While Configuring the Custom Dimensions Log Entries
70-
71-
The `app_protect_custom_log_attribute` directive has a few limitations which should be kept in mind while configuring this directive:
74+
The `app_protect_custom_log_attribute` directive has constraints you should keep in mind:
7275

7376
- Key and value strings are limited to 64 chars
74-
- Maximum possible directive numbers are limited to 10 (in total) in each context i.e. Limit of 10 keys and values
77+
- There are a maximum of 10 key/value pairs in each scope
7578

76-
### Errors and Warnings
79+
An error message beginning with "_'app_protect_custom_log_attribute' directive is invalid_" will be displayed in the security log if:
7780

78-
An error message "`app_protect_custom_log_attribute` directive is invalid" will be displayed in the Security Log if the below conditions are met:
81+
1. The `app_protect_custom_log_attribute` exceeds the maximum number of 10 directives
82+
1. The `app_protect_custom_log_attribute` exceeds the maximum name length of 64 chars
83+
1. The `app_protect_custom_log_attribute` exceeds the maximum value of 64 chars
7984

80-
1. If the `app_protect_custom_log_attribute` exceeds the maximum number of 10 directives
81-
2. If the `app_protect_custom_log_attribute` exceeds the maximum name length of 64 chars
82-
3. If the `app_protect_custom_log_attribute` exceeds the maximum value of 64 chars
85+
The log will specify the precise issue:
8386

84-
Error message example:
85-
86-
```shell
87+
```text
8788
app_protect_custom_log_attribute directive is invalid. Number of app_protect_custom_log_attribute directives exceeds maximum
8889
```
8990

90-
### Logging and Reporting
91-
92-
When `app_protect_custom_log_attribute` is assigned to a particular location/server/http context, it will appear in the `json_log` field as a new JSON property called "customLogAttributes" at the top level. The property will not appear if no `app_protect_custom_log_attribute` directive was assigned.
93-
94-
Attributes at the http level applies to all servers and locations unless a specific server or location overrides the same key with a different value. Same goes for the server level and all locations under it. In the below example, the "environment" attribute will appear in logs of all locations under that server.
9591

96-
Security logging example in json_log:
97-
98-
```json
99-
""customLogAttribute"":[{""name"":""component"",""value"":""comp1""},{""name"":""gateway"",""value"":""gway1""}]}"
100-
```

content/waf/policies/external-references.md

Lines changed: 45 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ For example, a `modifications` section could be replaced by `modificationsRefere
3434

3535
There are different implementations based on the type of references that are being made.
3636

37-
### External URL reference
37+
### URL references
3838

3939
URL reference is the method of referencing an external source by providing its full URL.
4040

@@ -43,6 +43,7 @@ This is a useful method when trying to combine or consolidate parts of the polic
4343
{{< call-out "note" >}}
4444

4545
You need to make sure that the server where the resource files are located is always available when you are compiling your policy.
46+
4647
{{< /call-out >}}
4748

4849
This example creates a skeleton policy, enabling the file type violation.
@@ -105,18 +106,18 @@ The referenced `file-types.txt` file contains the following code:
105106
]
106107
```
107108

108-
### HTTPS references
109+
#### HTTPS references
109110

110111
HTTPS references are a special case of URL references. It uses the HTTPS protocol instead of the HTTP protocol. Make sure that the webserver you are downloading the resources from does also support HTTPS protocol and has certificates setup properly.
111112

112113
- Certificates must be valid in date (not expired) during the policy compilation.
113114
- Certificates must be signed by a trusted CA.
114-
- For Self-signed certificates, you need to make sure to add your certificates to the trusted CA of the machine where App Protect is installed.
115+
- For Self-signed certificates, you need to make sure to add your certificates to the trusted CA of the machine where F5 WAF for NGINX is installed.
115116
- Certificates must use the exact domain name that the certificate was issued for. For example, SSL will differentiate between domain.com and www.domain.com, considering each a different domain name.
116117

117-
In this configuration, we are completely satisfied with the basic default policy, and we wish to use it as is. However, we wish to define a custom response page using an external file located on an HTTPS web server. The external reference file contains our custom response page configuration.
118+
The following configuration builds on the default policy by defining a custom response page using an external file located on an HTTPS web server.
118119

119-
**Policy configuration:**
120+
The external reference file contains the custom response page configuration.
120121

121122
```json
122123
{
@@ -145,9 +146,7 @@ Content of the referenced file `response-pages.txt`:
145146
]
146147
```
147148

148-
In this example, we would like to enable all attack signatures. Yet, we want to exclude specific signatures from being enforced.
149-
150-
**Policy configuration:**
149+
The next example enables all attack signatures while excluding specific signatures from being enforced:
151150

152151
```json
153152
{
@@ -193,22 +192,25 @@ Content of the referenced file `modifications.txt`:
193192

194193
### File references
195194

196-
File references refers to accessing local resources on the same machine, as opposed to accessing a remote resource on another server/machine. The user can specify any location that is accessible by App Protect except for the root folder ("/"). If no full path is provided, the default path `/etc/app_protect/conf` will be assumed. Note that file references can only be on the local machine: you cannot use remote hosts!
195+
File references access local resources on the same machine, as opposed to accessing a remote resource on another server/machine.
197196

198-
Here are some examples of the typical cases:
197+
File references do not work with remote hosts.
199198

200-
| Examples | File path | Notes |
201-
| -------- | --------- | ----- |
202-
|<file:///foo.json> | /etc/app_protect/conf/foo.json | Default directory assumed |
203-
|<file://foo.json> | /etc/app_protect/conf/foo.json | Formally illegal, but tolerated as long as there is no trailing slash. |
204-
|<file:///etc/app_protect/conf/foo.json> | /etc/app_protect/conf/foo.json | Full path, but still the default one |
205-
|<file:///bar/foo.json> | /bar/foo.json | Non-default path |
206-
|<file://etc/app_protect/conf/foo.json> | **Not accepted** | "etc" is interpreted as remote host name |
199+
You can specify any location that is accessible by F5 WAF for NGINX except for the root folder ("/").
207200

201+
If a full path is not provided, the default path (_/etc/app_protect/conf_) will be used for resolution.
208202

209-
In this example, we would like to enable all attack signatures. Yet, we want to exclude specific signatures from being enforced. To do this, we reference a local file on the machine.
203+
Here are some examples of typical cases:
204+
205+
| Examples | File path | Notes |
206+
| -------- | --------- | ----- |
207+
| _file:///foo.json_ | /etc/app_protect/conf/foo.json | Default directory assumed |
208+
| _file://foo.json_ | /etc/app_protect/conf/foo.json | Formally illegal, but tolerated as long as there is no trailing slash. |
209+
| _file:///etc/app_protect/conf/foo.json_ | /etc/app_protect/conf/foo.json | Full path, using default directory |
210+
| _file:///bar/foo.json_ | /bar/foo.json | Non-default path |
211+
| _file://etc/app_protect/conf/foo.json_ | **Not accepted** | "etc" is interpreted as remote host name |
210212

211-
**Policy Configuration:**
213+
The next example enable all attack signatures, excluding specific signatures from enforcement using a reference to a local file on the machine.
212214

213215
```json
214216
{
@@ -233,7 +235,7 @@ In this example, we would like to enable all attack signatures. Yet, we want to
233235
}
234236
```
235237

236-
Content of the referenced file `modifications.txt`:
238+
Content of the referenced `modifications.txt` file:
237239

238240
```json
239241
{
@@ -252,48 +254,40 @@ Content of the referenced file `modifications.txt`:
252254
}
253255
```
254256

255-
If, for any reason, the configuration was done incorrectly, the policy compilation process will fail with the following error:
257+
If the configuration is incorrect the policy compilation process will fail with the following error:
258+
256259
```shell
257260
APP_PROTECT { "event": "configuration_load_failure" ...
258261
```
259262
260-
The error details that follow will depend on the exact situation causing the policy compilation to fail. If the policy compilation process fails, the compiler will revert to the last working policy and all the changes for the last policy compilation attempt will be lost.
263+
The error will vary based on the conditions of the failure. If the policy compilation process fails, the compiler will revert to the last working policy and the changes for the last policy compilation attempt will be discarded.
264+
265+
## OpenAPI references
261266
262-
## OpenAPI specification file reference
267+
F5 WAF for NGINX can reference an OpenAPI specification file used to describe restful APIs, using it for API protection.
263268
264-
The OpenAPI Specification defines the spec file format needed to describe RESTful APIs. The spec file can be written either in JSON or YAML. Using a spec file simplifies the work of implementing API protection. Refer to the OpenAPI Specification (formerly called Swagger) for details.
269+
The specification file can be written in JSON or YAML format: the details can be used to create a protection policy.
270+
271+
Based on the content of the OpenAPI specification file, F5 WAF for NGINX will automatically create a policy for the following properties:
265272
266-
The simplest way to create an API protection policy is using an OpenAPI Specification file to import the details of the APIs. If you use an OpenAPI Specification file, F5 WAF for NGINX will automatically create a policy for the following properties (depending on what's included in the spec file):
267273
* Methods
268274
* URLs
269275
* Parameters
270276
* JSON profiles
271277
272-
An OpenAPI-ready policy template is provided with the F5 WAF for NGINX packages and is located in: `/etc/app_protect/conf/NginxApiSecurityPolicy.json`
273-
274-
It contains violations related to OpenAPI set to blocking (enforced).
275-
276-
{{< call-out "note" >}} F5 WAF for NGINX supports only one OpenAPI Specification file reference per policy.{{< /call-out >}}
278+
A policy template is provided with F5 WAF for NGINX packages containing violations related to OpenAPI configured to block (enforced) and is located in on the path _/etc/app_protect/conf/NginxApiSecurityPolicy.json_.
277279
278-
### Types of OpenAPI References
279-
280-
There are different ways of referencing OpenAPI Specification files. The configuration is similar to [External References](#external-references).
280+
F5 WAF for NGINX supports only one OpenAPI specification file reference per policy.
281281
282282
{{< call-out "note" >}} Any update of an OpenAPI Specification file referenced in the policy will not trigger a policy compilation. This action needs to be done actively by reloading the NGINX configuration. {{< /call-out >}}
283283
284-
#### URL Reference
285-
286-
URL reference is the method of referencing an external source by providing its full URL.
287-
288-
Make sure to configure certificates prior to using the HTTPS protocol - see the [HTTPS References](#https-reference) under the External References section for more details.
289-
290-
{{< call-out "note" >}} You need to make sure that the server where the resource files are located is always available when you are compiling your policy. {{< /call-out >}}
284+
Configuring and referencing OpenAPI specification files are similar to other external references.
291285
292-
##### Example Configuration
286+
### URL references
293287
294-
In this example, we are adding an OpenAPI Specification file reference using the link `http://127.0.0.1:8088/myapi.yaml`. This will configure allowed data types for `query_int` and `query_str` parameters values.
288+
This example adds an OpenAPI specification file reference using the link `http://127.0.0.1:8088/myapi.yaml`.
295289
296-
**Policy configuration:**
290+
The referenced file configures the allowed data types for `query_int` and `query_str` parameters values.
297291
298292
```json
299293
{
@@ -443,23 +437,15 @@ paths:
443437
description: NotFound
444438
```
445439
446-
In this case the following request will trigger an `Illegal parameter data type` violation, as we expect to have an integer value in the `query_int` parameter:
440+
The following request will trigger an `Illegal parameter data type` violation, F5 WAF for NGINX expect to have an integer value in the `query_int` parameter:
447441
448-
```
442+
```text
449443
http://localhost/query?query_int=abc
450444
```
451445
452-
The request will be blocked.
453-
454-
The link option is also available in the `openApiFileReference` property and synonymous with the one above in `open-api-files`
455-
456-
**Note**: `openApiFileReference` is not an array.
446+
The link option is also available with the `openApiFileReference` property and synonymous with the one in `open-api-files`. `openApiFileReference` is not an array.
457447
458-
##### Example Configuration
459-
460-
In this example, we reference the same OpenAPI Specification file as in the policy above using the `openApiFileReference` property.
461-
462-
**Policy configuration:**
448+
This next example references the same OpenAPI specification file as the previous one, using the `openApiFileReference` property.
463449
464450
```json
465451
{
@@ -483,15 +469,9 @@ Content of the file `ref.txt`:
483469
]
484470
```
485471
486-
#### File Reference
487-
488-
File reference refers to accessing local resources on the same machine. See the [File References](#file-reference) under the External References section for more details.
489-
490-
##### Example Configuration
491-
492-
In this example, we would like to add an OpenAPI Specification file reference to the default policy.
472+
### File references
493473
494-
**Policy Configuration:**
474+
This example adds an OpenAPI specification file reference to the default policy.
495475
496476
```json
497477
{
@@ -554,10 +534,10 @@ Content of the referenced file `myapi2.json`:
554534
}
555535
```
556536
557-
In this case the following request will trigger an `Illegal repeated parameter name` violation, as the OpenAPI Specification doesn't allow repeated parameters.
537+
The following request will trigger an `Illegal repeated parameter name` violation, as the OpenAPI specification doesn't allow repeated parameters.
558538
559539
```
560540
http://localhost/query?a=true&a=false
561541
```
562542
563-
The request will not be blocked because this violation is set to alarm in the default policy.
543+
The request will _not be blocked_ because this violation is set to alarm in the default policy.

0 commit comments

Comments
 (0)