Skip to content

Commit fe6bfa3

Browse files
authored
Update configuration.md in V5
Brute-force configuration description
1 parent 82f0f1f commit fe6bfa3

File tree

1 file changed

+75
-24
lines changed

1 file changed

+75
-24
lines changed

content/nap-waf/v5/configuration-guide/configuration.md

Lines changed: 75 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -808,12 +808,23 @@ systematic, username/password combinations to discover legitimate authentication
808808
To prevent brute force attacks, NGINX App Protect WAF monitors IP addresses, usernames, and the number of failed login attempts beyond a maximum threshold.
809809
When brute force patterns are detected, the NGINX App Protect WAF policy either trigger an alarm or block the attack if the failed
810810
login attempts reached a maximum threshold for a specific username or coming from a specific IP address.
811-
To enable brute force protection, at least one login page must be created.
812-
The login page entity is created separately and is not included in the brute force configuration block
811+
In order to create a brute force configuration for a specific URL in Nginx App Protect you must first create a User-Defined URL, then a Login Page and finally define the URL element in the Brute Force configuration section.
813812

814813
---
814+
### The User-Defined URL example
815815

816-
### Login page policy example
816+
```json
817+
"urls": [
818+
{
819+
"method": "*",
820+
"name": "/html_login",
821+
"protocol": "http",
822+
"type": "explicit"
823+
}
824+
],
825+
```
826+
827+
### Login page example
817828

818829
A login page specifies the login URL that users must pass through to get authenticated. The configuration of a login URL includes the URL itself, the username and passwords parameters and the validation criteria (how we know that a login was successful or failed)
819830
```json
@@ -839,18 +850,10 @@ A login page specifies the login URL that users must pass through to get authent
839850

840851
---
841852

842-
### Brute force policy example
853+
### Brute force example
843854

844855
Example1: A single brute force configuration is applied universally to all login pages.
845856
```json
846-
{
847-
"policy": {
848-
"name": "BruteForcePolicy",
849-
"template": {
850-
"name": "POLICY_TEMPLATE_NGINX_BASE"
851-
},
852-
"applicationLanguage": "utf-8",
853-
"enforcementMode": "blocking",
854857
"brute-force-attack-preventions" : [
855858
{
856859
"bruteForceProtectionForAllLoginPages" : true,
@@ -868,21 +871,11 @@ Example1: A single brute force configuration is applied universally to all login
868871
"sourceBasedProtectionDetectionPeriod" : 3600
869872
}
870873
]
871-
}
872-
}
873874
```
874875

875876
Example2: Different brute force configurations can be defined for individual login pages,
876877
with each configuration referencing a specific login page.
877878
```json
878-
{
879-
"policy": {
880-
"name": "BruteForcePolicySpec",
881-
"template": {
882-
"name": "POLICY_TEMPLATE_NGINX_BASE"
883-
},
884-
"applicationLanguage": "utf-8",
885-
"enforcementMode": "blocking",
886879
"brute-force-attack-preventions" : [
887880
{
888881
"bruteForceProtectionForAllLoginPages" : false,
@@ -902,13 +895,71 @@ Example2: Different brute force configurations can be defined for individual log
902895
"method": "*",
903896
"name": "/html_login",
904897
"protocol": "http"
905-
}
898+
}
906899
}
907900
],
901+
```
908902

909-
}
903+
The following example adds all three of the pieces for a complete example policy.
904+
```json
905+
{
906+
"policy": {
907+
"name": "BruteForcePolicy",
908+
"template": {
909+
"name": "POLICY_TEMPLATE_NGINX_BASE"
910+
},
911+
"applicationLanguage": "utf-8",
912+
"enforcementMode": "blocking",
913+
"urls": [
914+
{
915+
"method": "*",
916+
"name": "/html_login",
917+
"protocol": "http",
918+
"type": "explicit"
919+
}
920+
],
921+
"login-pages": [
922+
{
923+
"accessValidation": {
924+
"responseContains": "Success"
925+
},
926+
"authenticationType": "form",
927+
"url": {
928+
"method": "*",
929+
"name": "/html_login",
930+
"protocol": "http",
931+
"type": "explicit"
932+
},
933+
"usernameParameterName": "username",
934+
"passwordParameterName": "password"
935+
}
936+
],
937+
"brute-force-attack-preventions": [
938+
{
939+
"bruteForceProtectionForAllLoginPages": false,
940+
"loginAttemptsFromTheSameIp": {
941+
"action": "alarm",
942+
"enabled": true,
943+
"threshold": 20
944+
},
945+
"loginAttemptsFromTheSameUser": {
946+
"action": "alarm",
947+
"enabled": true,
948+
"threshold": 3
949+
},
950+
"reEnableLoginAfter": 3600,
951+
"sourceBasedProtectionDetectionPeriod": 3600,
952+
"url": {
953+
"method": "*",
954+
"name": "/html_login",
955+
"protocol": "http"
956+
}
957+
}
958+
]
959+
}
910960
}
911961
```
962+
912963
{{< note >}} For further configuration details, see NGINX App Protect WAF Declarative Policy Guide [Declarative Policy guide]({{< ref "/nap-waf/v5/declarative-policy/policy/#policy/brute-force-attack-preventions" >}}). {{< /note >}}
913964

914965
## Custom Dimensions Log Entries

0 commit comments

Comments
 (0)