fix(waf): 对 /add_note 接口豁免 CRS 误报规则

嵌入式/技术笔记含 C 代码(if()/select/sbit)被 SQLi/命令注入规则误判拦截。
仅移除误报规则(942170/942230/932xxx/934xxx),其余 CRS 规则及接口仍生效。
This commit is contained in:
qing committed 2026-08-04 21:32:14 +08:00
1 parent 15f8c9552d
commit fd088f5959
1 file changed
+13
+13
View File
@@ -4,3 +4,16 @@
# 示例:关闭 100003 对 /login 路径的检查 # 示例:关闭 100003 对 /login 路径的检查
# SecRule REQUEST_URI "@beginsWith /login" \ # SecRule REQUEST_URI "@beginsWith /login" \
# "id:100100,phase:1,pass,nolog,ctl:ruleRemoveById=100003" # "id:100100,phase:1,pass,nolog,ctl:ruleRemoveById=100003"
# ============================================================
# 100100: 对 /add_note 笔记接口豁免 CRS 误报规则
# 背景:嵌入式/技术笔记含 C 代码(if() 条件、select、sbit 等),
# 被 CRS 的 SQLi/命令注入规则误判为攻击(942170/942230/932xxx/934xxx)。
# 方案:仅移除误报规则本身,其余 CRS 规则仍生效,兼顾正常提交与安全检测。
# 若后续文章仍被误拦,把日志中新增的 rule_id 追加到 ctl:ruleRemoveById 列表。
# ============================================================
SecRule REQUEST_URI "@beginsWith /add_note" \
"id:100100,phase:1,pass,nolog,\
ctl:ruleRemoveById=942170,ctl:ruleRemoveById=942230,\
ctl:ruleRemoveById=932120,ctl:ruleRemoveById=932125,ctl:ruleRemoveById=932140,ctl:ruleRemoveById=932235,ctl:ruleRemoveById=932260,\
ctl:ruleRemoveById=934110,ctl:ruleRemoveById=934160"