ansible-community / ansible-nomad

:watch: Ansible role for Nomad
https://galaxy.ansible.com/brianshumate/nomad
BSD 2-Clause "Simplified" License
294 stars 163 forks source link

Harden permissions for nomad directories #155

Open haxxboi opened 2 years ago

haxxboi commented 2 years ago

I'm building infrastructure with this and been checking permissions on files.

I've found loose permissions that can be read by anybody on the machine, first, on config files, these can have secret consul tokens and gossip encryption keys.

TLS directory seemed OK as private key is 600 restricted and certs are public.

However, /var/nomad is exposed to all which is extremely severe as below command works and prints vault token of allocation on debian 11 machine:

sudo -u nobody cat /var/nomad/alloc/db8014a5-30ca-ad43-6e96-60881fc66f17/run/secrets/vault_token

Do with this what you will.