Skip to content

Commit 8954f5e

Browse files
committed
fix: gofmt
1 parent ffe8d34 commit 8954f5e

File tree

1 file changed

+131
-8
lines changed

1 file changed

+131
-8
lines changed

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

Lines changed: 131 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -657,10 +657,9 @@ claims['address'] = "{ \"address\": { .... } }" # JSON structs can be accessed u
657657

658658
Brute force attacks are attempts to break in to secured areas of a web application by trying exhaustive,
659659
systematic, username/password combinations to discover legitimate authentication credentials.
660-
To prevent brute force attacks, WAF tracks the number of failed attempts to reach login pages
660+
To prevent brute force attacks, Nginx App Protect (NAP) WAF tracks the number of failed attempts to reach login pages
661661
with enforced brute force protection. When brute force patterns are detected,
662-
the WAF policy considers it to be an attack if the failed logon rate increased significantly or
663-
if failed logins reached a maximum threshold.
662+
the Nginx App Protect (NAP) WAF policy considers it to be an attack if the failed logins reached a maximum threshold.
664663

665664
### Brute force policy example
666665

@@ -676,10 +675,34 @@ if failed logins reached a maximum threshold.
676675
"brute-force-attack-preventions" : [
677676
{
678677
"bruteForceProtectionForAllLoginPages" : true,
679-
"detectionCriteria" : {
678+
"loginAttemptsFromTheSameIp" : {
679+
"action" : "alarm",
680+
"enabled" : true,
681+
"threshold" : 20
682+
},
683+
"loginAttemptsFromTheSameUser" : {
680684
"action" : "alarm",
681-
"failedLoginAttemptsRateReached" : 100
685+
"enabled" : true,
686+
"threshold" : 3
682687
},
688+
"reEnableLoginAfter" : 3600,
689+
"sourceBasedProtectionDetectionPeriod" : 3600
690+
}
691+
]
692+
}
693+
}
694+
695+
{
696+
"policy": {
697+
"name": "BruteForcePolicySpec",
698+
"template": {
699+
"name": "POLICY_TEMPLATE_NGINX_BASE"
700+
},
701+
"applicationLanguage": "utf-8",
702+
"enforcementMode": "blocking",
703+
"brute-force-attack-preventions" : [
704+
{
705+
"bruteForceProtectionForAllLoginPages" : false,
683706
"loginAttemptsFromTheSameIp" : {
684707
"action" : "alarm",
685708
"enabled" : true,
@@ -690,16 +713,116 @@ if failed logins reached a maximum threshold.
690713
"enabled" : true,
691714
"threshold" : 3
692715
},
693-
"measurementPeriod" : 900,
694-
"preventionDuration" : "3600",
695716
"reEnableLoginAfter" : 3600,
696-
"sourceBasedProtectionDetectionPeriod" : 3600
717+
"sourceBasedProtectionDetectionPeriod" : 3600,
718+
"url": {
719+
"method": "*",
720+
"name": "/html_login",
721+
"protocol": "http"
722+
}
723+
}
724+
],
725+
"login-pages": [
726+
{
727+
"accessValidation" : {
728+
"responseContains": "Success"
729+
},
730+
"authenticationType": "form",
731+
"url" : {
732+
"method" : "*",
733+
"name" : "/html_login",
734+
"protocol" : "http",
735+
"type" : "explicit"
736+
},
737+
"usernameParameterName": "username",
738+
"passwordParameterName": "password"
697739
}
698740
]
699741
}
700742
}
701743

702744
```
745+
policy:
746+
brute-force-attack-preventions:
747+
Defines configuration for Brute Force Protection feature.
748+
There is default configuration (one with bruteForceProtectionForAllLoginPages flag and without url)
749+
that applies to all configured login URLs unless there exists another brute force configuration for a specific login page.
750+
751+
bruteForceProtectionForAllLoginPages:
752+
When enabled, enables Brute Force Protection for all configured login URLs.
753+
When disabled, the url entry below should contain a url that is defined as a login page.
754+
755+
url:
756+
Reference to the URL used in login URL configuration (policy/login-pages).
757+
This login URL is protected by Brute Force Protection feature.
758+
759+
loginAttemptsFromTheSameIp:
760+
Specifies configuration for detecting brute force attacks from IP Address.
761+
762+
action:
763+
Specifies action that is applied when defined threshold is reached.
764+
- **alarm**: The system will log the login attempt.
765+
- **alarm-and-blocking-page**: The system will log the login attempt, block the request and send the Blocking page.
766+
767+
enabled:
768+
When enabled, the system counts failed login attempts from IP Address.
769+
770+
threshold:
771+
After configured threshold (number of failed login attempts from IP Address) defined action will be applied when a brute force attack will be detected.
772+
773+
loginAttemptsFromTheSameUser:
774+
Specifies configuration for detecting brute force attacks for a specific username.
775+
776+
action:
777+
Specifies action that is applied when defined threshold is reached.
778+
- **alarm**: The system will log the login attempt.
779+
780+
enabled:
781+
When enabled, the system counts failed login attempts for a specific username.
782+
783+
threshold:
784+
After configured threshold (number of failed login attempts for a specific username) defined action will be applied when a brute force attack will be detected.
785+
786+
reEnableLoginAfter:
787+
Defines prevention period (measured in seconds) for source-based brute force attacks.
788+
789+
sourceBasedProtectionDetectionPeriod:
790+
Defines detection period (measured in seconds) for source-based brute force attacks.
791+
792+
login-pages:
793+
A login page is a URL in a web application that requests must pass through to get to the authenticated URLs. Use login pages,
794+
for example, to prevent forceful browsing of restricted parts of the web application, by defining access permissions for users.
795+
Login pages also allow session tracking of user sessions.
796+
797+
accessValidation:
798+
Access Validation define validation criteria for the login page response.
799+
If you define more than one validation criteria, the response must meet all the criteria before the system allows the user to access the application login URL.
800+
801+
authenticationType:
802+
Authentication Type is method the web server uses to authenticate the login URL's credentials with a web user.
803+
804+
- **none**: The web server does not authenticate users trying to access the web application through the login URL.
805+
This is the default setting.
806+
807+
- **form**: The web application uses a form to collect and authenticate user credentials. If using this option,
808+
you also need to type the user name and password parameters written in the code of the HTML form.
809+
810+
- **http-basic**: The user name and password are transmitted in Base64 and stored on the server in plain text.
811+
812+
- **http-digest**: The web server performs the authentication; user names and passwords are not transmitted over the network, nor are they stored in plain text.
813+
814+
- **ntlm**: Microsoft LAN Manager authentication (also called Integrated Windows Authentication) does not transmit credentials in plain text,
815+
but requires a continuous TCP connection between the server and client.
816+
817+
- **ajax-or-json-request**: The web server uses JSON and AJAX requests to authenticate users trying to access the web application through the login URL.
818+
For this option, you also need to type the name of the JSON element containing the user name and password.
819+
820+
usernameParameterName:
821+
A name of parameter which will contain username string.
822+
passwordParameterName:
823+
A name of parameter which will contain password string.
824+
url:
825+
URL string used for login page.
703826

704827
## Custom Dimensions Log Entries
705828

0 commit comments

Comments
 (0)