generated from nginx/template-repository
-
Notifications
You must be signed in to change notification settings - Fork 117
feat: Add additional F5 WAF for NGINX pages #1249
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+1,721
−11
Merged
Changes from 10 commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
6dea17b
feat: Add additional F5 WAF for NGINX pages
ADubhlaoich 19f7536
feat: Add source content to be re-written
ADubhlaoich 5e72907
Merge branch 'main' into waf/port-more-features
ADubhlaoich f64a43f
feat: Push work
ADubhlaoich 29d600f
feat: Add parameter reference notice
ADubhlaoich dd04cd8
Merge branch 'main' into waf/port-more-features
ADubhlaoich 03d3dad
feat: External references work
ADubhlaoich 6288c64
Merge branch 'waf/port-more-features' of github.com:nginx/documentati…
ADubhlaoich 7310b8c
Merge branch 'main' into waf/port-more-features
ADubhlaoich 8471c7e
feat: Finish editing remaining documents
ADubhlaoich d542de7
Apply suggestions from code review
ADubhlaoich f3fa51f
Apply suggestions from code review
ADubhlaoich 69fa6d9
Update content/waf/policies/external-references.md
ADubhlaoich 64e2812
Update content/waf/policies/external-references.md
ADubhlaoich acd4650
Update content/waf/policies/external-references.md
ADubhlaoich 31cdd1b
Update content/waf/policies/external-references.md
ADubhlaoich ec5225e
Update content/waf/policies/external-references.md
ADubhlaoich 7334eb0
Update content/waf/policies/external-references.md
ADubhlaoich 0ec236f
Update content/waf/policies/external-references.md
ADubhlaoich e03fbe6
Update content/waf/policies/external-references.md
ADubhlaoich 5fecf21
Update content/waf/policies/external-references.md
ADubhlaoich File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{{< banner "note" "Policy parameter reference" >}} | ||
|
||
You can explore the parameters for each F5 WAF for NGINX feature on the [Policy parameter reference]({{< ref "/waf/policies/parameter-reference.md" >}}) page. | ||
|
||
This page was previously referred to as the "Declarative Policy". | ||
|
||
{{< /banner >}} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
--- | ||
title: Custom dimensions for log entries | ||
toc: false | ||
weight: 200 | ||
nd-content-type: reference | ||
nd-product: NAP-WAF | ||
--- | ||
|
||
F5 WAF for NGINX can configure custom dimensions for log entries using the directive `app_protect_custom_log_attribute`. | ||
|
||
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. | ||
|
||
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_. | ||
ADubhlaoich marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
||
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. | ||
ADubhlaoich marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
||
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. | ||
ADubhlaoich marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
ADubhlaoich marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
||
In the configuration example, the "environment" attribute will appear in logs of all locations under that server block. | ||
ADubhlaoich marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
||
```json | ||
""customLogAttribute"":[{""name"":""component"",""value"":""comp1""},{""name"":""gateway"",""value"":""gway1""}]}" | ||
ADubhlaoich marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
``` | ||
|
||
The following example defines the `app_protect_custom_log_attribute` directive at the server and location level, with key/value pairs as strings. | ||
|
||
```nginx | ||
user nginx; | ||
load_module modules/ngx_http_app_protect_module.so; | ||
error_log /var/log/nginx/error.log debug; | ||
events { | ||
worker_connections 65536; | ||
} | ||
server { | ||
listen 80; | ||
server_name localhost; | ||
proxy_http_version 1.1; | ||
app_protect_custom_log_attribute ‘environment' 'env1'; | ||
ADubhlaoich marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
location / { | ||
app_protect_enable on; | ||
app_protect_custom_log_attribute gateway gway1; | ||
app_protect_custom_log_attribute component comp1; | ||
proxy_pass http://172.29.38.211:80$request_uri; | ||
} | ||
} | ||
``` | ||
|
||
The key/value pairs are 'environment env1', ‘gateway gway1’ and ‘component comp1’ in the above examples: | ||
ADubhlaoich marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
||
- app_protect_custom_log_attribute environment env1; | ||
- app_protect_custom_log_attribute gateway gway1; | ||
- app_protect_custom_log_attribute component comp1; | ||
|
||
The key/value pairs are parsed as follows: | ||
|
||
```shell | ||
"customLogAttributes": [ | ||
{ | ||
"name": "gateway", | ||
"value": "gway1" | ||
}, | ||
{ | ||
"name": "component", | ||
"value": "comp1" | ||
}, | ||
] | ||
``` | ||
|
||
The `app_protect_custom_log_attribute` directive has constraints you should keep in mind: | ||
|
||
- Key and value strings are limited to 64 chars | ||
- There are a maximum of 10 key/value pairs in each scope | ||
|
||
An error message beginning with "_'app_protect_custom_log_attribute' directive is invalid_" will be displayed in the security log if: | ||
|
||
1. The `app_protect_custom_log_attribute` exceeds the maximum number of 10 directives | ||
1. The `app_protect_custom_log_attribute` exceeds the maximum name length of 64 chars | ||
1. The `app_protect_custom_log_attribute` exceeds the maximum value of 64 chars | ||
|
||
The log will specify the precise issue: | ||
|
||
```text | ||
app_protect_custom_log_attribute directive is invalid. Number of app_protect_custom_log_attribute directives exceeds maximum | ||
``` | ||
|
||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
--- | ||
title: Debug logs | ||
toc: false | ||
weight: 400 | ||
weight: 500 | ||
nd-content-type: reference | ||
nd-product: NAP-WAF | ||
--- | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
--- | ||
title: Operation logs | ||
toc: false | ||
weight: 300 | ||
weight: 400 | ||
nd-content-type: reference | ||
nd-product: NAP-WAF | ||
--- | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
--- | ||
title: Security logs | ||
toc: true | ||
weight: 200 | ||
weight: 300 | ||
nd-content-type: reference | ||
nd-product: NAP-WAF | ||
--- | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,11 @@ | ||
--- | ||
title: "Policies" | ||
url: /waf/policies/ | ||
cascade: | ||
nd-banner: | ||
enabled: true | ||
type: deprecation | ||
start-date: 2025-09-30 | ||
md: /_banners/waf-parameter-reference.md | ||
weight: 400 | ||
--- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.