Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/added header based logger + addedrisk_start_time and enforcer_start_time fields to activities #171

Merged
merged 13 commits into from
Dec 21, 2023
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
10 changes: 10 additions & 0 deletions lib/pxenforcer.js
Original file line number Diff line number Diff line change
@@ -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();
}

});
});
}
3 changes: 2 additions & 1 deletion px_metadata.json
Original file line number Diff line number Diff line change
@@ -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",