描述:根据提供的XML Schema验证XML DOM节点树。必须先使用XML请求正文处理器构建DOM树。 验证失败时规则将会匹配成功。


例:


#解析包含XML的请求主体

SecRule REQUEST_HEADERS:Content-Type ^text/xml$ "phase:1,id:190,nolog,pass,t:lowercase,ctl:requestBodyProcessor=XML"


#根据DTD验证XML有效负载

SecRule XML "@validateSchema /path/to/xml.xsd" "phase:2,id:191,deny,msg:'Failed DTD validation'"

注意:您必须启用SecXmlExternalEntity指令。



Created with the Personal Edition of HelpNDoc: Easy EPub and documentation editor