This page covers advanced customization options that require modifying the iRule code or configuring conditional module behavior.
This configuration enables the module only when a specific header is present and its value is set to True. This is useful for gradually rolling out the enforcer or enabling it only for specific traffic.
If enable_module_header_name configuration is empty, then the enable_module configuration will determine if the module is enabled or not.
Set the header name in the pxconfig data group:
When configured, the HUMAN module will only process requests that include the header X-PX-ENABLE-MODULE: True.
The px_add_custom_parameters function in the iRule allows you to add up to 10 custom parameters to be sent to HUMAN servers on risk_api calls. When configured, the function is called before setting the payload on every risk_api request to HUMAN servers.
This customization requires editing the px.tcl iRule code directly.
Locate the px_add_custom_parameters procedure in the px.tcl iRule and add your custom logic:
The parameters should be passed in the correct order matching your HUMAN Console configuration:
userid is set to custom-param1 in the HUMAN Console, it should always be sent as x-px-custom-param1x-px-custom-param<number> where number is 1-10The header key is validated before being sent to ensure the correct pattern is used.
The px_extract_ip procedure in the iRule can be customized to extract the client IP address from custom headers or apply custom logic.
This customization requires editing the px.tcl iRule code directly.
By default, the enforcer uses the ip_header configuration to determine which header contains the real client IP. If ip_header is not set, the socket IP is used.
If you need more complex IP extraction logic (e.g., parsing X-Forwarded-For with multiple IPs), you can modify the px_extract_ip procedure:
HUMAN processes URI paths with general- and sub-delimiters according to RFC 3986:
?, #) are used to separate parts of the URI$, &) are not used to split the URI as they are considered valid characters in the URI pathThis ensures that URIs with special characters in the path are processed correctly.