我正在尝试使用本教程安装/configurationmod-sec, 该教程使用OWASP ModSecurity核心规则集 。 但是,当我去重新启动Apache,我得到以下错误:
Syntax error on line 53 of /etc/modsecurity/base_rules/modsecurity_crs_20_protocol_violations.conf: Error parsing actions: Unknown action: ver Action 'configtest' failed. The Apache error log may have more information. ...fail!
这是它遇到的代码块:(具体地说ver:'OWASP_CRS/2.2.9',\ )
SecRule REQUEST_LINE "!^(?i:(?:[az]{3,10}\s+(?:\w{3,7}?://[\w\-\./]*(?::\d+)?)?/[^?#]*(?:\?[^#\s]*)?(?:#[\S]*)?|connect (?:\d{1,3}\.){3}\d{1,3}\.?(?::\d+)?|options \*)\s+[\w\./]+|get /[^?#]*(?:\?[^#\s]*)?(?:#[\S]*)?)$"\ "msg:'Invalid HTTP Request Line',\ severity:'4',\ id:'960911',\ ver:'OWASP_CRS/2.2.9',\ rev:'2',\ maturity:'9',\ accuracy:'9',\ logdata:'%{request_line}',\ phase:1,\ block,\ t:none,\ tag:'OWASP_CRS/PROTOCOL_VIOLATION/INVALID_REQ',\ tag:'CAPEC-272',\ setvar:'tx.msg=%{rule.msg}',\ setvar:tx.anomaly_score=+%{tx.notice_anomaly_score},\ setvar:'tx.%{rule.id}-OWASP_CRS/PROTOCOL_VIOLATION/INVALID_REQ-%{matched_var_name}=%{matched_var}'"
我已经安装了modsec Version: 2.6.3-1ubuntu0.2所以我认为它应该与OWASP ModSecurity Core Rule Set
任何想法如何得到它的工作? 提前致谢!
使用Googlesearch错误消息,我发现这一点
…
现在Apache无法启动:Sep 30 15:30:14 mydomain httpd [2377]:/etc/httpd/modsecurity.d/activated_rules/modsecurity_crs_20_protocol_violations.conf的第52行的语法错误:Sep 30 15:30:14 mydomain httpd [ 2377]:parsing操作时出错:未知操作:ver
和答复是
这是我的坏… CRS v2.2.6使用ModSecurity v2.7.0的一些新的行动 –
- 版本
- 到期
- 准确性
看起来你正在使用的CRS对于你已经安装的mod_security版本来说太新了。 您将需要更新到更高版本的mod_security或查找旧版本的CRS。
OWASP规则集已升级到需要modsecurity> = 2.7。
util / rule-management文件夹中有一个降级脚本,可以自动将规则集降级到2.6兼容。
要降级激活的规则,只需在规则目录中运行这个命令(需要perl):
perl <PATH_TO_OWASP_RULESET_TGZ>/SpiderLabs-owasp-modsecurity-crs-ebe8790/util/rule-management/remove-2.7-actions.pl -t 2.6 -f .