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.
809
809
When brute force patterns are detected, the NGINX App Protect WAF policy either trigger an alarm or block the attack if the failed
810
810
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.
813
812
814
813
---
814
+
### The User-Defined URL example
815
815
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
817
828
818
829
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)
819
830
```json
@@ -839,18 +850,10 @@ A login page specifies the login URL that users must pass through to get authent
839
850
840
851
---
841
852
842
-
### Brute force policy example
853
+
### Brute force example
843
854
844
855
Example1: A single brute force configuration is applied universally to all login pages.
845
856
```json
846
-
{
847
-
"policy": {
848
-
"name": "BruteForcePolicy",
849
-
"template": {
850
-
"name": "POLICY_TEMPLATE_NGINX_BASE"
851
-
},
852
-
"applicationLanguage": "utf-8",
853
-
"enforcementMode": "blocking",
854
857
"brute-force-attack-preventions" : [
855
858
{
856
859
"bruteForceProtectionForAllLoginPages" : true,
@@ -868,21 +871,11 @@ Example1: A single brute force configuration is applied universally to all login
868
871
"sourceBasedProtectionDetectionPeriod" : 3600
869
872
}
870
873
]
871
-
}
872
-
}
873
874
```
874
875
875
876
Example2: Different brute force configurations can be defined for individual login pages,
876
877
with each configuration referencing a specific login page.
877
878
```json
878
-
{
879
-
"policy": {
880
-
"name": "BruteForcePolicySpec",
881
-
"template": {
882
-
"name": "POLICY_TEMPLATE_NGINX_BASE"
883
-
},
884
-
"applicationLanguage": "utf-8",
885
-
"enforcementMode": "blocking",
886
879
"brute-force-attack-preventions" : [
887
880
{
888
881
"bruteForceProtectionForAllLoginPages" : false,
@@ -902,13 +895,71 @@ Example2: Different brute force configurations can be defined for individual log
902
895
"method": "*",
903
896
"name": "/html_login",
904
897
"protocol": "http"
905
-
}
898
+
}
906
899
}
907
900
],
901
+
```
908
902
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
+
}
910
960
}
911
961
```
962
+
912
963
{{< 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 >}}
0 commit comments