modSecurity和Naxsi哪个更适合Nginx搭建WAF
nginx增加modsecurity模块
modsecurity原本是Apache上的一款开源waf,可以有效的增强web安全性,目前已经支持nginx和IIS,配合nginx的灵活和高效,可以打造成生产级的WAF,是保护和审核web安全的利器。
|
1
2
3
4
5
6
7
8
9
10
11
|
git clone https://github.com/SpiderLabs/ModSecurity.gitcd ModSecurity/./autogen.sh./configure--enable-standalone-module --disable-mlogcmakecd tengine/./configure--prefix=/usr/local/nginx --conf-path=/etc/nginx/nginx.conf--pid-path=/var/run/nginx/nginx.pid --error-log-path=/var/log/nginx/nginx.log--http-log-path=/var/log/nginx/nginx-http.log--add-module=/root/ngx_devel_kit-0.2.19/--add-module=/root/lua-nginx-module-0.9.13/--add-module=/root/ModSecurity/nginx/modsecurity/ --with-ld-opt="-Wl,-rpath,$LUAJIT_LIB"make |

modsecurity倾向于过滤和阻止web危险,之所以强大就在于规则,OWASP提供的规则是于社区志愿者维护的,被称为核心规则CRS(corerules),规则可靠强大,当然也可以自定义规则来满足各种需求。
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
git clone https://github.com/SpiderLabs/owasp-modsecurity-crscp -R owasp-modsecurity-crs /etc/nginx/cp /etc/nginx/owasp-modsecurity-crs/modsecurity_crs_10_setup.conf.example /etc/nginx/owasp-modsecurity-crs/modsecurity_crs_10_setup.confcd ModSecurity/cp modsecurity.conf-recommended /etc/nginx/modsecurity.confcp unicode.mapping /etc/nginxvim modsecurity.confSecRuleEngine onnclude owasp-modsecurity-crs/modsecurity_crs_10_setup.confIncludeowasp-modsecurity-crs/base_rules/modsecurity_crs_41_sql_injection_attacks.confInclude owasp-modsecurity-crs/base_rules/modsecurity_crs_41_xss_attacks.confIncludeowasp-modsecurity-crs/base_rules/modsecurity_crs_40_generic_attacks.confIncludeowasp-modsecurity-crs/experimental_rules/modsecurity_crs_11_dos_protection.confInclude owasp-modsecurity-crs/experimental_rules/modsecurity_crs_11_brute_force.confIncludeowasp-modsecurity-crs/optional_rules/modsecurity_crs_16_session_hijacking.conf |
在需要启用modsecurity的主机的location下面加入下面两行即可:
|
1
2
|
ModSecurityEnabled on; ModSecurityConfig modsecurity.conf; |


参考文章
http://www.52os.net/articles/nginx-use-modsecurity-module-as-waf.html
https://github.com/SpiderLabs/ModSecurity/wiki/Reference-Manual#Installation_for_NGINX
http://drops.wooyun.org/tips/2614
http://drops.wooyun.org/tips/3804
http://drops.wooyun.org/tips/734
http://www.freebuf.com/articles/web/18084.html
http://www.freebuf.com/articles/web/16806.html
#使用有两个WEB安全服务器
modSecurity和Naxsi哪个更适合Nginx搭建WAF
modSecurity和Naxsi哪个更适合Nginx搭建WAF的更多相关文章
- 用Nginx搭建CDN服务器方法-开启Nginx缓存与镜像,自建图片服务器
利用Nginx的proxy_cache搭建缓存服务器一:编译ngx_cache_purge1.Nginx的Proxy_cache是根据Key值md5哈希存储缓存,支持任意的Key,例如你可以根据”域名 ...
- 14.Nginx搭建及优化
Nginx搭建及优化 目录 Nginx搭建及优化 Nginx服务基础 概述 Nginx和Apache的优缺点比较 编译安装Nginx服务 添加Nginx系统服务 Nginx服务配置文件 nginx服务 ...
- Nginx搭建反向代理服务器
[大型网站技术实践]初级篇:借助Nginx搭建反向代理服务器 一.反向代理:Web服务器的“经纪人” 1.1 反向代理初印象 反向代理(Reverse Proxy)方式是指以代理服务器来接受int ...
- 搭建rtmp直播流服务之1:使用nginx搭建rtmp直播流服务器(nginx-rtmp模块的安装以及rtmp直播流配置)
欢迎大家积极开心的加入讨论群 群号:371249677 (点击这里进群) 一.方案简要 首先通过对开发方案的仔细研究(实时监控.流媒体.直播流方案的数据源-->协议转换-->服务器--&g ...
- Linux+.NetCore+Nginx搭建集群
本篇和大家分享的是Linux+NetCore+Nginx搭建负载集群,对于netcore2.0发布后,我一直在看官网的文档并学习,关注有哪些新增的东西,我,一个从1.0到2.0的跟随者这里只总结一句话 ...
- 基于nginx搭建简易的基于wcf集群的复杂均衡
很多情况下基于wcf的复杂均衡都首选zookeeper,这样可以拥有更好的控制粒度,但zk对C# 不大友好,实现起来相对来说比较麻烦,实际情况下,如果 你的负载机制粒度很粗糙的话,优先使用nginx就 ...
- Nginx 搭建图片服务器
Nginx 搭建图片服务器 本章内容通过Nginx 和 FTP 搭建图片服务器.在学习本章内容前,请确保您的Linux 系统已经安装了Nginx和Vsftpd. Nginx 安装:http://www ...
- 十大豪门推送sdk,哪个更适合你
转自:http://jingyan.baidu.com/article/d621e8da0fd7042865913ff5.html 推送,使得开发者可以即时地向其应用程序的用户推送通知或者消息,与用户 ...
- Ubuntu 14.10下基于Nginx搭建mp4/flv流媒体服务器(可随意拖动)并支持RTMP/HLS协议(含转码工具)
Ubuntu 14.10下基于Nginx搭建mp4/flv流媒体服务器(可随意拖动)并支持RTMP/HLS协议(含转码工具) 最近因为项目关系,收朋友之托,想制作秀场网站,但是因为之前一直没有涉及到这 ...
随机推荐
- springMVC之增删改查
一.核心原理 1. 用于发送请求给server: /home.htm 2. 请求被DispatchServlet拦截到 3. DispatchServlet通过HandleMapping检查url有没 ...
- Android MVP 构架初试
目前讨论MVP MVVM 的架构也来越多,这种构架也很适合Android.研究MVP记录如下 源码地址RxMVP分支Tag02 原有的MVC构架 刚开始接触Android的时候会觉得Android的整 ...
- 使用Bootstrap3和Ladda UI实现的多种按钮“加载中”效果体验
在线演示 在线演示 大家在开发基于web的网站或者web应用中,常常在AJAX调用的过程中需要提示用户并且展示相关的“加载中”效果,类似的UI设计也非常多,比如,当点击一个按钮后,在它的旁边显示一个 ...
- Objective-C中3种枚举比较及KVC两个小技巧
Objective-C中3种枚举比较及KVO两个小技巧 一:oc的3种枚举 for循环 for in 枚举块 如代码 NSUInteger totalCount = 10000; NSMutableA ...
- 从chrome商店直接下载crx文件
从chrome商店直接下载crx文件 CreateTime--2018年5月21日17点18分 Author:Marydon 1.前提 需要知道你所下载的插件的id 查看方法: 第一步:打开扩展程 ...
- ADBport被占用,adb server is out of date
wd=adb&tn=44039180_cpr&fenlei=mv6quAkxTZn0IZRqIHckPjm4nH00T1YdPWD1uyP-PHf1ryRYP1Nh0ZwV5Hcvrj ...
- easyui form表单提交标准格式
$("#temForm").form('submit', { url: '', queryParams: {}, cache: false, type: 'POST', dataT ...
- 【php写日志】php将日志写入文件
php 写内容到文件,把日志写到log文件 <?php header("Content-type: text/html; charset=utf-8"); /******** ...
- 【转帖】如何利用Spring Cloud构建起自我修复型分布式系统
http://zhidao.baidu.com/link?url=tSKwdn3wr8KUxWMteHmneFtY0KoNZBMK9Xy-RimsdISA4h2neAecgHqggBipz2w6nXr ...
- QQ在通信与传输的一些知识
http://www.nowamagic.net/librarys/veda/detail/2028 一.登录 不管UDP还是TCP,最终登陆成功之后,QQ都会有一个TCP连接来保持在线状态.这个TC ...