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协议(含转码工具) 最近因为项目关系,收朋友之托,想制作秀场网站,但是因为之前一直没有涉及到这 ...
随机推荐
- (转)行为树(Behavior Tree)
转自:http://www.cnblogs.com/konlil/archive/2011/04/23/2025954.html 如果要让游戏里的角色或者NPC能执行预设的AI逻辑,最简单的用IF.. ...
- [Functional Programming] Write simple Semigroups type
An introduction to concatting items via the formal Semi-group interface. Semi-groups are simply a ty ...
- 更新后android studio 2.0 构建gradle卡在Refreshing Gradle Project 解决办法
首先打开android studio项目 找到项目目录gradle\wrapper\gradle-wrapper.properties这个文件 你会看到 #Wed Apr 10 15:27:10 PD ...
- RDLC 动态列
很久没有写博客了,关于动态列,国内很少资料有介绍动态列的,所想写点心得给哥们 啥是动态列呢?通常我们用存储过程时有列转行和行转列的做法,那么在RDLC 怎么支持呢?其实很简单,就是利用了RDLC的 C ...
- 在Flex (Flash)中嵌入HTML 代码或页面—Flex IFrame
在flex组件中嵌入html代码,可以利用flex iframe.这个在很多时候会用到的,有时候flex必须得这样做,如果你不这样做还真不行…… flex而且可以和html进行JavaScript交互 ...
- 黑苹果安装 this is an unknown cpu model 0x3a
一:安装说明 安装的是 mac os x 10.8.3 懒人版: ASUS b75ma 主板 i3 cpu 二:安装出现错误 百度谷歌,各种找原因,各路大神们都说是显卡的问题,因这电源管理只是一个警告 ...
- Linux下全局符号覆盖问题
在windows上,默认情况下,动态库中的符号都是对外隐藏的,除非你显示的指出要导出哪些符号,否则外界是看不到的.但是linux下情况刚好相反,对静态变量和全局变量,linux下so里面的符号对外可见 ...
- adb--monkey 压力测试工
android压力测试命令monkey详解 http://www.jb51.net/article/48557.htm 作者: 字体:[增加 减小] 类型:转载 这篇文章主要介绍了android mo ...
- 【Linux】centos和ubuntu下php5安装redis2.24扩展
1.服务器先安装redis-server,这是毋庸置疑的!!! 2.服务器开启redis-server,配置相关参数 3.配置好redis服务器后,再安装php的redis扩展phpredis. 一. ...
- 整理 pandas 常用函数
1. df.head(n): 显示数据前n行,不指定n,df.head则会显示所有的行 2. df.columns.values获取所有列索引的名称 3. df.column_name: 直接获取列c ...