使用NGINX的WAF owasp modsecurity crs中“尚不支持SecCollectionTimeout”

前端之家收集整理的这篇文章主要介绍了使用NGINX的WAF owasp modsecurity crs中“尚不支持SecCollectionTimeout”前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

我用WAF安装Nginx(使用Docker)

    mkdir -p /usr/src \
    && cd /usr/src/ \
    && git clone --depth 1 -b v3/master --single-branch https://github.com/SpiderLabs/ModSecurity \
    && cd ModSecurity \
    && git submodule init \
    && git submodule update \
    && ./build.sh \
    && ./configure \
    && make -j$(getconf _NPROCESSORS_ONLN) \
    && make install

    ... prevIoUs commands to install Nginx from source...

    && cd /usr/src \
    && git clone --depth 1 https://github.com/SpiderLabs/ModSecurity-Nginx.git \
    && cd /usr/src/Nginx-$Nginx_VERSION \
    && ./configure --with-compat --add-dynamic-module=../ModSecurity-Nginx \
    && make modules \
    && cp objs/ngx_http_modsecurity_module.so /etc/Nginx/modules \
    && mkdir /etc/Nginx/modsec \
    && wget -P /etc/Nginx/modsec/ https://raw.githubusercontent.com/SpiderLabs/ModSecurity/v3/master/modsecurity.conf-recommended \
    && mv /etc/Nginx/modsec/modsecurity.conf-recommended /etc/Nginx/modsec/modsecurity.conf \
    && sed -i 's/SecRuleEngine DetectionOnly/SecRuleEngine On/' /etc/Nginx/modsec/modsecurity.conf \
    && sed -i 's/SecRequestBodyInMemoryLimit 131072//' /etc/Nginx/modsec/modsecurity.conf \
    && sed -i 's#SecAuditLog /var/log/modsec_audit.log#SecAuditLog /var/log/Nginx/modsec_audit.log#' /etc/Nginx/modsec/modsecurity.conf \
    && mkdir /opt \
    && cd /opt \
    && git clone -b v3.0/master --single-branch https://github.com/SpiderLabs/owasp-modsecurity-crs.git \
    && cd owasp-modsecurity-crs/ \
    && cp /opt/owasp-modsecurity-crs/crs-setup.conf.example /opt/owasp-modsecurity-crs/crs-setup.conf

但突然开始标记这个错误

Nginx: [emerg] “modsecurity_rules_file” directive Rules error. File: /opt/owasp-modsecurity-crs/crs-setup.conf. Line: 96. Column: 43. SecCollectionTimeout is not yet supported.

documentation

==============

#
# -- [[ Collection timeout ]] --------------------------------------------------
#
# Set the SecCollectionTimeout directive from the ModSecurity default (1 hour)
# to a lower setting which is appropriate to most sites.
# This increases performance by cleaning out stale collection (block) entries.
#
# This value should be greater than or equal to:
# tx.reput_block_duration (see section "Blocking Based on IP Reputation") and
# tx.dos_block_timeout (see section "Anti-Automation / DoS Protection").
#
# Ref: https://github.com/SpiderLabs/ModSecurity/wiki/Reference-Manual#wiki-SecCollectionTimeout

# Please keep this directive uncommented.
# Default: 600 (10 minutes)
SecCollectionTimeout 600

==============

我通过在命令中添加此行来解决此问题(禁用规则):

&& sed -i 's/SecCollectionTimeout 600/# SecCollectionTimeout 600/' /opt/owasp-modsecurity-crs/crs-setup.conf

但我不知道它有什么后果,或者它是否是正确的应用方式.

一个可以指导我的例子?

最佳答案
我认为你需要重新配置WAF OWASP来解决这个问题.
检查那个链接

上次我的朋友解决了这个问题以重新配置它…

https://support.cloudflare.com/hc/en-us/articles/115000223771-How-do-I-configure-the-WAF-

猜你在找的Nginx相关文章