Pri*_*aha 2 security http-headers servlet-filters undertow wildfly-10
有没有办法配置 Wildfly(10 个或更多)发送到客户端的 Http 标头仅配置以下内容:
HTTPS 严格传输安全 (HSTS) X-XSS-Protection X-Frame-Options Strict-Transport-Security Content-Security-Policy X-Content-Type-Options
我有一个配置文件(standalone.xml),其中包含所有配置。我需要在这里添加标题的配置。
小智 6
<subsystem xmlns="urn:jboss:domain:undertow:6.0" default-server="default-server" default-virtual-host="default-host" default-servlet-container="default" default-security-domain="other">
<buffer-cache name="default"/>
<server name="default-server">
<http-listener name="default" socket-binding="http" max-parameters="10000" 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" predicate="not exists[%{o,Content-Security-Policy}]"/>
<http-invoker security-realm="ApplicationRealm"/>
<filter-ref name="Content-Security-Policy"/>
<filter-ref name="x-frame-options"/>
<filter-ref name="x-xss-protection"/>
<filter-ref name="x-content-type-options"/>
<!--filter-ref name="content-security-policy"/-->
<filter-ref name="strict-transport-security"/>
<filter-ref name="my-custom-header"/>
</host>
</server>
<servlet-container name="default">
<jsp-config/>
<websockets/>
</servlet-container>
<handlers>
<file name="welcome-content" path="${jboss.home.dir}/welcome-content"/>
</handlers>
<filters>
<response-header name="server-header" header-name="Server" header-value="JBoss-EAP/7"/>
<response-header name="x-powered-by-header" header-name="X-Powered-By" header-value="Undertow/1"/>
<response-header name="Content-Security-Policy" header-name="Content-Security-Policy" header-value="default-src 'self'"/>
<response-header name="x-frame-options" header-name="X-Frame-Options" header-value="SAMEORIGIN"/>
<response-header name="x-xss-protection" header-name="X-XSS-Protection" header-value="1; mode=block"/>
<response-header name="x-content-type-options" header-name="X-Content-Type-Options" header-value="nosniff"/>
<!--response-header name="content-security-policy" header-name="Content-Security-Policy" header-value="default-src https:"/-->
<response-header name="strict-transport-security" header-name="Strict-Transport-Security" header-value="max-age=31536000; includeSubDomains;"/>
<!-- Add line below -->
<response-header name="my-custom-header" header-name="my-custom-header" header-value="my-custom-value"/>
</filters>
</subsystem>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
7499 次 |
| 最近记录: |