开源软件名称(OpenSource Name):PerimeterX/perimeterx-nginx-plugin开源软件地址(OpenSource Url):https://github.com/PerimeterX/perimeterx-nginx-plugin开源编程语言(OpenSource Language):Lua 61.9%开源软件介绍(OpenSource Introduction):PerimeterX NGINX Lua Plugin
IntroductionUpgradingInstallation
Configuration
EnrichmentAdvanced Blocking ResponseLogin Credentials Extraction
HypeSaleSensitive GraphQL OperationsAppendix
Test EnvironmentContributingIntroductionThe PerimeterX Nginx Lua Plugin is a Lua module that enforces whether or not a request is allowed to continue being processed. When the PerimeterX Enforcer determines that a request is coming from a non-human source the request is blocked. UpgradingSee the full changelog for all versions. From any Version Lower than 4.xAs of version 4.x the config builder was added. The config builder adds default values to properties that are not implicitly specified. This change requires the user to import the configuration in the
init_worker_by_lua_block {
local pxconfig = require("px.pxconfig")
require ("px.utils.pxtimer").application(pxconfig)
}
access_by_lua_block {
local config = require('px.pxconfig')
require("px.pxnginx").application(config)
}
header_filter_by_lua_block {
require("px.pxnginx").finalize()
} From any Version above 4.xTo upgrade to the latest Enforcer version, re-install the Enforcer according to your OS. InstallationSupported Operating Systems
Supported NGINX Versions:Recommended that you use the newest version of NGINX from the Official NGINX repo.
Installing with UbuntuUbuntu 14.041. Upgrade and update your existing dependencies for Ubuntu 16.04 or highersudo apt-get update
sudo apt-get upgrade 2. Add the official NGINX repository to get the latest version of NGINXsudo add-apt-repository ppa:nginx/stable If an
3. Install the dependencies for Ubuntu 14.04:sudo apt-get -y install build-essential
sudo apt-get -y install ca-certificates
sudo apt-get -y install make
sudo apt-get -y install wget
sudo apt-get -y install nginx
sudo apt-get -y install m4
sudo apt-get -y install libnginx-mod-http-lua
sudo apt-get -y install lua-cjson 4. Download and install LuaRocks from sourcewget http://luarocks.github.io/luarocks/releases/luarocks-2.4.4.tar.gz
tar -xzf luarocks-2.4.4.tar.gz
cd luarocks-2.4.4
./configure
sudo make clean && sudo make build && sudo make install
cd ~ 5. Download and install Nettle 3.3 from sourcewget https://ftp.gnu.org/gnu/nettle/nettle-3.3.tar.gz
tar -xzf nettle-3.3.tar.gz
cd nettle-3.3
./configure
sudo make clean && sudo make install
cd ~ 6. Install the remaining dependenciessudo apt-get -y install lua-sec
sudo luarocks install lua-resty-nettle
7. Install the PerimeterX NGINX Pluginsudo no_proxy=1 luarocks install perimeterx-nginx-plugin Ubuntu 16.04 and Higher1. Update your existing dependencies for Ubuntu 16.04 or highersudo apt-get update 2. Add the official NGINX repository to get the latest version of NGINXsudo add-apt-repository ppa:nginx/stable If an
3. Update and upgrade your existing dependencies for Ubuntu 16.04 or highersudo apt-get update
sudo apt-get upgrade 4. Install the dependencies for Ubuntu 16.04 or highersudo apt-get -y install build-essential
sudo apt-get -y install ca-certificates
sudo apt-get -y install nginx
sudo apt-get -y install libnginx-mod-http-lua
sudo apt-get -y install lua-cjson
sudo apt-get -y install libnettle6
sudo apt-get -y install nettle-dev
sudo apt-get -y install luarocks
sudo apt-get -y install luajit
sudo apt-get -y install libluajit-5.1-dev 5. Install the PerimeterX NGINX Pluginluarocks install perimeterx-nginx-plugin Installing with CentOS 7NGINX does not provide an NGINX http lua module for CentOS/RHEL via an RPM. This means that you need to compile the Module from source. 1. Update and Install dependenciesyum -y update
yum install -y epel-release
yum update -y
yum groupinstall -y "Development Tools"
yum install -y wget rpmdevtools git luajit luajit-devel openssl-devel zlib-devel pcre-devel gcc gcc-c++ make perl-ExtUtils-Embed lua-json lua-devel ca-certificates
yum remove -y nettle luarocks 2. Make a tmp directory to work insudo mkdir /tmp/nginx
cd /tmp/nginx 3. Download all required source fileswget http://luarocks.github.io/luarocks/releases/luarocks-3.5.0.tar.gz
wget http://nginx.org/download/nginx-1.18.0.tar.gz
wget -O luajit-2.0.tar.gz https://github.com/LuaJIT/LuaJIT/archive/refs/tags/v2.0.5.tar.gz
wget -O nginx_devel_kit.tar.gz https://github.com/simpl/ngx_devel_kit/archive/v0.3.1.tar.gz
wget -O nginx_lua_module.tar.gz https://github.com/openresty/lua-nginx-module/archive/v0.10.15.tar.gz
wget https://ftp.gnu.org/gnu/nettle/nettle-3.6.tar.gz 4. Unpackage all source filestar -xzf luarocks-3.5.0.tar.gz
tar -xzf nettle-3.6.tar.gz
tar -xvf luajit-2.0.tar.gz
tar -xvf nginx-1.18.0.tar.gz
tar -xvf nginx_devel_kit.tar.gz
tar -xvf nginx_lua_module.tar.gz 5. Install luarocks from sourcecd /tmp/nginx/luarocks-3.5.0
./configure
make
make install 6. Install Nettle from sourcecd /tmp/nginx/nettle-3.6
./configure --prefix=/usr --disable-static
make
make check
make install 7. Install LuaJIT
8. Build and Install NGINX with required Modulescd /tmp/nginx/nginx-1.18.0
LUAJIT_LIB=/usr/local/lib LUAJIT_INC=/usr/local/include/luajit-2.0 \
./configure \
--user=nginx \
--group=nginx \
--prefix=/etc/nginx \
--sbin-path=/usr/sbin/nginx \
--conf-path=/etc/nginx/nginx.conf \
--pid-path=/var/run/nginx.pid \
--lock-path=/var/run/nginx.lock \
--error-log-path=/var/log/nginx/error.log \
--http-log-path=/var/log/nginx/access.log \
--with-http_gzip_static_module \
--with-http_stub_status_module \
--with-debug \
--with-http_ssl_module \
--with-pcre \
--with-http_perl_module \
--with-file-aio \
--with-http_realip_module \
--add-module=/tmp/nginx/ngx_devel_kit-0.3.1 \
--add-module=/tmp/nginx/lua-nginx-module-0.10.15
make install 9. Install PerimeterX Nginx Plugin & Dependenciesluarocks install luasec
luarocks install lustache
luarocks install lua-resty-core
luarocks install lua-resty-nettle
luarocks install luasocket
luarocks install lua-resty-http
luarocks install lua-cjson
luarocks install perimeterx-nginx-plugin 10. Optionally, if you are testing in a new environment you may need to configure the following:
Installing the PerimeterX NGINX Plugin for NGINX+If you are already using NGINX+, the following steps cover installing the NGINX+ Lua Module and the PermimeterX NGINX Plugin. ConfigurationRequired NGINX ConfigurationThe following NGINX Configurations are required to support the PerimeterX NGINX Lua Plugin:
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论