In order to start HAProxy Enforcer installation, please collect the output of the following two commands and send to your Solution Architect or HUMAN Support:
Upon receiving this information, you will receive an archive with HAProxy Enforcer files, built for your system.
Notes:
haproxy -vv | grep USE_LUA.chroot directive. The chroot directive prevents HAProxy Enforcer from accessing remote servers.The following packages are required:
Linux distribution specific installation instructions:
apt-get update && apt-get install -y libcurl4 libapr1 libjansson4 libaprutil1 curl libpcre3 liblua5.4apk add apr-util apr jansson curl pcre lua5.4px_config.lua Enforcer configuration fileRequired parameters:
_M.px_appId / _M.auth_token: Application ID / AppId and Token / Auth Token can be found in the Portal, in the “Applications” section.
_M.cookie_secret: Cookie Encryption Key can be found in the portal, in the “Policies” section.
For other configuration parameteters please see HAProxy Module Configuration
From the archive received from HUMAN, extract and copy files:
px_haproxy.lua to /usr/local/lib/lua/ directory (create lua directory if it doesn’t exist)px_core.so file to /usr/local/lib/lua/ directorypx_config.lua to /usr/local/etc/ directoryglobal section:use_backend %[lua.px_handle_request] line to redirect incoming traffic to PX HAProxy modulerequest_pass. This backend handles traffic which is marked as “human requests”. Add http-response lua.px_handle_response line to append PX specific headers to outgoing responsesrequest_block with the context below. This backend handles traffic which is marked as “blocked”.By default, HAProxy prevents modules from creating new threads. However, PX HAProxy Enforcer spawns several threads while working.
The solution:
insecure-fork-wanted configuration to HAProxy global section. See HAProxy’s documentation for more information.