Skip to content

Commit

Permalink
Merge pull request #1965 from heatmiser/nginx-csp-frame-ancestors
Browse files Browse the repository at this point in the history
Replace add_header X-Frame-Options DENY with CSP frame-ancestors self in automation-controller.nginx.conf
  • Loading branch information
IPvSean authored May 15, 2023
2 parents 9220e98 + ae12af4 commit 2d2b75e
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion roles/code_server/tasks/codeserver_always.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,18 @@
---
- name: Replace add_header X-Frame-Options DENY with CSP frame-ancestors self in automation-controller.nginx.conf
ansible.builtin.lineinfile:
path: /etc/nginx/conf.d/automation-controller.nginx.conf
regexp: '^(.*)add_header X-Frame-Options \"DENY\"\;'
line: >-
\1add_header Content-Security-Policy "frame-ancestors 'self';";
backrefs: yes
owner: root
group: root
mode: '0644'
register: add_header_csp
retries: 10
until: add_header_csp is not changed

- name: Apply our systemd service file (instead of RPM file)
ansible.builtin.template:
src: code-server.service.j2
Expand All @@ -12,4 +26,4 @@
name: code-server
enabled: true
state: restarted
daemon_reload: true
daemon_reload: true

0 comments on commit 2d2b75e

Please sign in to comment.