Skip to content

Commit 951f918

Browse files
authored
Update configuration.md brute-force and login-pages
brute-force and login-pages documentation improvement
1 parent fddf29b commit 951f918

File tree

1 file changed

+77
-25
lines changed

1 file changed

+77
-25
lines changed

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

Lines changed: 77 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ When configuring NGINX App Protect WAF, `app_protect_enable` should always be en
3939
|[XFF headers & trust](#xff-headers-and-trust) | Disabled by default. User can enable it and optionally add a list of custom XFF headers. |
4040
|[gRPC Protection](#grpc-protection-for-unary-traffic) | gRPC content profile 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 can be on [unary](#grpc-protection-for-unary-traffic) or [bidirectional](#grpc-protection-for-bidirectional-streaming) traffic.|
4141
|[Brute Force Attack Preventions](#brute-force-attack-preventions) | Configure brute-force-attack-preventions parameters to secured areas of a web application from brute force attacks.|}
42+
|[IP Groups](#ip-address-lists) | Configure IP Groups feature to organize lists of allowed and forbidden IP addresses across several lists with common attributes.|}
4243

4344
### Disallowed File Types
4445
{{< include "nap-waf/config/common/disallowed-file-types.md" >}}
@@ -669,12 +670,23 @@ systematic, username/password combinations to discover legitimate authentication
669670
To prevent brute force attacks, NGINX App Protect WAF monitors IP addresses, usernames, and the number of failed login attempts beyond a maximum threshold.
670671
When brute force patterns are detected, the NGINX App Protect WAF policy either trigger an alarm or block the attack if the failed
671672
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.
673+
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.
674674

675675
---
676+
### The User-Defined URL example
676677

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

679691
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)
680692
```json
@@ -699,18 +711,10 @@ A login page specifies the login URL that users must pass through to get authent
699711
{{< 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 >}}
700712

701713
---
702-
### Brute force policy example
714+
### Brute force prevention example
703715

704716
Example1: A single brute force configuration is applied universally to all login pages.
705717
```json
706-
{
707-
"policy": {
708-
"name": "BruteForcePolicy",
709-
"template": {
710-
"name": "POLICY_TEMPLATE_NGINX_BASE"
711-
},
712-
"applicationLanguage": "utf-8",
713-
"enforcementMode": "blocking",
714718
"brute-force-attack-preventions" : [
715719
{
716720
"bruteForceProtectionForAllLoginPages" : true,
@@ -728,21 +732,11 @@ Example1: A single brute force configuration is applied universally to all login
728732
"sourceBasedProtectionDetectionPeriod" : 3600
729733
}
730734
]
731-
}
732-
}
733735
```
734736

735737
Example2: Different brute force configurations can be defined for individual login pages,
736738
with each configuration referencing a specific login page.
737739
```json
738-
{
739-
"policy": {
740-
"name": "BruteForcePolicySpec",
741-
"template": {
742-
"name": "POLICY_TEMPLATE_NGINX_BASE"
743-
},
744-
"applicationLanguage": "utf-8",
745-
"enforcementMode": "blocking",
746740
"brute-force-attack-preventions" : [
747741
{
748742
"bruteForceProtectionForAllLoginPages" : false,
@@ -762,14 +756,72 @@ Example2: Different brute force configurations can be defined for individual log
762756
"method": "*",
763757
"name": "/html_login",
764758
"protocol": "http"
765-
}
759+
}
766760
}
767761
],
762+
```
763+
{{< 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 >}}
768764

769-
}
765+
The following example adds all three of the pieces for a complete example policy.
766+
767+
```json
768+
{
769+
"policy": {
770+
"name": "BruteForcePolicy",
771+
"template": {
772+
"name": "POLICY_TEMPLATE_NGINX_BASE"
773+
},
774+
"applicationLanguage": "utf-8",
775+
"enforcementMode": "blocking",
776+
"urls": [
777+
{
778+
"method": "*",
779+
"name": "/html_login",
780+
"protocol": "http",
781+
"type": "explicit"
782+
}
783+
],
784+
"login-pages": [
785+
{
786+
"accessValidation": {
787+
"responseContains": "Success"
788+
},
789+
"authenticationType": "form",
790+
"url": {
791+
"method": "*",
792+
"name": "/html_login",
793+
"protocol": "http",
794+
"type": "explicit"
795+
},
796+
"usernameParameterName": "username",
797+
"passwordParameterName": "password"
798+
}
799+
],
800+
"brute-force-attack-preventions": [
801+
{
802+
"bruteForceProtectionForAllLoginPages": false,
803+
"loginAttemptsFromTheSameIp": {
804+
"action": "alarm",
805+
"enabled": true,
806+
"threshold": 20
807+
},
808+
"loginAttemptsFromTheSameUser": {
809+
"action": "alarm",
810+
"enabled": true,
811+
"threshold": 3
812+
},
813+
"reEnableLoginAfter": 3600,
814+
"sourceBasedProtectionDetectionPeriod": 3600,
815+
"url": {
816+
"method": "*",
817+
"name": "/html_login",
818+
"protocol": "http"
819+
}
820+
}
821+
]
822+
}
770823
}
771824
```
772-
{{< 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
775827

0 commit comments

Comments
 (0)