zoukankan      html  css  js  c++  java
  • 服务器--Tomcat启动了不安全的HTTP方法解决办法

    一、问题描述

    平时我们项目中基本上用的都是GET/POST请求方法,其他的方法是很少用到的,如PUT/DELETE/HEAD/OPTIONS/TRACE,不关闭这些HTTP请求方法,是常见的web漏洞之一。

    二、解决办法

    把他们关闭即可!!!

    添加以下节点代码到web.xml配置文件当中。可以在项目WEB-INF/web.xml中添加,也可以在tomcat/conf/web.xml中添加

    1. <!-- close insecure http methods -->
    2. <security-constraint>
    3. <web-resource-collection>
    4. <web-resource-name>fortune</web-resource-name>
    5. <url-pattern>/*</url-pattern>
    6. <http-method>PUT</http-method>
    7. <http-method>DELETE</http-method>
    8. <http-method>HEAD</http-method>
    9. <http-method>OPTIONS</http-method>
    10. <http-method>TRACE</http-method>
    11. </web-resource-collection>
    12. <auth-constraint></auth-constraint>
    13. </security-constraint>
  • 相关阅读:
    POJ 最小球覆盖 模拟退火
    POJ 1379 模拟退火
    PythonTip(2)
    PythonTip(1)
    LA 3353 最优巴士线路设计
    LA 4254 贪心
    判断分析
    因子分析——因子得分
    因子分析——应用
    因子分析——因子旋转
  • 原文地址:https://www.cnblogs.com/Fooo/p/14301456.html
Copyright © 2011-2022 走看看