【问题标题】:HTTP Flood on Tomcat server causing issuesTomcat 服务器上的 HTTP 洪水导致问题
【发布时间】:2020-12-20 19:43:24
【问题描述】:

我在运行端口 80 的 apache 服务器上遇到小型 HTTP 洪水,该服务器在端口 8080 上代理 tomcat。

现在发生的情况是,这导致 tomcat 创建 100 到 1000 个会话,具体取决于有多少客户端通过了 cloudflare 防火墙和我的服务器(我为我的 Apache 服务器安装了libapache2-mod-qos)。

IPTABLES:


/sbin/iptables -A INPUT -p tcp -m connlimit --connlimit-above 111 -j REJECT --reject-with tcp-reset
/sbin/iptables -A INPUT -p tcp --tcp-flags RST RST -m limit --limit 2/s --limit-burst 2 -j ACCEPT
/sbin/iptables -A INPUT -p tcp --tcp-flags RST RST -j DROP
/sbin/iptables -A INPUT -p tcp -m conntrack --ctstate NEW -m limit --limit 60/s --limit-burst 20 -j ACCEPT
/sbin/iptables -A INPUT -p tcp -m conntrack --ctstate NEW -j DROP
iptables -A INPUT -p tcp --dport 80 -m hashlimit --hashlimit-upto 50/min \
    --hashlimit-burst 500 --hashlimit-mode srcip --hashlimit-name http -j ACCEPT
iptables -A INPUT -p tcp --dport 80 -j DROP

示例:

现在这给我带来了重大问题,如果有人可以帮助阐明如何解决这个问题,我将非常感激。

mod-qos 配置:

<IfModule qos_module>
  # handle connections from up to 100000 different IPs
   QS_ClientEntries 100000
   # allow only 50 connections per IP
   QS_SrvMaxConnPerIP 10
   # limit maximum number of active TCP connections limited to 256
   MaxClients 256
   # disables keep-alive when 180 (70%) TCP connections are occupied
   QS_SrvMaxConnClose 180
   # minimum request/response speed
   # (deny slow clients blocking the server, keeping connections open without requesting anything
   QS_SrvMinDataRate 150 1200
</IfModule>

【问题讨论】:

    标签: apache http tomcat9 flooding


    【解决方案1】:

    据您所知,这是合法的流量,而不是 DOS / DDOS 的一部分吗? 我假设涉及到 cloudflare,但如果是这样,那么最好让 IPS 在应用程序级别检查流量并根据匹配的攻击签名拒绝它。

    如果是合法的,那么您将需要根据生成的代码和日志来评估 tomcat 应用程序的运行情况。

    也许 Tomcat 应用程序要求客户端将这些数据发送入站。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-03-17
      • 1970-01-01
      • 2015-02-17
      • 1970-01-01
      • 1970-01-01
      • 2013-10-28
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多