6161
6262## [ Enrichment] ( #enrichment )
6363
64- - [ Data Enrichment] ( #data-enrichment )
65- - [ Log Enrichment] ( #log-enrichment )
64+ - [ Data Enrichment] ( #data-enrichment )
65+ - [ Log Enrichment] ( #log-enrichment )
6666
6767## [ Advanced Blocking Response] ( #advancedBlockingResponse )
6868
6969## [ Login Credentials Extraction] ( #loginCredentialsExtraction )
7070
7171- [ Login Credentials Extraction Configuration] ( #loginCredentialsExtractionConfiguration )
72- - [ Enable Login Credentials Extraction] ( #px_enable_login_creds_extraction )
73- - [ Credentials JSON file] ( #px_login_creds_settings_filename )
74- - [ Credentials Intelligence Version] ( #px_credentials_intelligence_version )
75- - [ Additional s2s Activity Header] ( #px_additional_s2s_activity_header_enabled )
76- - [ Send Raw Username On Additional s2s Activity] ( #px_send_raw_username_on_additional_s2s_activity )
77- - [ Compromised Credentials Header Name] ( #px_compromised_credentials_header_name )
78- - [ Login Successful Reporting Method] ( #px_login_successful_reporting_method )
79- - [ Login Successful Header Name] ( #px_login_successful_header_name )
80- - [ Login Successful Header Value] ( #px_login_successful_header_value )
81- - [ Login Successful Status] ( #px_login_successful_status )
82- - [ Login Successful Custom Function] ( #custom_login_successful )
72+ - [ Enable Login Credentials Extraction] ( #px_enable_login_creds_extraction )
73+ - [ Credentials JSON file] ( #px_login_creds_settings_filename )
74+ - [ Credentials Intelligence Version] ( #px_credentials_intelligence_version )
75+ - [ Additional s2s Activity Header] ( #px_additional_s2s_activity_header_enabled )
76+ - [ Send Raw Username On Additional s2s Activity] ( #px_send_raw_username_on_additional_s2s_activity )
77+ - [ Compromised Credentials Header Name] ( #px_compromised_credentials_header_name )
78+ - [ Login Successful Reporting Method] ( #px_login_successful_reporting_method )
79+ - [ Login Successful Header Name] ( #px_login_successful_header_name )
80+ - [ Login Successful Header Value] ( #px_login_successful_header_value )
81+ - [ Login Successful Status] ( #px_login_successful_status )
82+ - [ Login Successful Custom Function] ( #custom_login_successful )
8383
8484## [ HypeSale] ( #hypesale )
8585
86- - [ HypeSale host] ( #hypesale_host )
86+ - [ HypeSale host] ( #hypesale_host )
8787
8888## [ Sensitive GraphQL Operations] ( #graphql )
8989
90- - [ Sensitive GraphQL Operation Types] ( #px_sensitive_graphql_operation_types )
91- - [ Sensitive GraphQL Operation Names] ( #px_sensitive_graphql_operation_names )
92- - [ Sensitive GraphQL routes] ( #px_sensitive_graphql_routes )
93-
90+ - [ Sensitive GraphQL Operation Types] ( #px_sensitive_graphql_operation_types )
91+ - [ Sensitive GraphQL Operation Names] ( #px_sensitive_graphql_operation_names )
92+ - [ Sensitive GraphQL routes] ( #px_sensitive_graphql_routes )
9493
9594## [ Appendix] ( #appendix )
9695
97- - [ HTTP v2 Support] ( #http2 )
98- - [ NGINX Plus] ( #nginxplus )
99- - [ NGINX Dynamic Modules] ( #dynamicmodules )
100- - [ Multiple App Support] ( #multipleapps )
101- - [ Setting Up A First Party Prefix] ( #setting_up_first_party_prefix )
102- - [ URI Delimiters] ( #uri_delimiters )
96+ - [ HTTP v2 Support] ( #http2 )
97+ - [ NGINX Plus] ( #nginxplus )
98+ - [ NGINX Dynamic Modules] ( #dynamicmodules )
99+ - [ Multiple App Support] ( #multipleapps )
100+ - [ Setting Up A First Party Prefix] ( #setting_up_first_party_prefix )
101+ - [ URI Delimiters] ( #uri_delimiters )
103102
104103## [ Test Environment] ( #test_environment )
105104
@@ -158,7 +157,7 @@ To upgrade to the latest Enforcer version, [re-install](#installation) the Enfor
158157- [ CentOS 7] ( #centos7 )
159158- Amazon Linux (AMI)
160159
161- #### <a name =" supported_versions " ></a >Supported NGINX Versions:
160+ #### <a name =" supported_versions " ></a >Supported NGINX Versions
162161
163162Recommended that you use the newest version of NGINX from the [ Official NGINX] ( http://nginx.org/en/linux_packages.html ) repo.
164163
@@ -191,7 +190,7 @@ If an `add-apt-repository: command not found` error is returned, run:
191190
192191` sudo apt-get -y install software-properties-common `
193192
194- ###### 3. Install the dependencies for Ubuntu 14.04:
193+ ###### 3. Install the dependencies for Ubuntu 14.04
195194
196195``` sh
197196sudo apt-get -y install build-essential
@@ -401,7 +400,7 @@ luarocks install lua-cjson
401400luarocks install perimeterx-nginx-plugin
402401```
403402
404- ###### 10. Optionally, if you are testing in a new environment you may need to configure the following:
403+ ###### 10. Optionally, if you are testing in a new environment you may need to configure the following
405404
406405- Add the user "nginx"
407406
@@ -437,6 +436,7 @@ luarocks install perimeterx-nginx-plugin
437436 ```
438437
439438- Enable and Start the NGINX Service
439+
440440 ``` sh
441441 sudo systemctl is-enabled nginx.service
442442 sudo systemctl start nginx.service
@@ -564,7 +564,7 @@ The following NGINX Configurations are required to support the PerimeterX NGINX
564564
565565### <a name =" configuration " ></a >PerimeterX Plugin Configuration
566566
567- #### <a name =" perimterx_required_parameters " ></a >Required Configuration:
567+ #### <a name =" perimterx_required_parameters " ></a >Required Configuration
568568
569569The following configurations are set in:
570570
@@ -694,7 +694,8 @@ Several filters can be configured:
694694 _M .whitelist_uri_pattern = {},
695695 _M .whitelist_ip_addresses = {},
696696 _M .whitelist_ua_full = {},
697- _M .whitelist_ua_sub = {}
697+ _M .whitelist_ua_sub = {},
698+ _M .whitelist_hosts = {}
698699```
699700
700701| Filter Name | Value | Filters Request To |
@@ -706,6 +707,7 @@ Several filters can be configured:
706707| ** whitelist_ip_addresses** | ` {'192.168.99.1'} ` | Filters requests coming from any of the listed IPs. |
707708| ** whitelist_ua_full** | ` {'Mozilla/5.0 (compatible; pingbot/2.0; http://www.pingdom.com/)'} ` | Filters all requests matching this exact UA. |
708709| ** whitelist_ua_sub** | ` {'GoogleCloudMonitoring'} ` | Filters requests containing the provided string in their UA. |
710+ | ** whitelist_hosts** | ` {'www.example.com'} ` | Filters requests coming from the listed hosts. |
709711
710712### <a name =" sensitive-headers " ></a > Filter Sensitive Headers
711713
@@ -754,8 +756,8 @@ _M.custom_enabled_routes = function(uri)
754756end
755757
756758```
757- See [ examples/custom_enabled_routes.lua] ( /examples/custom_enabled_routes.lua ) for a complete example of using ` custom_enabled_routes ` .
758759
760+ See [ examples/custom_enabled_routes.lua] ( /examples/custom_enabled_routes.lua ) for a complete example of using ` custom_enabled_routes ` .
759761
760762### <a name =" monitored-routes " ></a > Monitored Routes
761763
@@ -783,6 +785,7 @@ _M.sensitive_routes_suffix = {'/download'}
783785```
784786
785787### <a name =" sensitive-routes-regex " ></a > Sensitive Routes Regex List
788+
786789A list of route regular expressions (regex). When PerimeterX module matches the request URI with a regex from the list, the module creates a server-to-server call, even when the cookie is valid and the risk score is low.
787790
788791** Default:** Empty list
@@ -794,6 +797,7 @@ _M.sensitive_routes = {'^/login/[0-9]*user$'}
794797```
795798
796799### <a name =" custom-sensitive-routes " ></a > Custom Sensitive Routes
800+
797801Allows you to define a function, which takes ` uri ` as an argument and returns ` true ` or ` false ` .
798802Returning ` true ` means that PerimeterX module creates a server-to-server call, even when the cookie is valid and the risk score is low.
799803
@@ -815,8 +819,8 @@ _M.custom_sensitive_routes = function(uri)
815819end
816820
817821```
818- See [ examples/custom_enabled_routes.lua] ( /examples/custom_enabled_routes.lua ) for a complete example of using ` custom_enabled_routes ` (which is similar to ` custom_sensitive_routes ` ).
819822
823+ See [ examples/custom_enabled_routes.lua] ( /examples/custom_enabled_routes.lua ) for a complete example of using ` custom_enabled_routes ` (which is similar to ` custom_sensitive_routes ` ).
820824
821825### <a name =" api-timeout " ></a >API Timeout Milliseconds
822826
@@ -857,7 +861,7 @@ Example:
857861_M .custom_block_url = ' /block.html'
858862```
859863
860- > Note: This URI is whitelisted automatically under ` _M.Whitelist['uri_full'] ` to avoid infinite redirects.
864+ > Note: This URI is whitelisted automatically under ` _M.Whitelist['uri_full'] ` to avoid infinite redirects.
861865
862866### <a name =" redirect_on_custom_url " ></a > Redirect on Custom URL
863867
@@ -1147,10 +1151,10 @@ For details on how to create a custom Captcha page, refer to the [documentation]
11471151
11481152This feature extracts credentials (hashed username and password) from requests and sends them to PerimeterX as additional info in risk / activity api calls. The feature can be toggled on and off. The settings are adjusted by modifying a Credentials JSON file.
11491153
1150-
11511154### <a name =" loginCredentialsExtractionConfiguration " ></a > Login Credentials Extraction Configuration
11521155
11531156### <a name =" px_enable_login_creds_extraction " ></a > Enable Login Credentials Extraction
1157+
11541158Enables Login Credentials Extraction
11551159
11561160** Default:** false (disabled)
@@ -1160,6 +1164,7 @@ _M.px_enable_login_creds_extraction = true
11601164```
11611165
11621166### <a name =" px_login_creds_settings_filename " ></a > Credentials JSON file
1167+
11631168Sets a full path to credentials JSON file
11641169
11651170** Default:** nil (none)
@@ -1182,6 +1187,7 @@ Example available in `examples/creds.json` file. It includes an array of JSON ob
11821187```
11831188
11841189### <a name =" px_credentials_intelligence_version " ></a > Credentials Intelligence Version
1190+
11851191Sets Credentials Intelligence protocol version
11861192
11871193** Default:** 'v1'
@@ -1191,6 +1197,7 @@ _M.px_credentials_intelligence_version = 'v1'
11911197```
11921198
11931199### <a name =" px_additional_s2s_activity_header_enabled " ></a > Additional s2s Activity Header
1200+
11941201Enables attaching additional s2s activity header ('px-additional-activity'), instead of sending Additional s2s activity to PX Collector.
11951202
11961203** Default:** false
@@ -1200,6 +1207,7 @@ _M.px_additional_s2s_activity_header_enabled = false
12001207```
12011208
12021209### <a name =" px_send_raw_username_on_additional_s2s_activity " ></a > Send Raw Username On Additional s2s Activity
1210+
12031211Enables sending a raw username on additional s2s activity (only when activities are sent to PX Collector)
12041212
12051213** Default:** false
@@ -1209,6 +1217,7 @@ _M.px_send_raw_username_on_additional_s2s_activity = false
12091217```
12101218
12111219### <a name =" px_compromised_credentials_header_name " ></a > Compromised Credentials Header Name
1220+
12121221Compromised credentials header name
12131222
12141223** Default:** 'x-px-compromised-credentials'
@@ -1218,6 +1227,7 @@ _M.px_compromised_credentials_header_name = 'x-px-compromised-credentials'
12181227```
12191228
12201229### <a name =" px_login_successful_reporting_method " ></a > Login Successful Reporting Method
1230+
12211231Sets login successful reporting method, could be one of the following values: 'none', 'header', 'status', 'custom'
12221232
12231233** Default:** 'none'
@@ -1227,6 +1237,7 @@ Sets login successful reporting method, could be one of the following values: 'n
12271237```
12281238
12291239### <a name =" px_login_successful_header_name " ></a > Login Successful Header Name
1240+
12301241Sets login successful header name
12311242
12321243** Default:** 'x-px-login-successful'
@@ -1236,6 +1247,7 @@ _M.px_login_successful_header_name = "x-px-login-successful"
12361247```
12371248
12381249### <a name =" px_login_successful_header_value " ></a > Login Successful Header Value
1250+
12391251Sets login successful header value
12401252
12411253** Default:** '1'
@@ -1245,6 +1257,7 @@ _M.px_login_successful_header_value = "1"
12451257```
12461258
12471259### <a name =" px_login_successful_status " ></a > Login Successful Status
1260+
12481261Sets login successful status(-es)
12491262
12501263** Default:** { 200 }
@@ -1254,6 +1267,7 @@ _M.px_login_successful_status = { 200 }
12541267```
12551268
12561269### <a name =" custom_login_successful " ></a > Login Successful Custom Function
1270+
12571271Sets an user defined function which should return ` true ` if login was successful.
12581272
12591273** Default:** nil
@@ -1272,26 +1286,28 @@ _M.custom_login_successful = function()
12721286end
12731287```
12741288
1275-
12761289## <a name =" hypesale " ></a > HypeSale
1290+
12771291To enforcer will server the hypesale page in cases where the custom_param[ "is_hype_sale"] set to true.
12781292If the request contains a cookie ` _px3 ` with the ` cpa ` value so the hypesale will not be served but the enforcer will do risk_api to verify the request.
12791293
12801294### <a name =" hypesale_host " ></a > HypeSale host
1295+
12811296Sets HypeSale host
12821297
1283- ** Default:** 'https://captcha.px-cdn.net '
1298+ ** Default:** '< https://captcha.px-cdn.net > '
12841299
12851300```
12861301_M.hypesale_host = 'https://captcha.px-cdn.net'
12871302```
12881303
1289-
12901304## <a name =" graphql " ></a > Sensitive GraphQL Operations
1305+
12911306For those using GraphQL endpoints, it is possible to trigger server-to-server risk calls on particular operation types or names. Like the sensitive routes feature, a request that contains an operation of the configured type or name will trigger a server call to PerimeterX servers every time that operation is performed.
12921307Note: This feature only applies to requests that contain the string ` graphql ` somewhere in the path name.
12931308
12941309### <a name =" px_sensitive_graphql_operation_types " ></a > Sensitive GraphQL Operation Types
1310+
12951311Sets an operation type (e.g., query, mutation)
12961312
12971313** Default:** nil (none)
@@ -1301,6 +1317,7 @@ _M.px_sensitive_graphql_operation_types = {}
13011317```
13021318
13031319### <a name =" px_sensitive_graphql_operation_names " ></a > Sensitive GraphQL Operation Names
1320+
13041321Sets an operation name
13051322
13061323** Default:** nil (none)
@@ -1321,7 +1338,6 @@ Note: the list contains Lua Patterns, more here: [Understanding Lua Patterns](ht
13211338_M .px_graphql_routes = {" ^/graphql/?$" , " ^/graphql/csrf$" }
13221339```
13231340
1324-
13251341## <a name =" appendix " ></a > Appendix
13261342
13271343### <a name =" http2 " ></a > HTTP v2 Support
@@ -1413,9 +1429,9 @@ PerimeterX processes URI paths with general- and sub-delimiters according to RFC
14131429
14141430PerimeterX Nginx Lua Enforcer repository contains Dockerfile used to create a test docker image.
14151431In order to build an image, the following files must be present in the project's "example" directory:
1416- * examples/pxconfig.lua - Enforcer configuration (` px_appId ` , ` cookie_secret ` and ` auth_token ` parameters are required and must be set).
1417- * examples/nginx.conf - Nginx configuration
1418- * examples/creds.json - Credential Intelligence configuration (optional)
1432+ - examples/pxconfig.lua - Enforcer configuration (` px_appId ` , ` cookie_secret ` and ` auth_token ` parameters are required and must be set).
1433+ - examples/nginx.conf - Nginx configuration
1434+ - examples/creds.json - Credential Intelligence configuration (optional)
14191435
14201436When these files are present and adjusted, the following command could be executed from the project's root directory to run a test docker container: ` ./examples/run_docker.sh `
14211437Docker container will run and Nginx will listen on 8080 port.
@@ -1443,4 +1459,5 @@ The following steps are welcome when contributing to our project.
14431459 2 . Run the tests using the following command: make docker-test.
14441460
14451461- ### Pull Request
1462+
14461463 Once you have completed the process, create a pull request. Provide a complete and thorough description explaining the changes. Remember, the code has to be read by our maintainers, so keep it simple, smart and accurate.
0 commit comments