waf

安装与使用

# 操作系统:centos7
# 解决依赖
yum install gcc.x86_64 gcc-c++.x86_64 openssl-devel.x86_64 pcre-devel.x86_64 -y

# 下载OpenResty
wget https://openresty.org/download/openresty-1.13.6.2.tar.gz

# 安装OpenResty
tar -xf openresty-1.13.6.2.tar.gz && cd openresty-1.13.6.2
./configure
gmake && gmake install

# 启动服务
/usr/local/openresty/nginx/sbin/nginx

# 停止服务
/usr/local/openresty/nginx/sbin/nginx -s quit

# 测试OpenResty
vim /usr/local/openresty/nginx/conf/nginx.conf
openresty-waf-1
openresty-waf-2

实现waf

配置waf

openresty-waf-3
openresty-waf-4

waf的说明

规则说明

waf规则文件目录:/usr/local/openresty/nginx/conf/waf/rule-config

规则文件说明:可以在相应的规则中添加对应的值

配置说明

根据配置可得,waf规则的优先级为:白名单--黑名单--规则检测(allow>deny)

参考资料

其它开源waf

最后更新于

这有帮助吗?