modSecurity规则学习(四)——规则指令编写
规则语言是使用9个指令实现:

语法:SecRule VARIABLES OPERATOR [TRANSFORMATION_FUNCTIONS, ACTIONS]
Variables 以下几种:
Regular variables
Contain only one piece of information, or one string. For example, REMOTE_ADDR, always
contains the IP address of the client.
Collections
Groups of regular variables. Some collections (e.g., ARGS) allow enumeration, making
it possible to use its every member in a rule. Some other collections (e.g., ENV)
are not as flexible, but there is always going to be some way to extract individual regular
variables out of them.
Read-only collections
Many of the collections point to some data that cannot be modified, in which case
the collection itself will be available only for reading.
Read/write collections
When a collection is not based on immutable data ModSecurity will allow you to
modify it. A good example of a read/write collection is TX, which a collection that
starts empty and exists only as long as the currently processed transaction exists.
Special collections
Sometimes a collection is just a handy mechanism to retrieve information from
something that is not organised as a collection but it can seem that way. This is the
case with the XML collection, which takes an XPath expression as a (mandatory) parameter
and allows you to extract values out of an XML file.
Persistent collections
Some collections can be stored and retrieved later. This feature allows you to adopt a
wider view of your systems, for example tracking access per IP address or per session,
or per user account.
1、一个简单的规则
在rule/目录下创建myruls.conf
添加规则
SecRule ARGS "(testwwd)+" \
"msg:'wwd22 test',\
id:,\
phase:request,\
deny,\
status:"
nginx reload
测试:http://nginxip:nginxport/?test=testwwd
503拦截
2、针对struts漏洞
3、lua脚本
4、白名单、黑名单
6、自定义评分
modSecurity规则学习(四)——规则指令编写的更多相关文章
- Prometheus之告警规则的编写
Prometheus之告警规则的编写 一.前置知识 二.需求 三.实现步骤 1.编写告警规则 2.修改prometheus.yml执行告警规则的位置 3.配置文件截图 4.页面上看告警数据信息 5.查 ...
- Hexo之旅(四):文章编写技巧
hexo 编写文章可以使用以下命令创建hexo new "文件名" #创建的文章会在_pots目录下文章的后缀名是以md命名的文件格式,遵循markdown语法,所以编写文章可以使 ...
- modSecurity规则学习(三)——SecRule
通用格式 SecRule VARIABLES OPERATOR [TRANSFORMATION_FUNCTIONS, ACTIONS] 阶段phase (1)request headers (2) ...
- 技术转载:Jni学习四:如何编写jni方法
转载:http://blog.chinaunix.net/u1/38994/showart_1099528.html 一.概述: 在这篇文章中将会简单介绍如何编制一些简单的JNI 方法.我们都知道JN ...
- modSecurity规则学习(一)——配置文件
环境:modSecurity3.0,nignx1.13.8 modSecurity配置文件 1.nginx.conf server { listen ; modsecurity on; //启动mod ...
- udev规则以及编写
主要内容: udev简介 如何配置和使用udev 如何编写udev规则 字符串替换和匹配 udev主要作用 编写udev规则实例 难点解析 1. udev简介 1.1 什么是udev? udev是Li ...
- Vue.js-----轻量高效的MVVM框架(四、指令)
Vue指令 指令 (Directives) 是特殊的带有前缀 v- 的特性.指令的值限定为绑定表达式,因此上面提到的 JavaScript 表达式及过滤器规则在这里也适用.指令的职责就是当其表达式的值 ...
- vue.js 四(指令和自定义指令)
官方的指令说明已经很简单了,这里再写一遍,也是自己加深一下印象 v-text 就是写入单纯的文本,可以忽略这个指令直接双花括号代替 <span v-text="msg"> ...
- modSecurity规则学习(八)——防止CC攻击
modSecurity日志收集:在phase 5阶段处理. 由于CC攻击主要考虑对动态请求的防护,所以要排除静态资源的请求,或者自定义动态请求的后缀或者关键字做接口针对性的防护. 定义需要排除的请求u ...
随机推荐
- java 获取config 配置文件
static ResourceBundle PropertiesUtil = ResourceBundle.getBundle("config"); public static S ...
- PHP 变量作用域
以下为 PHP 中的各种变量在底层实现中是如何存储的. 变量: $temp = 'temp'; $temp2 = $temp; // key p *executor_globals.symbol_ta ...
- pandas 4 处理缺失数据nan
from __future__ import print_function import pandas as pd import numpy as np np.random.seed(1) dates ...
- Android群英传-拼图游戏puzzle-代码设计和实现
上个周末,3个小时总体上读完了<Android群英传>,本周主要在研究代码层次的设计和实现. 编译安装在手机上,玩了几把,结合代码,一周时间才掌握了整体的思路. 大部分时间,其实花在了 ...
- ocrsearch的横屏转竖屏的解决方案
//这是其中解决预览图的一部分(坑了好久的)@Override public void onPreviewFrame(byte[] data, Camera camera) { Size previe ...
- MD5 加密原理(转)
MD5的全称是Message-Digest Algorithm 5(信息-摘要算法),在90年代初由MIT Laboratory for Computer Science和RSA Data Secur ...
- wipefs进程是啥,占用了百分之90多的cpu
http://www.cnblogs.com/liuchuyu/p/7490338.html
- ESRI.ArcGIS.Controls.AxMapControl
今天在写DLL时发现,直接引用ESRI.ArcGIS.Controls,发现AxMapControl的参数仍然不好用,后来发现,需要引用ESRI.ArcGIS.AxControls这个DLL.而且还需 ...
- python __future__ 的几种特性
今天看tensorflow的代码,看到python里面有这么几句: from __future__ import absolute_import from __future__ import divi ...
- 蓝的成长记——追逐DBA(18):小机上WAS集群故障,由一次更换IP引起
原创作品.出自 "深蓝的blog" 博客,欢迎转载,转载时请务必注明出处.否则追究版权法律责任. 深蓝的blog:http://blog.csdn.net/huangyanlong ...