zoukankan      html  css  js  c++  java
  • tomcat禁用PUT,DELETE等一些不必要的HTTP方法

    一、背景

    公司进行安全整改,

    技术要求:系统软件所需支撑的WEB容器环境应禁止除GET和POST外其他HTTP(S)方法。

    提供凭证:建议在不影响业务的前提下,禁用PUT、DELETE、HEAD、OPTIONS、TRACE等方法。

    措施:修改配置,只允许GET、POST方法。

    二、技术实现

    1、apache:
    在httpd.conf中增加,只允许GET、POST方法
    <Location "/">
    AllowMethods GET POST
    </Location>
    重启apache
    systemctl restart httpd.service
    ————————————————
    版权声明:本文为CSDN博主「linwha1990」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
    原文链接:https://blog.csdn.net/linwha1990/article/details/101771413
    2、tomcat:
    在web.xml中设置一些参数:

    <security-constraint>
    <web-resource-collection>
    <url-pattern>/*</url-pattern>
    <http-method>PUT</http-method>
    <http-method>DELETE</http-method>
    <http-method>HEAD</http-method>
    <http-method>OPTIONS</http-method>
    <http-method>TRACE</http-method>
    </web-resource-collection>
    <auth-constraint>
    </auth-constraint>
    </security-constraint>
    <login-config>
    <auth-method>BASIC</auth-method>
    </login-config>

    参考https://blog.csdn.net/wangbiao9292/article/details/90606064
    3.weblogic方法
    https://www.cnblogs.com/lijingbo/p/8649420.html

    参看链接:

    https://blog.csdn.net/wangbiao9292/article/details/90606064

  • 相关阅读:
    Vue 路由的编程式导航与history模式
    Vue 路由配置、动态路由
    Vue 组件传值
    Vue 组件以及生命周期函数
    Vue 封装js
    记一次proc_open没有开启心得感悟
    面向内容的标记语言--markdonw
    浅谈索引
    mysql主从配置
    centos7下操作防火墙
  • 原文地址:https://www.cnblogs.com/zhangshuaivole/p/13354720.html
Copyright © 2011-2022 走看看