ASP.NET configuration options
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. Set ASP.NET Enforcer configurations as XML attributes in the pxModuleConfigurationSection element of your application
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.
Comma-delimited list attributes such as sensitiveRoutes or ipWhitelist map to .NET StringCollection values. Custom logic options use a class name string: implement the corresponding HUMAN interface, put your logic in that class’s Handle method, and set the configuration attribute to the class name so the Enforcer can load it.
Quick reference
Basic functionality
Basic features
Optional
Required configurations
These configurations are necessary for the Enforcer’s basic functionality and features.
Basic functionality configurations
appId
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.
apiToken
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.
cookieKey
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.
baseUri
Do not set this value unless directed by your HUMAN Solutions Engineer.
The base URL for the HUMAN SAPI (Risk API and related calls). If empty, the Enforcer uses the default host for your Application ID.
The default value uses {0} as a placeholder for your application ID. Change this only after discussing the change with HUMAN Support.
apiTimeout
The total time in milliseconds that the Enforcer will wait for the Risk API request to return before timing out and passing the request.
blockingScore
The minimum risk score that the Enforcer will block. Ranges from 0 (lowest risk) to 100 (highest risk).
Basic feature configurations
socketIpHeader
Header name that contains the real client IP. If unset, the Enforcer uses the request’s UserHostAddress.
Configure this when a load balancer or proxy sits in front of your application so HUMAN receives the true client IP for detection.
enabled
Whether the Enforcer module is enabled.
true: Enable the modulefalse: Disable the module
monitorMode
When true, 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.
When false, the Enforcer returns block responses as needed.
Optional configurations
These configurations aren’t required, but you can use them to further customize the Enforcer’s behavior.
Bypass monitor header
bypassMonitorHeader
Activates the full blocking flow to verify the flow works as expected if the specified header is present on the request with a value of 1. Often used to test the Enforcer block workflow during monitor mode, where the Enforcer usually collects data without blocking user requests, before switching to false. Requests with this header will go through the entire blocking workflow despite being in monitor mode.
To disable blocking behavior on the specified header, set the value to 0.
Credentials Intelligence
These configurations let you extract and detect compromised credentials. They’re closely related to Credentials Intelligence-related features in Sightline Cyberfraud Defense.
At minimum, ensure the following are configured to enable Credential Intelligence:
loginCredentialsExtractionEnabledis set totrueloginCredentialsExtractionis configured with at least one credential endpoint
loginCredentialsExtractionEnabled
Whether to enable the extraction and reporting of credentials from the Enforcer for Credential Intelligence.
true: Enable Credential Intelligencefalse: Disable Credential Intelligence
loginCredentialsExtraction
JSON array of credential extraction definitions, set as an XML attribute string. Each object configures one login endpoint.
When sent_through is custom, configure customCredentialsExtractionHandler. All endpoints with sent_through: "custom" use that handler.
ciVersion
Credentials Intelligence protocol to use for extracted login data.
v2: Single-step loginmultistep_sso: Multi-step login
compromisedCredentialsHeader
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.
additionalS2SActivityHeaderEnabled
Whether to attach the additional_s2s payload and URL as headers on the original request so your origin can enrich and send the activity later. When true, the Enforcer does not send additional_s2s automatically.
When set to true, the following headers are added to the origin request:
px-additional-activity: A JSON object containing the payload of theadditional_s2sactivity. Set thelogin_successfulandhttp_status_codefields before sending the activity.
px-additional-activity header example
px-additional-activity header example
px-additional-activity-url: The URL to which theadditional_s2spayload should be sent as an HTTP POST request.
Send the POST with Content-Type: application/json and Authorization: Bearer <AUTH_TOKEN>.
To send additional_s2s automatically from the Enforcer instead, leave this set to false and configure loginSuccessfulReportingMethod. If the reporting method is left empty, login success is always reported as false.
sendRawUsernameOnAdditionalS2SActivity
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:- The credentials are compromised, and
- The login request was successful.
loginSuccessfulReportingMethod
Method used to decide whether a login succeeded when the Enforcer sends additional_s2s automatically. If left empty, login success is always reported as false.
status
Provide status codes that represent a successful login via loginSuccessfulStatus. If the response status matches one of those values, login success is true; otherwise it is false.
To define a status range, use the custom reporting method.
header
Configure loginSuccessfulHeaderName and loginSuccessfulHeaderValue. If the response includes that header with the matching value, login success is true.
body
Configure loginSuccessfulBodyRegex. If the response body matches the regex, login success is true.
custom
Configure customLoginSuccessfulHandler. The handler’s return value sets login_successful.
loginSuccessfulStatus
HTTP status codes treated as a successful login when loginSuccessfulReportingMethod is status.
loginSuccessfulBodyRegex
Regular expression matched against the response body when loginSuccessfulReportingMethod is body.
loginSuccessfulHeaderName
Response header name checked when loginSuccessfulReportingMethod is header.
loginSuccessfulHeaderValue
Expected response header value when loginSuccessfulReportingMethod is header.
customCredentialsExtractionHandler
Class name of an ICredentialsExtractionHandler implementation used when a credentials extraction endpoint sets sent_through to custom.
The Handle method receives an HttpRequest and should return an ExtractedCredentials object, or null if extraction fails.
customLoginSuccessfulHandler
Class name of an ILoginSuccessfulHandler implementation used when loginSuccessfulReportingMethod is custom.
The Handle method receives an HttpResponse and returns whether the login succeeded.
Custom block page
Use these options to serve a custom block experience instead of the default HUMAN Challenge block page. To customize HUMAN’s default page, see HUMAN Challenge customization.
customBlockUrl
URL of the custom block page HTML file. The Enforcer automatically allows this URI to avoid infinite redirects.
As of version 2.8.0, CAPTCHA logic is handled by the JavaScript snippet rather than the Enforcer. Custom block pages must include the required script tag and div for the challenge.
redirectOnCustomUrl
When true and customBlockUrl is set, blocked users receive a 307 Temporary Redirect to the custom block page, with query parameters such as:
The url parameter is the original path and query, URL-encoded and then Base64-encoded, so it does not collide with block-page query parameters.
When false, the Enforcer returns 403 on the blocked request URL and injects the block page content (or custom page content) without requiring those query parameters on your page.
Custom cookie header
customCookieHeader
When set, the Enforcer reads HUMAN cookies from this header in addition to (or instead of relying solely on) the standard Cookie header.
Custom parameters
These configurations are related to custom parameters.
customParametersHandler
Class name of an ICustomParametersHandler implementation. The Enforcer calls Handle before building the payload on requests to HUMAN servers. You can set up to 10 custom parameters (custom_param1 through custom_param10).
The Handle method receives an HttpRequest.
Custom user agent header
useragentOverride
Header name that contains the client user agent. If unset, the Enforcer uses the incoming request’s User-Agent header.
Custom verification handler
customVerificationHandler
Class name of an IVerificationHandler implementation. When set, the Enforcer calls this handler instead of the default verification behavior so you can customize handling based on the risk score and context.
The Handle method receives:
HttpApplication application: Current ASP.NET application. CallingCompleteRequestends the request pipeline after the current event.PxContext pxContext: HUMAN context with fields such asScore,UUID, andBlockAction. You can also read data enrichment frompxContextwhenpxContext.IsPxdeVerifiedistrue.PxModuleConfigurationSection pxConfig: Current Enforcer configuration.
Enforced routes
These configurations let you define specific routes that should be enforced under certain conditions.
mitigationUrls
Routes or prefixes that should be enforced by HUMAN even when the Enforcer is in monitor mode.
Matching routes go through the full Enforcer workflow, including blocking when necessary.
Compare paths to Request.Url.AbsolutePath with the leading / removed. For example, configure login to match /login. This is an exact match, not a prefix match.
enforceSpecificRoutes
When this list is non-empty, the Enforcer runs only on request paths that start with one of the configured prefixes. All other routes are skipped.
Filters
These configurations let you filter out certain requests or assets from the Enforcer. These values will be ignored by the Enforcer and will never be blocked.
fileExtWhitelist
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.
ipWhitelist
Filters out requests with the specified IP address to avoid unnecessary traffic in the Enforcer verification flow.
The request IP is resolved with the same logic as detection (socketIpHeader when configured, otherwise the request socket IP). IPv4 and IPv6 are supported.
routesWhitelist
Filters out requests with the specified route to avoid unnecessary traffic in the Enforcer verification flow. Requests to these specified routes will never be blocked regardless of their risk score and will never generate risk or async activities. Primitive string values are treated as path prefixes. For example, /login also matches /login/callback. That is, it uses exact prefix matching on the route via StartsWith().
Does not support regex and is case-sensitive.
useragentsWhitelist
Filters out requests with the specified user agent to avoid unnecessary traffic in the Enforcer verification flow. Primitive string values are case-sensitive and require an exact user-agent string.
First party
These configurations let you use the Enforcer as a proxy for HUMAN servers and serve content to the browser from a first party endpoint. These are particularly useful when browser or extension restrictions that block JavaScript requests to other domains, such as adblockers, prevent the HUMAN Sensor from making requests to HUMAN’s backend. When this happens, it significantly limits HUMAN’s detection capabilities, so we recommend enabling these configurations to maintain full detection capabilities.
First party is enabled by default. If firstPartyEnabled and firstPartyXhrEnabled are omitted from your pxModuleConfigurationSection, the Enforcer handles first-party requests.
When enabled, the Enforcer responds to first-party requests on routes derived from your Application ID without the PX prefix:
/<APP_ID_WITHOUT_PX>/init.js/<APP_ID_WITHOUT_PX>/xhr/*
For example, if the application ID is PX12345678, first-party routes take the form /12345678/*.
After enabling first party on the Enforcer, complete the steps in Integrate 1st-Party JS Snippet so your snippet serves the JavaScript Sensor via first party.
Both attributes must be set to false to disable first party.
firstPartyEnabled
Whether to enable first party mode for Bot Defender or Sightline Cyberfraud Defense.
firstPartyXhrEnabled
Whether first-party XHR activity reverse-proxy routes are enabled.
HUMAN Challenge customization
These configurations let you customize the HUMAN Challenge block page
cssRef
A way to include a custom CSS file to the block page.
jsRef
A way to include custom JavaScript to the block page. This script will run after the default JavaScript scripts.
customLogo
Adds a custom logo to the HUMAN Challenge block page via URL.
Monitored routes
These configurations let you specify routes that should be monitored by the Enforcer, which means their requests will never be blocked, even when monitorMode is false. This means that these routes will go through the full Enforcer workflow and generate risk and async activities, but all block activities will only be simulated blocks on these routes.
monitoredRoutes
Exact request paths treated as monitor mode even when the Enforcer is actively blocking elsewhere.
Compare paths to Request.Url.AbsolutePath with the leading / removed. For example, configure home to match /home. This is an exact match, not a prefix match.
Send activities
sendPageActivities
Whether to send asynchronous page_requested activities. Sending these activities does not block the request.
sendBlockActivities
Whether to send asynchronous block activities.
Sensitive headers removal
sensitiveHeaders
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.
Sensitive routes
These configurations let you specify certain routes that need particularly stringent protection from attacks, such as endpoints that execute payments or handle personal information. Sensitive routes will always trigger a Risk API call even if the request contains a valid, unexpired, low-score cookie.
Primitive string values are treated as path prefixes. For example, /login also matches /login/callback.
Requests with high-score cookies won’t send a Risk API call.
sensitiveRoutes
A list of prefixes for all routes that should be considered sensitive.