简体   繁体   中英

ModSecurity: No action id present within the rule

[root@vmn-ssd-42 ~]# httpd -t
Syntax error on line 17 of /etc/httpd/conf.d/mod_security.conf:
ModSecurity: No action id present within the rule

SecRuleEngine On
SecRequestBodyAccess On
SecRule REQUEST_HEADERS:Content-Type "text/xml" \
    "id:'200000',phase:1,t:none,t:lowercase,pass,nolog,ctl:requestBodyProcessor=XML"
SecRule REQUEST_HEADERS:Content-Type "multipart/form-data" \
    "chain,phase:2,t:none,t:lowercase,deny,msg:'ModSecurity DoS attempt - NULL part header name'"

Since ModSecurity 2.7 the id attribute is mandatory . Your second rule does not contain an id.

Change it from this:

 SecRule REQUEST_HEADERS:Content-Type "multipart/form-data" \
"chain,phase:2,t:none,t:lowercase,deny,msg:'ModSecurity DoS attempt - NULL part header name'"

To this (assuming rule id 200001 is not used elsewhere):

 SecRule REQUEST_HEADERS:Content-Type "multipart/form-data" \
"id:'200001', chain,phase:2,t:none,t:lowercase,deny,msg:'ModSecurity DoS attempt - NULL part header name'"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM