我正在基于一份安全扫描报告对我的应用程序进行安全增强。我的应用程序是一个在wildfly中运行的java应用程序。并且它通过作为Apache的反向代理服务器暴露给用户。
我在Wildfly中的standalone.xml文件中做了以下更改,以启用严格的传输安全性和httponly属性。
<server name="default-server">
<http-listener name="default" socket-binding="http" redirect-socket="https" enable-http2="true"/>
<https-listener name="https" socket-binding="https" security-realm="ApplicationRealm" enable-http2="true"/>
<host name="default-host" alias="localhost">
<location name="/" handler="welcome-content"/>
<http-invoker security-realm="ApplicationRealm"/>
<filter-ref name="x-frame-options"/>
<filter-ref name="x-xss-protection"/>
<filter-ref name="x-content-type-options"/>
<filter-ref name="transport-security"/>
</host>
</server>
<servlet-container name="default">
<jsp-config x-powered-by="false"/>
<session-cookie http-only="true" secure="true"/>
<websockets/>
</servlet-container>但是,当我转到应用程序页面并检查network选项卡中的响应时,我看到重复的属性。
Request Method: GET
Status Code: 200 OK
Referrer Policy: strict-origin-when-cross-origin
Connection: Keep-Alive
Content-Length: 4222
Content-Type: text/html;charset=ISO-8859-1
Date: Fri, 08 Jan 2021 02:36:52 GMT
Keep-Alive: timeout=5, max=99
Server: Apache
SET-COOKIE: JSESSIONID=BOH0IrY-e2q24ks1bbMy9bBzqeDZshm1n1O02G_f; Path=/MyApplication; HttpOnly
SET-COOKIE: JSESSIONID=BOH0IrY-e2q24ks1bbMy9bBzqeDZshm1n1O02G_f.application_uat; path=/MyApplication; secure; HttpOnly
Strict-Transport-Security: max-age=63072000; includeSubDomains
Strict-Transport-Security: max-age=31536000; includeSubDomains
X-Content-Type-Options: nosniff
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1; mode=block
X-XSS-Protection: 1; mode=block另外,在一种情况下,JSESSIONID是安全的,在另一种情况下,JSESSIONID是不安全的。我不是在处理Apache服务器的配置。会不会是因为Apache服务器的某些配置?我是个新手,所以希望能帮你弄清楚。
谢谢。
发布于 2021-01-14 04:29:01
如果您可以访问应用程序的源代码,请检查它是否具有内部开发的自定义cookie处理程序。
可以是像一段附加一些文本而不是覆盖它的代码一样愚蠢的东西。
有证据表明:
SET-COOKIE: JSESSIONID=BOH0IrY-e2q24ks1bbMy9bBzqeDZshm1n1O02G_f; Path=/MyApplication; HttpOnly
SET-COOKIE: JSESSIONID=BOH0IrY-e2q24ks1bbMy9bBzqeDZshm1n1O02G_f.application_uat; path=/MyApplication; secure; HttpOnl有效地相同的行,并在某处添加了额外的信息。建议一个在此过程中改变某些事情的处理程序。
情况也是如此。
Strict-Transport-Security: max-age=63072000; includeSubDomains
Strict-Transport-Security: max-age=31536000; includeSubDomains这有点奇怪。
不管怎样..。它看起来像是在处理2个请求并修改相同的吞吐量……糟糕透顶。
https://stackoverflow.com/questions/65622780
复制相似问题