Url rewriting 如何使用urlrewrite for tomcat阻止请求在get url或post正文中包含单词

Url rewriting 如何使用urlrewrite for tomcat阻止请求在get url或post正文中包含单词,url-rewriting,tuckey-urlrewrite-filter,Url Rewriting,Tuckey Urlrewrite Filter,我需要通过阻止请求中的关键字来修复安全漏洞。如果get或post请求包含关键字“ENTITY”,我希望url重写来阻止请求并发送403 有人能帮我在urlrewrite.xml中编写规则吗? 这是我尝试过的,但不起作用 <rule> <note> Restrict keyword ENTITY in get or post request. </note> <name>Restrict URI Access

我需要通过阻止请求中的关键字来修复安全漏洞。如果get或post请求包含关键字“ENTITY”,我希望url重写来阻止请求并发送403

有人能帮我在urlrewrite.xml中编写规则吗? 这是我尝试过的,但不起作用

 <rule>
    <note>
     Restrict keyword ENTITY in get or post request.   
    </note>
    <name>Restrict URI Access</name>
    <condition type="request-uri" operator="equal">ENTITY</condition>
    <from>(/.*)</from>
    <set type="status">403</set>
    <to last="true">null</to>
</rule>

限制get或post请求中的关键字实体。
限制URI访问
实体
(/.*)
403
无效的
谢谢
…魔法力

下面的规则应该可以做到这一点。 这里filter是请求的参数,可能包含关键字“ENTITY”

PS:因为它是一个URL,可能有许多大写和小写的组合,所以可以编写参数“filter”。(例如过滤器、过滤器、过滤器等)


停止实体关键字
StopENTITYKEYWORD
实体
(/.*)
403
无效的
<rule>
    <note>
        Stop ENTITY keyword
    </note>
    <name>StopENTITYKEYWORD</name>
    <condition type="parameter" name="filter" next="or">ENTITY</condition>
    <from>(/.*)</from>
    <set type="status">403</set>
    <to last="true">null</to>
</rule>