ModSecurity混合应用

        ModSecurity 是一种混合 WAF(Web Application Firewall) 引擎,其中某些工作依赖于主机 Web 服务器。

       ModSecurity 最初是为 Apache Web 服务器编写的,但此后已移植到 Nginx 和 IIS。尽管在Nginx和IIS都得到了积极维护,但它们都具有 ModSecurity 的传统以及与 Apache 源代码紧密集成。

        Apache 为 ModSecurity 所做的一切与所有其他模块所做的一样,具有如下的功能:

        1. 解密 SSL

        2. 将入站连接流分解为 HTTP 请求

        3. 部分解析 HTTP 请求

        4. 调用 ModSecurity,选择正确的配置上下文

        5. Dechunks 必要时请求机构

另外在Apache 反向代理场景中还有一些其他功能:

        1. 将请求转发到后端服务器(带有或不带有 SSL)

        2. 部分解析 HTTP 响应

        3. 必要时对响应主体进行分块

        优点:混合实现的优点是效率高。在进行 HTTP 解析时,工作量很少。

        缺点:无法始终获得对原始数据流的访问权,并且 Web 服务器有时无法像注重安全

性的工具那样处理数据。

        在 Apache使用的很多情况下,混合方法相当有效,但存在一些小问题,如下所示:

请求行和标头是 NUL 终止的

        通常这不是问题,因为 Apache 看不到的内容不会损害任何模块或应用程序。但是,在极少数情况下,NULL 字节规避的目的是隐藏某些东西,而这种 Apache行为有助于隐藏。

请求标头转换

        Apache 将规范化请求标头,将多个使用相同名称的标头组合在一起,并折叠跨越两行或更多行的标头。这种转换可能很难发现逃避的细微迹象,但实际上这还不是问题。

快速处理请求

        Apache 快速处理一些请求,使 ModSecurity 无法执行任何操作,但会在记录阶段注意 到它们 。尤其是无效的HTTP请求将被 Apache 拒 绝 , 而ModSecurity 没有发言权。

无法访问某些响应头

        由于 Apache 的工作方式,在嵌入式模式下,Server 和 Date 响应标头对于ModSecurity 是不可见的。无法对其进行检查或记录。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
ModSecurity Handbook is the definitive guide to ModSecurity, a popular open source web application firewall. Written by Ivan Ristic, who designed and wrote much of ModSecurity, this book will teach you everything you need to know to monitor the activity on your web sites and protect them from attack. Situated between your web sites and the world, web application firewalls provide an additional security layer, monitoring everything that comes in and everything that goes out. They enable you to perform many advanced activities, such as real-time application security monitoring, access control, virtual patching, HTTP traffic logging, continuous passive security assessment, and web application hardening. They can be very effective in preventing application security attacks, such as cross-site scripting, SQL injection, remote file inclusion, and others. Considering that most web sites today suffer from one problem or another, ModSecurity Handbook will help anyone who has a web site to run. The topics covered include: Installation and configuration of ModSecurity Logging of complete HTTP traffic Rule writing IP address, session, and user tracking Session management hardening Whitelisting, blacklisting, and IP reputation management Advanced blocking strategies Integration with other Apache modules Working with rule sets Virtual patching Performance considerations Content injection XML inspection Writing rules in Lua Extending ModSecurity in C The book is suitable for all reader levels: it contains step-by-step installation and configuration instructions for those just starting out, as well as detailed explanations of the internals and discussion of advanced techniques for seasoned users. A comprehensive reference manual is included in the second part of the book. Digital version of ModSecurity Handbook (PDF or EPUB) can be obtained directly from the author, at feistyduck.com.

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

丠研

你的鼓励将是我最大的动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值