Skip to content

Commit 507b748

Browse files
ADubhlaoichy82
andauthored
feat: Add Response and Filetype pages, other fixes (#1329)
This commit adds the Response and Filetype feature pages to F5 WAF for NGINX, and also updates other documentation to address feedback regarding configuration or set-up problems. --------- Co-authored-by: yar <y82@users.noreply.github.com>
1 parent 42d887c commit 507b748

File tree

10 files changed

+163
-13
lines changed

10 files changed

+163
-13
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
| [Do-nothing]({{< ref "/waf/policies/do-nothing.md" >}}) | Do-nothing allows you to avoid inspecting or parsing a URL. |
1616
| [Disallowed file type extensions]({{< ref "/waf/policies/disallowed-extensions.md" >}}) | Support any file type, and includes a predefined list of file types by default |
1717
| [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. |
18+
| [Filetypes]({{< ref "/waf/policies/filetypes.md" >}}) | The filetype feature allows you to selectively allow filetypes. |
1819
| [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. |
1920
| [GraphQL protection]({{< ref "/waf/policies/graphql-protection.md" >}}) | GraphQL protection allows you to configure enforcement for GraphQL, an API query language. |
2021
| [gRPC protection]({{< ref "/waf/policies/evasion-techniques.md" >}}) | gRPC protection detects malformed content, parses well-formed content, and extracts the text fields for detecting attack signatures and disallowed meta-characters. In addition, it enforces size restrictions and prohibition of unknown fields. The Interface Definition Language (IDL) files for the gRPC API must be attached to the profile. gRPC protection is available for unary or bidirectional traffic. |
@@ -23,6 +24,7 @@
2324
| [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. |
2425
| [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. |
2526
| [Override rules]({{< ref "/waf/policies/override-rules.md" >}}) | Override rules allow you to override default policy settings under specific conditions. |
27+
| [Response signatures]({{< ref "/waf/policies/response-signatures.md" >}}) | Response signatures allow you to inspect HTTP responses, selectively allowing specific response codes or lengths. |
2628
| [Server technology signatures]({{< ref "/waf/policies/server-technology-signatures.md" >}}) | Support adding signatures per added server technology. |
2729
| [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. |
2830
| [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. |

content/waf/configure/secure-mtls.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,6 @@ http {
133133
server {
134134
listen 80;
135135
server_name localhost;
136-
proxy_http_version 1.1;
137136
138137
app_protect_enable on;
139138
app_protect_policy_file app_protect_default_policy;

content/waf/install/docker.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,6 @@ http {
9292
server {
9393
listen 80;
9494
server_name app.example.com;
95-
proxy_http_version 1.1;
9695
9796
app_protect_enable on;
9897
app_protect_security_log_enable on;
@@ -372,8 +371,6 @@ server {
372371
listen 80;
373372
server_name domain.com;
374373
375-
proxy_http_version 1.1;
376-
377374
location / {
378375
379376
# F5 WAF for NGINX
@@ -783,7 +780,6 @@ http {
783780
server {
784781
listen 80;
785782
server_name app.example.com;
786-
proxy_http_version 1.1;
787783
788784
app_protect_enable on;
789785
app_protect_security_log_enable on;
@@ -1275,8 +1271,6 @@ server {
12751271
listen 80;
12761272
server_name domain.com;
12771273
1278-
proxy_http_version 1.1;
1279-
12801274
location / {
12811275
12821276
# F5 WAF for NGINX

content/waf/install/kubernetes-plm.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,6 @@ http {
195195
server {
196196
listen 80;
197197
server_name localhost;
198-
proxy_http_version 1.1;
199198
200199
location / {
201200
app_protect_enable on;
@@ -454,7 +453,6 @@ appprotect:
454453
server {
455454
listen 80;
456455
server_name localhost;
457-
proxy_http_version 1.1;
458456
459457
location / {
460458
app_protect_enable on;

content/waf/logging/custom-dimensions.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ server {
3737
listen 80;
3838
3939
server_name localhost;
40-
proxy_http_version 1.1;
4140
app_protect_custom_log_attribute 'environment' 'env1';
4241
4342
location / {

content/waf/policies/configuration.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,6 @@ http {
9696
server {
9797
listen 80;
9898
server_name localhost;
99-
proxy_http_version 1.1;
10099
101100
location / {
102101
client_max_body_size 0;

content/waf/policies/filetypes.md

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
---
2+
# We use sentence case and present imperative tone
3+
title: "Filetypes"
4+
# Weights are assigned in increments of 100: determines sorting order
5+
weight: 1125
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 page describes the filetype feature of F5 WAF for NGINX.
16+
17+
Using this feature, you can enable or disable specific file types with your policies.
18+
19+
The following example enables the violation in blocking mode.
20+
21+
It allows the wildcard entity by default (All filetypes), then selectively blocks the `.bat` filetype .
22+
23+
```json
24+
{
25+
"policy": {
26+
"name": "policy1",
27+
"template": { "name": "POLICY_TEMPLATE_NGINX_BASE" },
28+
"applicationLanguage": "utf-8",
29+
"enforcementMode": "blocking",
30+
"blocking-settings": {
31+
"violations": [
32+
{
33+
"name": "VIOL_FILETYPE",
34+
"alarm": true,
35+
"block": true
36+
}
37+
]
38+
},
39+
"filetypes": [
40+
{
41+
"name": "*",
42+
"type": "wildcard",
43+
"allowed": true,
44+
"checkPostDataLength": false,
45+
"postDataLength": 4096,
46+
"checkRequestLength": false,
47+
"requestLength": 8192,
48+
"checkUrlLength": true,
49+
"urlLength": 2048,
50+
"checkQueryStringLength": true,
51+
"queryStringLength": 2048,
52+
"responseCheck": false
53+
},
54+
{
55+
"name": "bat",
56+
"allowed": false
57+
}
58+
]
59+
}
60+
}
61+
```
62+
63+
You can declare any additional file types in their own section (Denoted with curly brackets), disabling them with the `"allowed": false` directive.

content/waf/policies/graphql-protection.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,6 @@ http {
105105
server {
106106
listen 80;
107107
server_name localhost;
108-
proxy_http_version 1.1;
109108
110109
location / {
111110
client_max_body_size 0;

content/waf/policies/ip-intelligence.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ services:
113113
- "50000:50000"
114114
volumes:
115115
- /opt/app_protect/bd_config:/opt/app_protect/bd_config
116+
- /var/IpRep:/var/IpRep
116117
networks:
117118
- waf_network
118119
restart: always
@@ -218,7 +219,7 @@ spec:
218219
- name: app-protect-bundles
219220
mountPath: /etc/app_protect/bundles
220221
- name: waf-ip-intelligence
221-
image: private-registry.nginx.com/napwaf-ip-intelligence:<version-tag>
222+
image: private-registry.nginx.com/nap/waf-ip-intelligence:<version-tag>
222223
imagePullPolicy: IfNotPresent
223224
securityContext:
224225
allowPrivilegeEscalation: false
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
---
2+
title: Response signatures
3+
weight: 1850
4+
toc: true
5+
nd-content-type: reference
6+
nd-product: NAP-WAF
7+
nd-docs: DOCS-000
8+
---
9+
10+
This page describes the response signatures feature of F5 WAF for NGINX.
11+
12+
Response signatures are signatures detected in HTTP responses: [Attack signatures]({{< ref "/waf/policies/attack-signatures.md" >}}) are detected in HTTP requests.
13+
14+
You may also want to view the [Allowed methods]({{< ref "/waf/policies/allowed-methods.md" >}}) topic.
15+
16+
## Response codes
17+
18+
F5 WAF for NGINX can be configured to selectively allow response codes while blocking all others.
19+
20+
The `allowedResponseCodes` attribute is used to define which response codes are allowed as part of a comma-sepated list in the `general` block.
21+
22+
The following example enables the response status codes violation in blocking mode.
23+
24+
```json
25+
{
26+
"policy": {
27+
"name": "allowed_response",
28+
"template": { "name": "POLICY_TEMPLATE_NGINX_BASE" },
29+
"applicationLanguage": "utf-8",
30+
"enforcementMode": "blocking",
31+
"blocking-settings": {
32+
"violations": [
33+
{
34+
"name": "VIOL_HTTP_RESPONSE_STATUS",
35+
"alarm": true,
36+
"block": true
37+
}
38+
]
39+
},
40+
"general": {
41+
"allowedResponseCodes": [
42+
400,
43+
401,
44+
403,
45+
404,
46+
502,
47+
499
48+
]
49+
}
50+
}
51+
}
52+
```
53+
54+
## Restricted response length
55+
56+
F5 WAF for NGINX can define a limit to the amount of bytes that will be inspected in a response. This feature is disabled by default, with a default length of 20,000 bytes when enabled.
57+
58+
Restrictions on known signatures will be enforced by policies independently of response length.
59+
60+
To enable this, set the `responseCheck` parameter to `true`. Add the `responseCheckLength` attribute to set an alternative length to the default value.
61+
62+
The response length checked refers to the number of uncompressed bytes in the response body.
63+
64+
Usually F5 WAF for NGINX will buffer only that part of the response saving memory and CPU, but in some conditions the whole response may have to be buffered, such as when the response body is compressed.
65+
66+
The following example enables the `responseCheck` parameter with `responseCheckLength` set to `1000`, signifying that only the initial 1000 bytes of the response body should be inspected.
67+
68+
It is nested within a [filetypes]({{< ref "/waf/policies/response-signatures.md" >}}) block.
69+
70+
```json {hl_lines=[9, 13, 14]}
71+
{
72+
"policy": {
73+
"name": "response_signatures_block",
74+
"template": {
75+
"name": "POLICY_TEMPLATE_NGINX_BASE"
76+
},
77+
"applicationLanguage": "utf-8",
78+
"enforcementMode": "blocking",
79+
"filetypes": [
80+
{
81+
"name": "*",
82+
"type": "wildcard",
83+
"responseCheck": true,
84+
"responseCheckLength": 1000
85+
}
86+
],
87+
"signature-sets": [
88+
{
89+
"name": "All Response Signatures",
90+
"block": true,
91+
"alarm": true
92+
}
93+
]
94+
}
95+
}
96+
```

0 commit comments

Comments
 (0)