The invention discloses a WAF test method based on Nginx, which belongs to the field of information security. It includes the following contents: when the client accesses Original through the Nginx proxy, the Nginx mirror module copies the client's access request to Original as a Mirror's access request; when the request reaches Nginx, it matches the location within Nginx, and makes different processing according to different locations; when the request matches to O. In riginal location, while forwarding requests to Original in the Original location module, a mirror request is generated to match the Mirror location module. The invention maps the real business environment and the real user request to the background mirror service, can completely simulate the running environment after the WAF is on-line, and can test the WAF according to the user's real request without affecting the on-line service.
【技术实现步骤摘要】
一种基于Nginx的WAF测试方法
本专利技术的实施方式涉及属于信息安全领域,更具体地,本专利技术的实施方式涉及一种基于Nginx的WAF测试方法。
技术介绍
随着计算机技术的不断发展,web应用越来越广泛。Nginx作为一款轻量级的Web服务器,具有高性能的HTTP处理能力和反向代理功能,被广泛用作WAF部署服务器。WAF是Web应用的安全保障,上线前必须对其功能和性能进行全面的测试。目前,WAF测试一般会经过两个步骤,线下测试与线上测试。线下主要测试WAF功能及性能,一般通过DVWA等漏洞平台或者线下模拟业务环境检测WAF功能,通过Jmeter等压测工具检测WAF性能。经过线下的初步测试,可以大概了解WAF的性能,排除WAF在功能上的错误,但是并不能避免WAF上线后产生误报以及对线上业务造成的其他不可预知的负面影响。所以,WAF上线后也会经过一段时间的线上测试,来检测WAF在真实业务环境下的运行情况,排除具体业务上的一些误报。但是对于WAF上线后产生的误报带来的影响是不可避免的,很可能会影响线上业务的正常运行,给客户造成使用上的不便,造成不必要的损失。如图1所示,图1为传统的WAF部署方式,将WAF部署在Nginx服务器中,请求通过Nginx反向代理对业务源站发起访问,这样所有的请求便会经过WAF检测。请求到达WAF如果触发规则,则拦截请求。如果不触发规则,则请求通过,Nginx转发请求到业务源站。业务源站对请求的响应也同样经过WAF检测,不触发WAF规则的响应才会被发送到客户端。
技术实现思路
本专利技术的目的是针对上述
技术介绍
,提供一种基于Nginx的 ...
【技术保护点】
1.一种基于Nginx的WAF测试方法,其特征在于,包括以下内容:客户端通过Nginx代理访问Original时,Nginx镜像模块将客户端对Original的访问请求拷贝一份作为Mirror的访问请求;当请求到达Nginx时,在Nginx内部会去匹配location,根据不同location对请求做出不同的处理;当请求匹配到Original location时,在Original location模块中转发请求到Original的同时,也会生成一个镜像请求去匹配Mirror location模块;当镜像请求匹配到Mirror location时,Mirror location中WAF会去检测镜像请求,如果没有触发WAF规则,那么Mirror location将请求转发到Mirror;当Mirror做出响应后,响应到达Nginx时也会先经过WAF检测,如果没触发规则,则响应通过WAF到达Nginx处理响应的相应阶段。
【技术特征摘要】
1.一种基于Nginx的WAF测试方法,其特征在于,包括以下内容:客户端通过Nginx代理访问Original时,Nginx镜像模块将客户端对Original的访问请求拷贝一份作为Mirror的访问请求;当请求到达Nginx时,在Nginx内部会去匹配location,根据不同location对请求做出不同的处理;当请求匹配到Originallocation时,在Originallocation模块中转发请求到Original的同时,也会生成一个镜像请求去匹配Mirrorlocation模...
【专利技术属性】
技术研发人员:冯其,
申请(专利权)人:四川长虹电器股份有限公司,
类型:发明
国别省市:四川,51
还没有人留言评论。发表了对其他浏览者有用的留言会获得科技券。