File tree Expand file tree Collapse file tree 2 files changed +24
-0
lines changed
Expand file tree Collapse file tree 2 files changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,8 @@ tomcat_checksum_url: "https://downloads.apache.org/tomcat/tomcat-{{ tomcat_major
2222tomcat_packages :
2323 - " tomcat{{ tomcat_major_version }}"
2424
25+ tomcat_secure_http_headers : true
26+
2527# #######################################
2628# Security Variables
2729# #######################################
Original file line number Diff line number Diff line change 6767 when : tomcat_conf_found.stat.exists == false
6868 tags : ['tomcat']
6969
70+ - name : Add HTTP Header Security Filter to web.xml
71+ ansible.builtin.blockinfile :
72+ path : " {{ _tomcat_catalina_base }}/conf/web.xml"
73+ insertbefore : " </web-app>"
74+ marker : " <!-- {mark} ANSIBLE MANAGED HTTP HEADER SECURITY FILTER -->"
75+ block : |
76+ <filter>
77+ <filter-name>httpHeaderSecurity</filter-name>
78+ <filter-class>org.apache.catalina.filters.HttpHeaderSecurityFilter</filter-class>
79+ <init-param>
80+ <param-name>antiClickJackingOption</param-name>
81+ <param-value>SAMEORIGIN</param-value>
82+ </init-param>
83+ </filter>
84+ <filter-mapping>
85+ <filter-name>httpHeaderSecurity</filter-name>
86+ <url-pattern>/*</url-pattern>
87+ <dispatcher>REQUEST</dispatcher>
88+ </filter-mapping>
89+ when : tomcat_secure_http_headers
90+ tags : ['tomcat']
91+
7092- name : secure catalina base config files
7193 file :
7294 path : ' {{ _tomcat_catalina_base }}/conf/{{ item }}'
You can’t perform that action at this time.
0 commit comments