slow_http_dos tomcat
原理:通过并发连接池进行的慢速读攻击(基于TCP持久时间)等。慢速攻击基于HTTP协议,通过精心的设计和构造,这种特殊的请求包会造成服务器延时,而当服务器负载能力消耗过大即会导致拒绝服务
解决方案:
1 设置Tomcat / server.xml文件 connectiontimeout 值,默认为20000ms,修改为8000ms(Tomcat 自身安全漏洞)
1 设置Tomcat / server.xml文件 connectiontimeout 值,默认为20000ms,修改为8000ms(Tomcat 自身安全漏洞)
2 设置AJAX的全局timeout时间(默认为30000ms) $.ajaxSetup({timeout:8000});
3.3 If possible, you should set the Secure flag for this cookie,set the HTTPOnly flag for this cookie解决方案:
1 (Tomcat 自身安全漏洞)设置设置Tomcat / web.xml文件:
<session-config>
<session-timeout>30<session-timeout>
<cookie-config>
<secure>true</secure>
<http-only>true</http-only>
</cookie-config>
<session-config>
2 在Login .jsp主页面加入:
response.setHeader("SET-COOKIE", "JSESSIONID=" + sessionid + "; secure ; HttpOnly");
1 (Tomcat 自身安全漏洞)设置设置Tomcat / web.xml文件:
<session-config>
<session-timeout>30<session-timeout>
<cookie-config>
<secure>true</secure>
<http-only>true</http-only>
</cookie-config>
<session-config>
2 在Login .jsp主页面加入:
response.setHeader("SET-COOKIE", "JSESSIONID=" + sessionid + "; secure ; HttpOnly");
响应头X-Frame-Option响应头缺失,X-Frame-Option用来给浏览器指示允许一个页面可否在<frame>,<iframe>或者<object>中展现标记,网站可通过此来确保自己网站的内容没有被嵌到别人的网站中去。
<filter> <filter-name>httpHeaderSecurity</filter-name> <filter-class>org.apache.catalina.filters.HttpHeaderSecurityFilter</filter-class> <init-param> <param-name>antiClickJackingEnabled</param-name> <param-value>true</param-value> </init-param> <init-param> <param-name>antiClickJackingOption</param-name> <param-value>SAMEORIGIN</param-value> </init-param> <async-supported>true</async-supported> </filter> <filter-mapping> <filter-name>httpHeaderSecurity</filter-name> <url-pattern>/*</url-pattern> </filter-mapping>
浙公网安备 33010602011771号