Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Harden permissions for nomad directories #155

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 6 additions & 5 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
state: directory
owner: "{{ nomad_user }}"
group: "{{ nomad_group }}"
mode: "0700"
with_items:
- "{{ nomad_data_dir }}"
- "{{ nomad_plugin_dir }}"
Expand All @@ -62,15 +63,15 @@
state: directory
owner: root
group: root
mode: 0755
mode: 0700

- name: Base configuration
template:
src: base.hcl.j2
dest: "{{ nomad_config_dir }}/base.hcl"
owner: root
group: root
mode: 0644
mode: 0600
notify:
- restart nomad

Expand All @@ -91,7 +92,7 @@
dest: "{{ nomad_config_dir }}/server.hcl"
owner: root
group: root
mode: 0644
mode: 0600
when:
- _nomad_node_server | bool
notify:
Expand All @@ -113,7 +114,7 @@
dest: "{{ nomad_config_dir }}/client.hcl"
owner: root
group: root
mode: 0644
mode: 0600
when:
- _nomad_node_client | bool
notify:
Expand All @@ -135,7 +136,7 @@
dest: "{{ nomad_config_dir }}/custom.json"
owner: root
group: root
mode: 0644
mode: 0600
when:
- nomad_config_custom is defined
notify:
Expand Down
6 changes: 3 additions & 3 deletions tasks/tls.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
state: directory
owner: "{{ nomad_user }}"
group: "{{ nomad_group }}"
mode: 0755
mode: 0700

- name: Copy CA certificate
copy:
Expand All @@ -17,7 +17,7 @@
dest: "{{ nomad_tls_dir }}/{{ nomad_ca_file | basename }}"
owner: "{{ nomad_user }}"
group: "{{ nomad_group }}"
mode: 0644
mode: 0600
notify: restart nomad

- name: Copy certificate
Expand All @@ -27,7 +27,7 @@
dest: "{{ nomad_tls_dir }}/{{ nomad_cert_file | basename }}"
owner: "{{ nomad_user }}"
group: "{{ nomad_group }}"
mode: 0644
mode: 0600
notify: restart nomad

- name: Copy key
Expand Down