Skip to content

Commit 0cb7917

Browse files
authored
Merge pull request #343 from PerimeterX/release/v7.3.5
Release/v7.3.5
2 parents 4d7b187 + 80d170d commit 0cb7917

File tree

8 files changed

+257
-70
lines changed

8 files changed

+257
-70
lines changed

CHANGELOG.md

Lines changed: 171 additions & 22 deletions
Large diffs are not rendered by default.

README.md

Lines changed: 59 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# [PerimeterX](http://www.perimeterx.com) NGINX Lua Plugin
44

5-
> Latest stable version: [v7.3.4](https://luarocks.org/modules/bendpx/perimeterx-nginx-plugin/7.3.4-1)
5+
> Latest stable version: [v7.3.5](https://luarocks.org/modules/bendpx/perimeterx-nginx-plugin/7.3.5-1)
66
77
## [Introduction](#introduction)
88

@@ -61,45 +61,44 @@
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

163162
Recommended 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
197196
sudo apt-get -y install build-essential
@@ -401,7 +400,7 @@ luarocks install lua-cjson
401400
luarocks 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

569569
The 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)
754756
end
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+
786789
A 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+
797801
Allows you to define a function, which takes `uri` as an argument and returns `true` or `false`.
798802
Returning `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)
815819
end
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

11481152
This 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+
11541158
Enables 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+
11631168
Sets 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+
11851191
Sets 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+
11941201
Enables 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+
12031211
Enables 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+
12121221
Compromised 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+
12211231
Sets 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+
12301241
Sets 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+
12391251
Sets 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+
12481261
Sets 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+
12571271
Sets 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()
12721286
end
12731287
```
12741288

1275-
12761289
## <a name="hypesale"></a> HypeSale
1290+
12771291
To enforcer will server the hypesale page in cases where the custom_param["is_hype_sale"] set to true.
12781292
If 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+
12811296
Sets 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+
12911306
For 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.
12921307
Note: 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+
12951311
Sets 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+
13041321
Sets 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,10 @@ PerimeterX processes URI paths with general- and sub-delimiters according to RFC
14131429

14141430
PerimeterX Nginx Lua Enforcer repository contains Dockerfile used to create a test docker image.
14151431
In 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+
1433+
- examples/pxconfig.lua - Enforcer configuration (`px_appId`, `cookie_secret` and `auth_token` parameters are required and must be set).
1434+
- examples/nginx.conf - Nginx configuration
1435+
- examples/creds.json - Credential Intelligence configuration (optional)
14191436

14201437
When 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`
14211438
Docker container will run and Nginx will listen on 8080 port.
@@ -1443,4 +1460,5 @@ The following steps are welcome when contributing to our project.
14431460
2. Run the tests using the following command: make docker-test.
14441461

14451462
- ### Pull Request
1463+
14461464
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.

lib/px/pxconfig.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ _M.auth_token = 'PX_AUTH_TOKEN'
7979
-- _M.whitelist_ip_addresses = {}
8080
-- _M.whitelist_ua_full = {}
8181
-- _M.whitelist_ua_sub = {}
82+
-- _M.whitelist_hosts = {}
8283

8384
-- ## Login Credentials extraction
8485
--_M.px_enable_login_creds_extraction = false

lib/px/utils/config_builder.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ PX_DEFAULT_CONFIGURATIONS["whitelist_uri_suffixes"] = { {'.css', '.bmp', '.tif',
6262
PX_DEFAULT_CONFIGURATIONS["whitelist_ip_addresses"] = { {}, "table"}
6363
PX_DEFAULT_CONFIGURATIONS["whitelist_ua_full"] = { {}, "table"}
6464
PX_DEFAULT_CONFIGURATIONS["whitelist_ua_sub"] = { {}, "table"}
65+
PX_DEFAULT_CONFIGURATIONS["whitelist_hosts"] = { {}, "table"}
6566
PX_DEFAULT_CONFIGURATIONS["custom_cookie_header"] = { 'X-PX-COOKIES', "string"}
6667
PX_DEFAULT_CONFIGURATIONS["bypass_monitor_header"] = { nil, "string"}
6768
PX_DEFAULT_CONFIGURATIONS["postpone_page_requested"] = { false, "boolean"}

lib/px/utils/pxconstants.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
----------------------------------------------
44

55
local _M = {
6-
MODULE_VERSION = "NGINX Module v7.3.4",
6+
MODULE_VERSION = "NGINX Module v7.3.5",
77
RISK_PATH = "/api/v3/risk",
88
CAPTCHA_PATH = "/api/v2/risk/captcha",
99
ACTIVITIES_PATH = "/api/v1/collector/s2s",

0 commit comments

Comments
 (0)