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协议(含转码工具) 最近因为项目关系,收朋友之托,想制作秀场网站,但是因为之前一直没有涉及到这 ...
随机推荐
- linux查看CPU性能及工作状态的指令mpstat,vmstat,iostat,sar,top
转载:http://www.cnblogs.com/xianghang123/archive/2011/08/25/2153591.html 衡量CPU性能的指标: 1,用户使用CPU的情况:CPU运 ...
- ganglia组播和单播
ganglia快速开始向导(翻译自官方wiki) 发布于 2012 年 1 月 23 日 由 admin 2 comments发表评论 转自:http://cryinstall.com/?p=18 ...
- SELECT语句逻辑运行顺序,你知道吗?
引言 这不是一个什么多深的技术问题.多么牛叉的编程能力.这跟一个人的开发能力也没有很必定的直接关系,可是知道这些会对你的SQL编写,排忧及优化上会有很大的帮助.它不是一个复杂的知识点.可是一个很基础的 ...
- Nginx搭建flv mp4流媒体服务器[转]
Nginx搭建flv mp4流媒体服务器 作者:二蛋 时间:December 1, 2014 分类:Note 环境:Centos 6.4 32bit 一.安装依赖包 1.安装zlib wget htt ...
- postgres时间转换函数
函数 返回类型 描述 例子 to_char(timestamp, text) text 把时间戳转换成字串 to_char(current_timestamp, 'HH12:MI:SS') to_ch ...
- 模拟登陆百度 python
from time import sleep from selenium import webdriver driver = webdriver.Firefox() driver.get('http: ...
- OFBiz实战(1):整合Groovy+FreeMaker
这是OFBiz实战系列的第一篇文件,该系列的目的是整合Groovy+FreeMaker开发一个图书管理系统,阐述在此过程中碰到的一系列问题,以及如何解决这些问题.第一篇文章说明如何使用Groovy+F ...
- 文件流(fstream, ifstream, ofstream)的打开关闭、流状态
一.文件流 ofstream,由ostream派生而来,用于写文件 ifstream,由istream派生而来, 用于读文件 fstream,由iostream派生而来,用于读写文件 二.打开文件 说 ...
- DevExpress实现GridControl删除所有行的方法
/// <summary> /// 删除全部行 /// </summary> /// <param name="gridView">GridVi ...
- OSI各层的功能和主要协议(转载)
OSI各层的功能和主要协议: 物理层 物理层规定了激活.维持.关闭通信端点之间的机械特性.电气特性.功能特性以及过程特性.该层为上层协议提供了一个传输数据的物理媒体. 在这一层,数据的单位称为比特(b ...