Skip to content

Commit 6dea17b

Browse files
committed
feat: Add additional F5 WAF for NGINX pages
This commit adds a handful of pages to F5 WAF for NGINX, migrating and rewriting content from the prior documentation set. It includes: - Custom dimensions for log entries - User-defined URLs and parameters - Do-nothing - Override rules
1 parent 2358d56 commit 6dea17b

File tree

10 files changed

+1015
-5
lines changed

10 files changed

+1015
-5
lines changed

content/includes/waf/table-policy-features.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
| [Cookie enforcement]({{< ref "/waf/policies/cookie-enforcement.md" >}}) | By default all cookies are allowed and not enforced for integrity. The user can add specific cookies, wildcards or explicit, that will be enforced for integrity. It is also possible to set the cookie attributes: HttpOnly, Secure and SameSite for cookies found in the response. |
1212
| [Data guard]({{< ref "/waf/policies/data-guard.md" >}}) | Detects and masks Credit Card Number (CCN) and/or U.S. Social Security Number (SSN) and/or custom patterns in HTTP responses. Disabled by default. |
1313
| [Deny and Allow IP lists]({{< ref "/waf/policies/deny-allow-ip.md" >}}) | Manually define denied & allowed IP addresses as well as IP addresses to never log. |
14+
| [Do-nothing]({{< ref "/waf/policies/do-nothing.md" >}}) | Do-nothing allows you to configure the avoidance of inspecting or parsing content of a URL. |
1415
| [Disallowed file type extensions]({{< ref "/waf/policies/disallowed-extensions.md" >}}) | Support any file type, and includes a predefined list of file types by default |
1516
| [Evasion techniques]({{< ref "/waf/policies/evasion-techniques.md" >}}) | All evasion techniques are enabled by default, and can be disabled individually. These include directory traversal, bad escaped characters and more. |
1617
| [Geolocation]({{< ref "/waf/policies/geolocation.md" >}}) | The geolocation feature allows you to configure enforcement based on the location of an object using the two-letter ISO code representing a country. |
@@ -20,10 +21,13 @@
2021
| [IP address lists]({{< ref "/waf/policies/ip-address-lists.md" >}}) | Organize lists of allowed and forbidden IP addresses across several lists with common attributes. |
2122
| [IP intelligence]({{< ref "/waf/policies/ip-intelligence.md" >}}) | Configure the IP Intelligence feature to customize enforcement based on the source IP of the request, limiting access from IP addresses with questionable reputation. |
2223
| [JWT protection]({{< ref "/waf/policies/jwt-protection.md" >}}) | JWT protection allows you to configure policies based on properties of JSON web tokens, such as their header and signature properties. |
24+
| [Override rules]({{< ref "/waf/policies/override-rules.md" >}}) | Override rules allow you to override default policy settings under specific conditions. |
2325
| [Server technology signatures]({{< ref "/waf/policies/server-technology-signatures.md" >}}) | Support adding signatures per added server technology. |
2426
| [Time-based signature staging]({{< ref "/waf/policies/time-based-signature-staging.md" >}}) | Time-based signature staging allows you to stage signatures for a specific period of time. During the staging period, violations of staged signatures are logged but not enforced. After the staging period ends, violations of staged signatures are enforced according to the policy's enforcement mode. |
2527
| [Threat campaigns]({{< ref "/waf/policies/threat-campaigns.md" >}}) | These are patterns that detect all the known attack campaigns. They are very accurate and have almost no false positives, but are very specific and do not detect malicious traffic that is not part of those campaigns. The default policy enables threat campaigns but it is possible to disable it through the respective violation. |
2628
| [User-defined HTTP headers]({{< ref "/waf/policies/user-headers.md" >}}) | Handling headers as a special part of requests |
29+
| [User-defined URLs and parameters]({{< ref "/waf/policies/user-urls-parameters.md" >}}) | Use user-defined properties when configuring violations. |
2730
| [XFF trusted headers]({{< ref "/waf/policies/xff-headers.md" >}}) | Disabled by default, and can accept an optional list of custom XFF headers. |
2831
| [XML and JSON content]({{< ref "/waf/policies/xml-json-content.md" >}}) | XML content and JSON content profiles detect malformed content and signatures in the element values. Default policy checks maximum structure depth. It is possible to enable more size restrictions: maximum total length of XML/JSON data, maximum number of elements and more. |
32+
2933
{{< /table >}}
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
---
2+
title: Custom dimensions for log entries
3+
toc: false
4+
weight: 200
5+
nd-content-type: reference
6+
nd-product: NAP-WAF
7+
---
8+
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.
10+
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.
12+
13+
### Configuration
14+
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>".
16+
17+
Example Configuration:
18+
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.
20+
21+
```nginx
22+
23+
user nginx;
24+
load_module modules/ngx_http_app_protect_module.so;
25+
error_log /var/log/nginx/error.log debug;
26+
27+
events {
28+
worker_connections 65536;
29+
}
30+
server {
31+
32+
listen 80;
33+
34+
server_name localhost;
35+
proxy_http_version 1.1;
36+
app_protect_custom_log_attribute ‘environment' 'env1';
37+
38+
location / {
39+
40+
app_protect_enable on;
41+
app_protect_custom_log_attribute gateway gway1;
42+
app_protect_custom_log_attribute component comp1;
43+
proxy_pass http://172.29.38.211:80$request_uri;
44+
}
45+
}
46+
```
47+
48+
The **key/value** pair will be 'environment env1', ‘gateway gway1’ and ‘component comp1’ in the above examples, i.e.
49+
50+
- app_protect_custom_log_attribute environment env1;
51+
- app_protect_custom_log_attribute gateway gway1;
52+
- app_protect_custom_log_attribute component comp1;
53+
54+
The above key/value pair will be parsed as below:
55+
56+
```shell
57+
"customLogAttributes": [
58+
{
59+
"name": "gateway",
60+
"value": "gway1"
61+
},
62+
{
63+
"name": "component",
64+
"value": "comp1"
65+
},
66+
]
67+
```
68+
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:
72+
73+
- 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
75+
76+
### Errors and Warnings
77+
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:
79+
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
83+
84+
Error message example:
85+
86+
```shell
87+
app_protect_custom_log_attribute directive is invalid. Number of app_protect_custom_log_attribute directives exceeds maximum
88+
```
89+
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.
95+
96+
Security logging example in json_log:
97+
98+
```json
99+
""customLogAttribute"":[{""name"":""component"",""value"":""comp1""},{""name"":""gateway"",""value"":""gway1""}]}"
100+
```

content/waf/logging/debug-logs.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Debug logs
33
toc: false
4-
weight: 400
4+
weight: 500
55
nd-content-type: reference
66
nd-product: NAP-WAF
77
---

content/waf/logging/operation-logs.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Operation logs
33
toc: false
4-
weight: 300
4+
weight: 400
55
nd-content-type: reference
66
nd-product: NAP-WAF
77
---

content/waf/logging/security-logs.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Security logs
33
toc: true
4-
weight: 200
4+
weight: 300
55
nd-content-type: reference
66
nd-product: NAP-WAF
77
---

content/waf/policies/attack-signatures.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ To exclude multiple attack signatures, each signature ID needs to be added as a
203203

204204
In the previous examples, the signatures were disabled for all the requests that are inspected by the respective policy. You can also exclude signatures for specific URLs or parameters, while still enable them for the other URLs and parameters.
205205

206-
The topics [User-defined URLs]() and [User-defined parameters]() have more details.
206+
The topic [User-defined URLs and parameters]({{< ref "/waf/policies/user-urls-parameters.md" >}}) has more details.
207207

208208
In some cases, you may want to remove a whole signature set that was included in the default policy. For example, a protected application may not use XML and is not vulnerable to XPath injection.
209209

content/waf/policies/do-nothing.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
---
2+
# We use sentence case and present imperative tone
3+
title: "Do-nothing"
4+
# Weights are assigned in increments of 100: determines sorting order
5+
weight: 1050
6+
# Creates a table of contents and sidebar, useful for large documents
7+
toc: true
8+
# Types have a 1:1 relationship with Hugo archetypes, so you shouldn't need to change this
9+
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
13+
---
14+
15+
This topic describes the do-nothing policy feature of F5 WAF for NGINX.
16+
17+
Within _urlContentProfiles_, adding the _do-nothing_ type allows the user to avoid inspecting or parsing the content in a policy, and instead handle the request's header according to the specifications outlined in the security policy.
18+
19+
The following example configures do-nothing for a specific user-defined URL:
20+
21+
```json
22+
{
23+
"policy" : {
24+
"name": "ignore_body",
25+
"template": { "name": "POLICY_TEMPLATE_NGINX_BASE" },
26+
"urls": [
27+
{
28+
"method": "*",
29+
"name": "*",
30+
"type": "wildcard",
31+
"urlContentProfiles": [
32+
{
33+
"headerName": "*",
34+
"headerOrder": "default",
35+
"headerValue": "*",
36+
"type": "do-nothing"
37+
}
38+
]
39+
}
40+
]
41+
}
42+
}
43+
```

content/waf/policies/jwt-protection.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: JWT protection
3-
weight: 1650
3+
weight: 1700
44
toc: true
55
nd-content-type: reference
66
nd-product: NAP-WAF

0 commit comments

Comments
 (0)