wildfly-10 - 在undertow中使用表达式过滤器不起作用
问题描述
我正在使用 Wildfly 10,我正在尝试在 undertow 配置中添加一个表达式过滤器来验证来自 mod_jk 的秘密值。但是,它总是返回错误代码 403。
下面是我在standalone-full.xml 中的配置
<subsystem xmlns="urn:jboss:domain:undertow:7.0" ...>
...
<server name="default-server">
<http-listener name="default" socket-binding="http" redirect-socket="https" enable-http2="true"/>
<ajp-listener name="ajp" socket-binding="ajp"/>
<https-listener name="https" socket-binding="https" security-realm="ApplicationRealm" enable-http2="true"/>
<host name="default-host" alias="localhost">
...
<!-- add the following with your AJP port (8009) -->
<filter-ref name="secret-checker" predicate="equals(%p, 8009)"/>
</host>
</server>
...
<filters>
<!-- add the following with your credential (YOUR_AJP_SECRET) -->
<expression-filter name="secret-checker" expression="not equals(%{r,secret}, 'verysecure') -> response-code(403)"/>
</filters>
下面是 mod_jk 在workers.properties 中的配置。
worker.list=ajp13
worker.ajp13.port=8009
worker.ajp13.host=127.0.0.1
worker.ajp13.type=ajp13
worker.ajp13.secret=verysecure
我正在尝试减轻此链接中详述的 ghostcat 漏洞。 https://access.redhat.com/solutions/4851251
任何帮助表示赞赏。提前致谢。
解决方案
在端口之后放置“ and equals(%{PROTOCOL}, 'AJP')” 。
predicate="equals(%p, 8009) and equals(%{PROTOCOL}, 'AJP')" 但我得到的是 404 而不是预期的 403 :(
推荐阅读
- java - hibernate 5.4.12.Final“注解类型NamedQuery的属性cacheable未定义”,不支持cacheable = true吗?
- python - 如何舍入预测
- amazon-web-services - 运行权限命令 AWS 后给出 503 错误
- python - Google Colab 从 Kaggle 导入数据库
- bash - 如何从基因列表中选择多个 fasta 序列
- javascript - 如何在反应后方法调用中传递带有表示数字数据类型的值的json属性
- activemq - 主题的 ActiveMQ 单次出列
- c - Archive has no index; run ranlib to add one (when linking with a .a containing a MachO64 object file on Linux)
- python - 如何使用Python返回整数列表的所有子集的列表?
- python - Python主进程/线程未在多处理中终止