You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To prevent brute force attacks, NGINX App Protect WAF monitors IP addresses, usernames, and the number of failed login attempts beyond a maximum threshold.
670
670
When brute force patterns are detected, the NGINX App Protect WAF policy either trigger an alarm or block the attack if the failed
671
671
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.
674
673
675
674
---
675
+
### The User-Defined URL example
676
676
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
678
689
679
690
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)
680
691
```json
@@ -699,18 +710,10 @@ A login page specifies the login URL that users must pass through to get authent
699
710
{{< 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 >}}
700
711
701
712
---
702
-
### Brute force policy example
713
+
### Brute force example
703
714
704
715
Example1: A single brute force configuration is applied universally to all login pages.
705
716
```json
706
-
{
707
-
"policy": {
708
-
"name": "BruteForcePolicy",
709
-
"template": {
710
-
"name": "POLICY_TEMPLATE_NGINX_BASE"
711
-
},
712
-
"applicationLanguage": "utf-8",
713
-
"enforcementMode": "blocking",
714
717
"brute-force-attack-preventions" : [
715
718
{
716
719
"bruteForceProtectionForAllLoginPages" : true,
@@ -728,21 +731,11 @@ Example1: A single brute force configuration is applied universally to all login
728
731
"sourceBasedProtectionDetectionPeriod" : 3600
729
732
}
730
733
]
731
-
}
732
-
}
733
734
```
734
735
735
736
Example2: Different brute force configurations can be defined for individual login pages,
736
737
with each configuration referencing a specific login page.
737
738
```json
738
-
{
739
-
"policy": {
740
-
"name": "BruteForcePolicySpec",
741
-
"template": {
742
-
"name": "POLICY_TEMPLATE_NGINX_BASE"
743
-
},
744
-
"applicationLanguage": "utf-8",
745
-
"enforcementMode": "blocking",
746
739
"brute-force-attack-preventions" : [
747
740
{
748
741
"bruteForceProtectionForAllLoginPages" : false,
@@ -762,13 +755,72 @@ Example2: Different brute force configurations can be defined for individual log
762
755
"method": "*",
763
756
"name": "/html_login",
764
757
"protocol": "http"
765
-
}
758
+
}
766
759
}
767
760
],
761
+
```
768
762
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
+
}
770
821
}
771
822
```
823
+
772
824
{{< 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 >}}
0 commit comments