Skip to content
Snippets Groups Projects
Verified Commit de39d1e5 authored by Robin Sonnabend's avatar Robin Sonnabend
Browse files

Fix key permissions

parent bbd09924
No related branches found
No related tags found
No related merge requests found
Pipeline #2361 passed
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
- name: ensure we have a private key - name: ensure we have a private key
shell: shell:
cmd: "wg genkey | tee {{ item.key }}.key | wg pubkey > {{ item.key }}.pub" cmd: "umask 077 && wg genkey | tee {{ item.key }}.key | wg pubkey > {{ item.key }}.pub"
chdir: /etc/wireguard chdir: /etc/wireguard
creates: "/etc/wireguard/{{ item.key }}.key" creates: "/etc/wireguard/{{ item.key }}.key"
with_dict: "{{ wireguard_interfaces }}" with_dict: "{{ wireguard_interfaces }}"
...@@ -13,6 +13,14 @@ ...@@ -13,6 +13,14 @@
- restart wireguard - restart wireguard
no_log: true no_log: true
- name: ensure the key is not accessible to users
file:
path: "/etc/wireguard/{{ item.key }}.key"
owner: root
group: root
mode: '0600'
with_dict: "{{ wireguard_interfaces }}"
- name: get the pubkey - name: get the pubkey
slurp: slurp:
src: "/etc/wireguard/{{ item.key }}.pub" src: "/etc/wireguard/{{ item.key }}.pub"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment