【译】ModSecurity事务生命周期
本篇简要介绍ModSecurity Transaction Lifecycle,也即ModSecurity的事务生命周期。
Transaction Lifecycle
In ModSecurity, every transaction goes through five steps, or phases. In each of the phases, ModSecurity will perform some work at the beginning (e.g., parse data that has become avail- able), invoke the rules specified to work in that phase, and perhaps perform a task or two after the phase rules have finished. At first glance, it may seem that five phases are too many, but there’s a reason that each phase exists. There is always one task, sometimes several, that can only be performed at a particular moment in the transaction lifecycle.
在ModSecurity中,每个事务都经过五个步骤或阶段。在每个阶段中,ModSecurity都将在开始时执行一些工作(例如,解析可用的数据),调用指定在该阶段中工作的规则,并可能在阶段规则完成后执行一两个任务。乍一看,似乎阶段太多了,但是每个阶段都存在一个原因。总是有一个任务,有时是几个,只能在事务生命周期的特定时刻执行。
Request headers (1)
The request headers phase is the first entry point for ModSecurity. The principal pur- pose of this phase is to allow rule writers to assess a request before the costly request body processing is undertaken. Similarly, there is often a need to influence how Mod- Security will process a request body, and in this phase is the time to do it. For example, ModSecurity will not parse an XML or JSON request body by default, but you can in- struct it do so by placing the appropriate rules into phase 1.
请求头阶段是ModSecurity的第一个入口点。此阶段的主要目的是允许规则编写器在执行代价高昂的请求正文处理之前评估请求。类似地,经常需要影响Mod-Security如何处理请求主体,在这个阶段是时候这样做了。例如,默认情况下,ModSecurity不会解析XML或JSON请求体,但您可以通过在阶段1中放置适当的规则来指示其进行相应的操作。
Request body (2)
The request body phase is the main request analysis phase and takes place immediately after a complete request body has been received and processed. The rules in this phase have all the available request data at their disposal. Afterward, the web server will either generate the response itself (in embedded mode) or forward the transaction to a back- end web server (in reverse proxy mode).
请求正文阶段是主要的请求分析阶段,在接收和处理完完整的请求正文之后立即进行。这个阶段的规则拥有所有可用的请求数据。之后,web服务器将生成响应本身(在嵌入式模式下)或将事务转发到后端web服务器(在反向代理模式下)。
Response headers (3)
The response headers phase takes place after response headers become available but before a response body is read. The rules that need to decide whether to inspect a re- sponse body should run in this phase.
响应头阶段发生在响应头可用之后,但在读取响应体之前。需要决定是否检查响应主体的规则应该在这个阶段运行。
Response body (4)
The response body phase is the main response analysis phase. By the time this phase begins, the response body will have been read and all its data made available for the rules to make their decisions.
响应体阶段是主要的响应分析阶段。到这个阶段开始时,响应体已经被读取,并且所有的数据都可以供规则做出决定。
Logging (5)
The logging phase is special. It’s the only phase from which you cannot block. By the time this phase runs, the transaction will have finished, so there’s little you can do but record the fact that it happened. Rules in this phase are run to control how logging is performed or to save information in persistent storage.
日志记录阶段是特殊的。这是你唯一无法阻止的阶段。到这个阶段运行时,事务将完成,所以除了记录它发生的事实之外,您几乎无能为力。此阶段中的规则用于控制如何执行日志记录或将信息保存在持久性存储中。
图示
ModSecurity 事务生命周期的5个阶段图示如下。
The End.
【译】ModSecurity事务生命周期的更多相关文章
- [译] ASP.NET 生命周期 – ASP.NET 上下文对象(六)
使用 HttpApplication 对象 ASP.NET 框架中的许多类都提供了许多很方便的属性可以直接映射到 HttpContext 类中定义的属性.这种交叠有一个很好的例子就是 HttpAppl ...
- [译] ASP.NET 生命周期 – ASP.NET 上下文对象(五)
ASP.NET 上下文对象 ASP.NET 提供了一系列对象用来给当前请求,将要返回到客户端的响应,以及 Web 应用本身提供上下文信息.间接的,这些上下文对象也可以用来回去核心 ASP.NET 框架 ...
- [译] ASP.NET 生命周期 – ASP.NET 请求生命周期(四)
不使用特殊方法来处理请求生命周期事件 HttpApplication 类是全局应用类的基类,定义了可以直接使用的一般 C# 事件.那么使用标准 C# 事件还是特殊方法那就是个人偏好的问题了,如果喜欢, ...
- [译] ASP.NET 生命周期 – ASP.NET 请求生命周期(三)
使用特殊方法处理请求生命周期事件 为了在全局应用类中处理这些事件,我们会创建一个名称以 Application_ 开头,以事件名称结尾的方法,比如 Application_BeginRequest.举 ...
- [译] ASP.NET 生命周期 – ASP.NET 请求生命周期(二)
ASP.NET 请求生命周期 全局应用类也可以用来跟踪每个独立请求的生命周期,包括请求从 ASP.NET 平台传递到 MVC 框架.ASP.NET 框架会创建一个定义在 Global.asax 文件中 ...
- [译] ASP.NET 生命周期 – ASP.NET 应用生命周期(一)
概述 ASP.NET 平台定义了两个非常重要的生命周期.第一个是 应用生命周期 (application life cycle),用来追踪应用从启动的那一刻到终止的那一刻.另一个就是 请求生命周期 ...
- [译] ASP.NET 生命周期 – ASP.NET 上下文对象(八)
使用 HttpResponse 对象 HttpResponse 对象是与 HttpRequest 对象相对应的,用来表示构建中的响应.它当中提供了方法和属性可供我们自定义响应,有一些在使用 MVC 视 ...
- [译] ASP.NET 生命周期 – ASP.NET 上下文对象(七)
使用 HttpRequest 对象 HttpRequest 对象描述的是一个正在被处理的 HTTP 请求.下表列举了 HttpRequest 中的属性,它们提供了当前请求的相关信息(HttpReque ...
- JavaEE(9) - Session EJB的生命周期、事务及拦截器
1. SessionBean的生命周期 无状态Session Bean: 不存在状态-->待命状态-->被销毁状态 不存在状态-->待命状态: 1)通过构造器创建EJB实例 2)执行 ...
随机推荐
- RobotFramework自动化测试框架-Selenium Web自动化(三)关于在RobotFramework中如何使用Selenium很全的总结(下)
本文紧接着RobotFramework自动化测试框架-Selenium Web自动化(二)关于在RobotFramework中如何使用Selenium很全的总结(上)继续分享RobotFramewor ...
- Java语法进阶10-多线程
多线程 并发与并行.进程,线程调度自行百度 线程(thread):是一个进程中的其中一条执行路径,CPU调度的最基本调度的单位.同一个进程中线程可以共享一些内存(堆.方法区),每一个线程又有自己的独立 ...
- 如何在SQL Server 2008下轻松调试T-SQL语句和存储过程
一.回顾早期的SQL SERVER版本:早在SQL Server 2000时代,查询分析器的功能还很简陋,远不如VS那么强大.到SQL Server 2005时代,代码高亮.SQL优化等功能逐渐加强, ...
- Scala: Case classes
Case classes are like regular classes with a few key differences which we will go over. Case classes ...
- ant 自动化构建环境。
ant 一个自动化构建的工具 可以帮你实现自动化打包和发布到web环境上. 项目目录如下: 项目一:common-framework 项目二:estun-platform-web 其中项目一是项目二 ...
- spring cloud 之 -- eureka vs consul,该选择谁?
0--前言 spring cloud的服务注册中心,该选择谁?在选择前,我们首先需要来了解下分布式的CAP定理: 所谓CAP,是指: Consistency:一致性:就是在分布式系统中的所有数据备份, ...
- vue中的$EventBus.$emit、$on 遇到的问题
今天在项目中遇到的一个需求: 在一个选项卡功能的页面,出现的问题是,当点击选项卡的某个选项时,会同时加载整个选项卡的数据,本身产品就很大,数据很多,所以这个问题无法忽略: 仔细研究下发现,当刚进入页面 ...
- Thinkphp5——数据库表名的大小写问题
ThinkPHP5中数据库的表名如果是驼峰命名法,会被转换成小写加下划线,解决方法如下: 1.表名全部小写,因为数据库的表名区分大小写的. 2.使用Db::table("表名"), ...
- 17.Django学习之django自带的contentType表
通过django的contentType表来搞定一个表里面有多个外键的简单处理: 摘自:https://blog.csdn.net/aaronthon/article/details/81714496 ...
- BZOJ 1861书架
小T有一个很大的书柜.这个书柜的构造有些独特,即书柜里的书是从上至下堆放成一列.她用1到n的正整数给每本书都编了号. 小T在看书的时候,每次取出一本书,看完后放回书柜然后再拿下一本.由于这些书太有吸引 ...