Each Enforcer has a set of configuration options that control the Enforcer’s functionality and features. While some are required, many of these are optional configurations that you can use to customize the Enforcer’s behavior. You can reference available configurations with this article. The HUMAN Java Enforcer is configured with a PXConfiguration instance passed to the PerimeterX constructor (and related builder APIs).
While all Enforcers come with the same set of required configurations, the optional configurations available for each may differ. We recommend updating to the latest Enforcer version to ensure you have access to the latest features and configurations.
These configurations are necessary for the Enforcer’s basic functionality and features.
Your HUMAN Application ID in the form of PX12AB34CD. You can copy this value from the HUMAN Console in Platform Settings > Applications Overview. If you have multiple applications, make sure to copy the ID of the application you want the Enforcer on.
The application’s server token needed to authorize with HUMAN’s backend. You can copy this value from the HUMAN Console in Platform Settings > Applications Overview > Click the appropriate application > Server token tab.
The secret used to encrypt and decrypt the risk cookie sent from the HUMAN Sensor. You can copy this value from the HUMAN Console in Sightline Cyberfraud Defense > Traffic Policy Overview > Click the appropriate application > Click the key > Copy value.
If you need to rotate secrets, then adjust this configuration to be an array of strings (string[]) and include the new secret and old secret. The new secret value should be the first value in the array. This prevents decryption failures.
The total time in milliseconds that the Enforcer will wait for the Risk API request to return before timing out and passing the request.
The minimum risk score that the Enforcer will block. Ranges from 0 (lowest risk) to 100 (highest risk).
The severity at which the logger will output logs.
LoggerSeverity.NONE: The logger will not generate any logs.LoggerSeverity.ERROR: The logger will only generate logs on fatal errors.LoggerSeverity.DEBUG: The logger will generate detailed logs for debugging purposes. Not recommended for production environments.See px_logger_auth_token for a header-based alternative.
The Java Enforcer uses SLF4J and Logback for logging.
An array of header names that are trusted to contain the true client IP. Headers are traversed in the order they’re listed, and the first header value will always be used as the client IP.
If not set, will be taken from default.
Use with the CombinedIPProvider interface.
Whether the Enforcer module is enabled.
true: Enable the modulefalse: Disable the moduleThe Enforcer’s operation mode.
ModuleMode.MONITOR: The Enforcer performs all functions without returning block responses. Useful for analyzing and adjusting Enforcer behavior without serving block pages to end users. If you have routes that must have enforcement at all times, see Enforced routes.ModuleMode.BLOCKING: The Enforcer will return block responses as needed.These configurations aren’t required, but you can use them to further customize the Enforcer’s behavior.
In specific cases such as XHR post requests, a full CAPTCHA page render might not be an option. In such cases, the Advanced Blocking Response (ABR) returns a JSON object containing all the information needed to render a customized CAPTCHA challenge implementation such as a popup modal, a section on the page, etc. This provides more flexibility and customizability in displaying the CAPTCHA challenge.
Activates the full blocking flow to verify the flow works as expected if a particular header is present on the request. Often used during monitor mode, where the Enforcer collects data without blocking user requests, before switching to ModuleMode.BLOCKING.
These configurations are specific to Credentials Intelligence-related features in Sightline Cyberfraud Defense.
Whether to enable the extraction and reporting of credentials from the Enforcer for Credential Intelligence.
true: Enable Credential Intelligencefalse: Disable Credential IntelligenceAn array of configuration objects for each credential endpoint. Each element in the array is an object representing a distinct endpoint to which credentials are sent and includes:
Determines the structure and content of the user login data.
The header name to be set on the incoming request if the credentials are compromised. If this header is added, its value will always be 1. If credentials have not been identified as compromised, the header will not be added to the request.
Whether to attach the additional_s2s payload and URL as headers to the original request. This is done so that the additional_s2s activity can be enriched with the proper login_successful value and sent to the provided URL at a later stage. This disables automatically sending additional_s2s activities.
When set to true, the following headers are added to the origin request:
px-additional-activity: A JSON object containing the payload of the additional_s2s activity. The login_successful and http_status_code fields should be set prior to sending the activity.px-additional-activity header example
px-additional-activity-url: The URL to which the additional_s2s payload should be sent as an HTTP POST request.Whether to report the raw username on the additional_s2s activity.
false: The raw username will never be reported.true: The raw username will only be reported if:
Method name that determines how to validate if the login was successful. There are several ways to report the success or failure of the login attempt. If left empty, the login success status is always reported as false.
Provide a status or array of statuses that represent a successful login. If a response’s status code matches the provided value or one of the values in the provided array, the login success status is set to true. Otherwise, it is set to false.
To define a range of statuses, use the CUSTOM reporting method.
Default values:
px_login_successful_status: 200Provide a header name and value. If the header exists on the response and matches the provided value, the login success status is set to true. If the header is not found on the response, or if the header value does not match the value in the configuration, the login success status is set to false.
Default values:
headerNameToValidateLoginResponse: x-px-login-successfulheaderValueToValidateLoginResponse: 1Provide a string or regular expression with which to parse the response body. If a match is found, the login success status is set to true. If no match is found, the login success status is set to false.
Default values:
regexPatternToValidateLoginResponseBody: EmptyProvide a custom class that implements the LoginResponseValidator interface and overrides isSuccessfulLogin, which receives a ResponseWrapper and returns a boolean.
Default values:
customLoginResponseValidator: emptyRegex pattern that checks the response body in order to validate successful login.
Header name used to validate whether the login is successful.
Header value used to validate whether the login is successful.
Array of status codes used to validate whether the login was successful.
By default, the Enforcer extracts HUMAN cookies from the Cookie header. However, if these cookies are transferred on a different header, then that header’s name must be provided with this configuration.
Enriches activities sent from the Enforcer to HUMAN with additional custom parameters. This data can include user information, session IDs, or other data that HUMAN should have access to. These custom parameters are defined by a configurable function that must return an object that contains these custom parameters. There is a limit of 10 custom parameters.
The request body can only be read once! If you plan on reading the request body in this function, we recommend you using a request wrapper that caches the body before calling pxVerify
Parameters:
config: HumanSecurityConfigurationrequest: HttpServletRequestReturns: Promise<CustomParameters>
Whether to use the proxyHost for message forwarding.
If your architecture requires the use of a proxy server to access outside services, you can designate a proxy URL or IP port to use. This will use HTTP tunneling and direct all outgoing HUMAN traffic to the defined proxy address.
If using HTTPS, ensure that the proxy’s certificate is installed on the machine running the Enforcer.
Required if useProxy is true.
The proxy’s port. Required if useProxy is true.
Whether to decode or decrypt a cookie.
Sets the number of activities to send in batched activities.
Filters out requests with the specified file extension. By default, HUMAN doesn’t enforce static assets such as images and documents to minimize unncessary API calls and computation, but you can configure this list at any time.
Filtering by extension only applies to GET and HEAD HTTP methods.
These configurations let you add headers to incoming requests with additional data.
Adds a header to the incoming request with the configured header name and the JSON-stringified data enrichment object as the value. If empty or if data enrichment has not been enabled for your policy, no header will be set. To view available data and enable this feature, see Data classification enrichment.
These configurations let you customize the HUMAN Challenge block page as well as the hard block page, which appears when a request is blocked without a Challenge. Hard block pages inherit the same styling as the HUMAN Challenge according to the following configurations and cannot be customized separately.
A way to include a custom CSS file to the block page.
Maps to {{cssRef}} in the block page template.
A way to include custom JavaScript to the block page. This script will run after the default JavaScript scripts.
Maps to {{jsRef}} in the block page template.
Adds a custom logo to the HUMAN Challenge block page via URL.
Maps to {{customLogo}} in the block page template.
These configurations let you define specific routes that should be enforced by HUMAN when the Enforcer is in monitor mode. These routes will always be subject to the full Enforcer workflow, including blocking requests if necessary.
An array of routes or prefixes that should be enforced by HUMAN even when the Enforcer is in monitor mode.
A list of endpoints to be monitored rather than blocked by the Enforcer, even when the Enforcer is in ModuleMode.BLOCKING mode.
TCP connection timeout to HUMAN servers, in milliseconds.
The maximum connections per route for Risk API requests in the connections pool.
The total maximum connections for Risk API client.
Toggle sending asynchronous page activities.
Set the base url for HUMAN servers
The PX Hashed Data (PXHD) cookie links the first risk request with the browser activities as detected by the Sensor for better user tracking. It can also add more information that’s shared between the HUMAN Collector, Enforcer, and Sensor. This configuration determines whether the Secure cookie attribute is added when setting the PXHD cookie.
See Use of cookies & web storage for more information.
Remote Configuration lets you update your Enforcer’s configuration from the HUMAN portal rather than interacting with the Enforcer package directly.
An alternative to the basic logger configuration. This sends Enforcer logs to HUMAN’s logging service if a specific header is present on the request. This is particularly useful for expedited debugging, diagnosis, and resolution of any integration or Enforcer-related issues.
Contact HUMAN to recieve your token.
The interval time in milliseconds to wait between attempts to fetch the Remote Configuration.
The amount of time to delay the remote configuration thread before it starts
Set the URL for HUMAN configuration service
Interval in seconds of cleaning requests queue. Solves HttpComponent reference leak bug.
Specifies certain headers that should not be forwarded to any other destination, including the HUMAN Detector. While HUMAN’s detection system will continue to use these headers to determine whether to block or not, the specified headers won’t be forwarded from the Enforcer, won’t appear in Enforcer activities, and won’t be sent to any other IP if the Enforcer acts as a proxy.
A list of prefixes for all routes that should be considered sensitive.
Regex strings for routes that should be considered sensitive.
This configuration is meant for cases that require more complex logic. We recommended you use sensitiveRoutes for most cases.
A custom function that lets you define which requests should be considered sensitive based on custom logic. It accepts the incoming request as an argument and returns a boolean indicating whether the request should be considered sensitive.
Parameters:
request: functionReturns: A boolean or a Promise resolving to a boolean.
Runs the Enforcer in a development environment for testing purposes. The response returns as a JSON object. When you run the Enforcer in testing mode, do not set a custom verification handler
These configurations are related to Accounts and Account Takeover or Fake Account features in Sightline Cyberfraud Defense.
The name of the cookie that contains the JWT token that HUMAN should extract user identifiers from.
The field name in the JWT object, extracted from the JWT cookie, that contains the user ID to be extracted and reported.
The field names in the JWT object, extracted from the JWT cookie, that should be extracted and reported in addition to the user ID.
The name of the header that contains the JWT token that HUMAN should extract user identifiers from.
The field name in the JWT object, extracted from the JWT header, that contains the user ID to be extracted and reported.
The field names in the JWT object, extracted from the JWT header, that should be extracted and reported in addition to the user ID.
You can use the following interfaces to tune the Java Enforcer to your specific needs. Interfaces should be set after you initialize the PerimeterX instance.
Handler for all asynchronous activities from type enforcer_telemetry, page_requested, and block.
setActivityHandlerBlocking handle will be called when pxVerify will return that user is not verified.
blockHandlerHandles IP address extraction from request.
setIpProviderHandles hostname extraction from request.
setHostnameProviderHandling verification after HUMAN service finished analyzing the request.
setVerificationHandlerAdds to all activities additional custom parameters.
customParametersProviderValidate if the Login response was successful.
isSuccessfulLoginExtract credentials from login request.
extractCredentials