Files
micro_servers/waf/rules/waf.conf
T
2026-07-25 11:22:51 +08:00

31 lines
1.2 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# waf.conf —— WAF 规则主入口(仅放基础配置)
# 极客操作:
# - 在 local/ 下新增 *.conf 文件,engine 会自动扫描加载(按文件名字母序)
# - 修改后执行 `kill -HUP <pid>` 热加载
# - 校验语法: `waf -test rules/local/xxx.conf`
#
# 加载顺序(engine.Reload):
# 1. waf.conf ← 本文件(引擎基础配置)
# 2. local/*.conf 本地自定义规则(按文件名字母序)
# 3. crs/coraza.conf OWASP CRS 入口(若存在)
# 4. crs/rules/*.conf OWASP CRS 规则(按文件名字母序)
#
# 规则 ID 分段约定:
# 100000-199999 本地自定义规则
# 200000-200006 请求体处理器初始化(crs/coraza.conf)
# 900000-999999 OWASP CRS(由 crs/ 提供,不手改)
#
# 注意:本文件不用 Include 指令(coraza 的 Include 路径相对于 cwd 解析,
# 易出错)。engine.Reload 会先加载本文件,再扫描 local/*.conf 逐个加载。
# ===== 基础配置(SecLang) =====
SecRuleEngine On
SecRequestBodyAccess On
SecResponseBodyAccess On
SecDefaultAction "phase:1,pass,log,auditlog"
SecDefaultAction "phase:2,pass,log,auditlog"
# 请求体限制 10MB
SecRequestBodyLimit 10485760