【问题标题】:ModSecurity: No action id present within the ruleModSecurity:规则中不存在操作 ID
【发布时间】:2018-10-18 01:26:27
【问题描述】:

[root@vmn-ssd-42 ~]# httpd -t
/etc/httpd/conf.d/mod_security.conf 第 17 行的语法错误:
ModSecurity:规则中没有操作 ID

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'"

【问题讨论】:

  • 请建议解决这个问题。
  • 第17行是哪一个?

标签: apache mod-security


【解决方案1】:

ModSecurity 2.7 the id attribute is mandatory.您的第二条规则不包含 id。

从这里改变它:

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

对此(假设规则 id 200001 未在其他地方使用):

 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'"

【讨论】:

    猜你喜欢
    • 2021-12-21
    • 2019-04-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-11-01
    • 1970-01-01
    相关资源
    最近更新 更多