Skip to content

Commit 82f0f1f

Browse files
authored
Update configuration.md
brute-force and login-pages configuration
1 parent 5ce83c3 commit 82f0f1f

File tree

1 file changed

+76
-24
lines changed

1 file changed

+76
-24
lines changed

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

Lines changed: 76 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -669,12 +669,23 @@ systematic, username/password combinations to discover legitimate authentication
669669
To prevent brute force attacks, NGINX App Protect WAF monitors IP addresses, usernames, and the number of failed login attempts beyond a maximum threshold.
670670
When brute force patterns are detected, the NGINX App Protect WAF policy either trigger an alarm or block the attack if the failed
671671
login attempts reached a maximum threshold for a specific username or coming from a specific IP address.
672-
To enable brute force protection, at least one login page must be created.
673-
The login page entity is created separately and is not included in the brute force configuration block.
672+
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.
674673

675674
---
675+
### The User-Defined URL example
676676

677-
### Login page policy example
677+
```json
678+
"urls": [
679+
{
680+
"method": "*",
681+
"name": "/html_login",
682+
"protocol": "http",
683+
"type": "explicit"
684+
}
685+
],
686+
```
687+
688+
### Login page example
678689

679690
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)
680691
```json
@@ -699,18 +710,10 @@ A login page specifies the login URL that users must pass through to get authent
699710
{{< note >}} For further configuration details, see NGINX App Protect WAF Declarative Policy Guide [Declarative Policy guide]({{< ref "/nap-waf/v4/declarative-policy/policy/#policy/login-pages" >}}). {{< /note >}}
700711

701712
---
702-
### Brute force policy example
713+
### Brute force example
703714

704715
Example1: A single brute force configuration is applied universally to all login pages.
705716
```json
706-
{
707-
"policy": {
708-
"name": "BruteForcePolicy",
709-
"template": {
710-
"name": "POLICY_TEMPLATE_NGINX_BASE"
711-
},
712-
"applicationLanguage": "utf-8",
713-
"enforcementMode": "blocking",
714717
"brute-force-attack-preventions" : [
715718
{
716719
"bruteForceProtectionForAllLoginPages" : true,
@@ -728,21 +731,11 @@ Example1: A single brute force configuration is applied universally to all login
728731
"sourceBasedProtectionDetectionPeriod" : 3600
729732
}
730733
]
731-
}
732-
}
733734
```
734735

735736
Example2: Different brute force configurations can be defined for individual login pages,
736737
with each configuration referencing a specific login page.
737738
```json
738-
{
739-
"policy": {
740-
"name": "BruteForcePolicySpec",
741-
"template": {
742-
"name": "POLICY_TEMPLATE_NGINX_BASE"
743-
},
744-
"applicationLanguage": "utf-8",
745-
"enforcementMode": "blocking",
746739
"brute-force-attack-preventions" : [
747740
{
748741
"bruteForceProtectionForAllLoginPages" : false,
@@ -762,13 +755,72 @@ Example2: Different brute force configurations can be defined for individual log
762755
"method": "*",
763756
"name": "/html_login",
764757
"protocol": "http"
765-
}
758+
}
766759
}
767760
],
761+
```
768762

769-
}
763+
The following example adds all three of the pieces for a complete example policy.
764+
765+
```json
766+
{
767+
"policy": {
768+
"name": "BruteForcePolicy",
769+
"template": {
770+
"name": "POLICY_TEMPLATE_NGINX_BASE"
771+
},
772+
"applicationLanguage": "utf-8",
773+
"enforcementMode": "blocking",
774+
"urls": [
775+
{
776+
"method": "*",
777+
"name": "/html_login",
778+
"protocol": "http",
779+
"type": "explicit"
780+
}
781+
],
782+
"login-pages": [
783+
{
784+
"accessValidation": {
785+
"responseContains": "Success"
786+
},
787+
"authenticationType": "form",
788+
"url": {
789+
"method": "*",
790+
"name": "/html_login",
791+
"protocol": "http",
792+
"type": "explicit"
793+
},
794+
"usernameParameterName": "username",
795+
"passwordParameterName": "password"
796+
}
797+
],
798+
"brute-force-attack-preventions": [
799+
{
800+
"bruteForceProtectionForAllLoginPages": false,
801+
"loginAttemptsFromTheSameIp": {
802+
"action": "alarm",
803+
"enabled": true,
804+
"threshold": 20
805+
},
806+
"loginAttemptsFromTheSameUser": {
807+
"action": "alarm",
808+
"enabled": true,
809+
"threshold": 3
810+
},
811+
"reEnableLoginAfter": 3600,
812+
"sourceBasedProtectionDetectionPeriod": 3600,
813+
"url": {
814+
"method": "*",
815+
"name": "/html_login",
816+
"protocol": "http"
817+
}
818+
}
819+
]
820+
}
770821
}
771822
```
823+
772824
{{< note >}} For further configuration details, see NGINX App Protect WAF Declarative Policy Guide [Declarative Policy guide]({{< ref "/nap-waf/v4/declarative-policy/policy/#policy/brute-force-attack-preventions" >}}). {{< /note >}}
773825

774826
## Custom Dimensions Log Entries

0 commit comments

Comments
 (0)