-- Get rid of error message --> <security-constraint> <web-resource-collection> <web-resource-name url-pattern> <http-method>TRACE</http-method> </web-resource-collection> <auth-constraint/> </security-constraint > <security-constraint> <web-resource-collection> <web-resource-name>Enable everything but url-pattern> <http-method-omission>TRACE</http-method-omission> </web-resource-collection> </security-constraint
-- 初始化https协议 --> <security-constraint> <web-resource-collection> <web-resource-name <transport-guarantee>CONFIDENTIAL</transport-guarantee> </user-data-constraint> </security-constraint -- 初始化https协议 --> <security-constraint> <web-resource-collection> <web-resource-name>SSL</web-resource-name user-data-constraint> <transport-guarantee>CONFIDENTIAL</transport-guarantee> </user-data-constraint> </security-constraint
CLIENT-CERT</auth-method> <realm-name>Client Cert Users-only Area</realm-name> </login-config> <security-constraint <transport-guarantee>CONFIDENTIAL</transport-guarantee> </user-data-constraint> </security-constraint
auth-method> <realm-name>Client Cert Users-only Area</realm-name> </login-config> <security-constraint <transport-guarantee>CONFIDENTIAL</transport-guarantee> </user-data-constraint> </security-constraint
For example, Tomcat will set Cache-Control: no-cache for any files behind the security-constraint below -- Disable TRACE method with security constraint (copied from jetty/webdefaults.xml) --> <security-constraint > <http-method>TRACE</http-method> </web-resource-collection> <auth-constraint /> </security-constraint > <security-constraint> <web-resource-collection> <web-resource-name>other</web-resource-name -- no security constraint --> </security-constraint> <login-config> <auth-method>FORM</auth-method
-- Login required for the following URLs --> <security-constraint> <web-resource-collection> web-resource-collection> <auth-constraint> <role-name>*</role-name> </auth-constraint> </security-constraint -- Login not required for the following URLs --> <security-constraint> <web-resource-collection url-pattern> <url-pattern>/RestAPI/TwoFactorAction</url-pattern> </web-resource-collection> </security-constraint
username="report" password="reportxxx" roles="report"/> 最后在webapps/ROOT/WEB-INFO/web.xml的web-app中增加: <security-constraint web-resource-collection> <auth-constraint> <role-name>report</role-name> </auth-constraint> </security-constraint
local/solr-7.7.1/server/solr/* /home/solr-home/ 打开并编辑/tomcat/webapps/solr/WEB-INF/web.xml并且注释文件末尾的所有 <security-constraint -- <security-constraint> <web-resource-collection> <web-resource-name>Disable TRACE</web-resource-name url-pattern> <http-method>TRACE</http-method> </web-resource-collection> <auth-constraint/> </security-constraint > <security-constraint> <web-resource-collection> <web-resource-name>Enable everything but url-pattern> <http-method-omission>TRACE</http-method-omission> </web-resource-collection> </security-constraint
auth-method> <realm-name>Client Cert Users-only Area</realm-name> </login-config> <security-constraint <transport-guarantee>CONFIDENTIAL</transport-guarantee> </user-data-constraint> </security-constraint
添加下面的定义到文件的页尾,但是需要在 </web-app> 标签的前面: <security-constraint> <web-resource-collection> <web-resource-name user-data-constraint> <transport-guarantee>CONFIDENTIAL</transport-guarantee> </user-data-constraint> </security-constraint
临时缓解方案: 1、修改 //confluence/WEB-INF/web.xml 文件,并添加以下内容(就在文件末尾的 标签之前): <security-constraint> <web-resource-collection http-method-omission>*</http-method-omission> </web-resource-collection> <auth-constraint /> </security-constraint
local/solr-7.7.1/server/solr/* /home/solr-home/ 打开并编辑/tomcat/webapps/solr/WEB-INF/web.xml并且注释文件末尾的所有 <security-constraint -- <security-constraint> <web-resource-collection> <web-resource-name>Disable TRACE</web-resource-name url-pattern> <http-method>TRACE</http-method> </web-resource-collection> <auth-constraint/> </security-constraint > <security-constraint> <web-resource-collection> <web-resource-name>Enable everything but url-pattern> <http-method-omission>TRACE</http-method-omission> </web-resource-collection> </security-constraint
1、配置web.xml(和server.xml在同一目录下),在后面一部分添加如下一段话 <security-constraint> <web-resource-collection > user-data-constraint> <transport-guarantee>CONFIDENTIAL</transport-guarantee> </user-data-constraint> </security-constraint
-- ====================自动跳转——start ===================== --> <security-constraint> <web-resource-collection > <transport-guarantee>CONFIDENTIAL</transport-guarantee> </user-data-constraint> </security-constraint -- ====================自动跳转——start ===================== --> <security-constraint> <web-resource-collection > <transport-guarantee>CONFIDENTIAL</transport-guarantee> </user-data-constraint> </security-constraint
tomcat传统形式通过配置web.xml达到禁止不安全的http方法 <security-constraint> <web-resource-collection> </web-resource-collection> <auth-constraint> </auth-constraint> </security-constraint
CLIENT-CERT</auth-method> <realm-name>Client Cert Users-only Area</realm-name> </login-config> <security-constraint user-data-constraint> <transport-guarantee>CONFIDENTIAL</transport-guarantee> </user-data-constraint> </security-constraint
对于tomcat来说,好像默认就是不启用对webdav协议的支持的,但是有很多人的博客上都写了如何在web.xml中关闭http的不常用的或者不安全的方法,关闭代码如下,添加到web.xml中即可: <security-constraint TRACE</http-method> </web-resource-collection> <auth-constraint> </auth-constraint> </security-constraint
</auth-method> <realm-name>Client Cert Users-only Area</realm-name> </login-config> <security-constraint user-data-constraint> <transport-guarantee>CONFIDENTIAL</transport-guarantee> </user-data-constraint> </security-constraint
<security-constraint> <web-resource-collection > <web-resource-name >SSL</web-resource-name <transport-guarantee>CONFIDENTIAL</transport-guarantee> </user-data-constraint> </security-constraint
-- ====================自动跳转——start ===================== --> <security-constraint> <web-resource-collection > <transport-guarantee>CONFIDENTIAL</transport-guarantee> </user-data-constraint> </security-constraint -- ====================自动跳转——start ===================== --> <security-constraint> <web-resource-collection > <transport-guarantee>CONFIDENTIAL</transport-guarantee> </user-data-constraint> </security-constraint