Skip to content

Commit 2d2b75e

Browse files
authored
Merge pull request #1965 from heatmiser/nginx-csp-frame-ancestors
Replace add_header X-Frame-Options DENY with CSP frame-ancestors self in automation-controller.nginx.conf
2 parents 9220e98 + ae12af4 commit 2d2b75e

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

roles/code_server/tasks/codeserver_always.yml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,18 @@
11
---
2+
- name: Replace add_header X-Frame-Options DENY with CSP frame-ancestors self in automation-controller.nginx.conf
3+
ansible.builtin.lineinfile:
4+
path: /etc/nginx/conf.d/automation-controller.nginx.conf
5+
regexp: '^(.*)add_header X-Frame-Options \"DENY\"\;'
6+
line: >-
7+
\1add_header Content-Security-Policy "frame-ancestors 'self';";
8+
backrefs: yes
9+
owner: root
10+
group: root
11+
mode: '0644'
12+
register: add_header_csp
13+
retries: 10
14+
until: add_header_csp is not changed
15+
216
- name: Apply our systemd service file (instead of RPM file)
317
ansible.builtin.template:
418
src: code-server.service.j2
@@ -12,4 +26,4 @@
1226
name: code-server
1327
enabled: true
1428
state: restarted
15-
daemon_reload: true
29+
daemon_reload: true

0 commit comments

Comments
 (0)