diff --git a/CHANGELOG.md b/CHANGELOG.md index 680c6b9..3ab4b77 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). +## [7.X.X] - 2023-XX-XX + +### Added + +- Support for header-based logger +- Added `sending_risk_timestamp` and `start_enforcer_timestamp` fields to enforcer activities. + ## [7.8.0] - 2023-05-16 ### Changed diff --git a/lib/pxenforcer.js b/lib/pxenforcer.js index dcc7d0a..7c9bb37 100644 --- a/lib/pxenforcer.js +++ b/lib/pxenforcer.js @@ -79,8 +79,14 @@ class PerimeterXEnforcer { function pxMiddleware(req, res, next) { parseCookies(req, res).then(() => { enforcer.enforce(req, res, (err, response) => { + let pxContext = null; + if (req.locals && req.locals.pxCtx) { + pxContext = req.locals.pxCtx; + } if (!err && response) { PerimeterXEnforcer.handleCallbackResponse(err, response, res); + + enforcer.sendHeaderBasedLogs(pxContext, enforcer.config.conf, req); } else { //pass saveResponseBody(res); @@ -95,8 +101,12 @@ class PerimeterXEnforcer { enforcer.handleAdditionalS2SActivity(pxCtx, res); } }); + + enforcer.sendHeaderBasedLogs(pxContext, enforcer.config.conf, req); + next(); } + }); }); } diff --git a/package.json b/package.json index 74eba84..c83c20c 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,7 @@ "dependencies": { "axios": "^0.21.1", "cookie-parser": "^1.4.1", - "perimeterx-node-core": "^3.11.0" + "perimeterx-node-core": "^3.12.0" }, "devDependencies": { "chai": "^4.3.6", diff --git a/px_metadata.json b/px_metadata.json index cf5bf4d..a465a8a 100644 --- a/px_metadata.json +++ b/px_metadata.json @@ -12,6 +12,7 @@ "bypass_monitor_header", "client_ip_extraction", "cors_support", + "credentials_intelligence", "csp_support", "css_ref", "cookie_v3", @@ -27,9 +28,9 @@ "filter_by_user_agent", "filter_by_extension", "first_party", + "header_based_logger", "js_ref", "logger", - "credentials_intelligence", "mobile_support", "module_enable", "module_mode", @@ -58,6 +59,14 @@ "test_page_requested_activity_cookie_origin", "test_block_page_hard_block_response", "test_risk_api_validate_cookie_origin", - "test_risk_cookie_valid_cookie_with_user_agent_bigger_than_max_length" + "test_block_activity_headers", + "test_page_requested_activity_headers", + "test_sensitive_headers_removed_from_page_requested", + "test_sensitive_headers_removed_from_block", + "test_risk_api_schema", + "test_block_activity_schema", + "test_page_requested_activity_schema", + "test_risk_cookie_valid_cookie_with_user_agent_bigger_than_max_length", + "test_risk_cookie_validate_client_uuid_in_risk_api" ] } \ No newline at end of file