FoxyRoles / ansible-dkim

Ansible role for opendkim with postfix on ubuntu setup
MIT License
21 stars 39 forks source link

Permissions/ownership on /etc/opendkim folder and key/ subfolder #11

Open jeanmonet opened 3 years ago

jeanmonet commented 3 years ago

Hi again,

After running the role (on Ubuntu 20.04 LTS with some specific security configuration), I get:

Jan  1 22:44:43 s89499 opendkim[179674]: can't load key from /etc/opendkim/keys/mail.private: Permission denied

The problem is that dkim_group (opendkim) doesn't have read permissions on all the directories in path.

https://github.com/FoxyRoles/ansible-dkim/blob/108f8c6f460aac488d37a03c0f909e6dec8c46ea/tasks/opendkim.yml#L19-L22

It might be a good idea if the role ensures:

Locally I used:

    - file:
        path: "{{ item }}"
        group: "{{ dkim_group }}"
        mode: g-w,g+r
      with_items:
        - "{{ dkim_opendkim_config_dir }}"
        - "{{ dkim_opendkim_config_dir }}/keys"
foxycode commented 3 years ago

@ulvida Can you look at this please? I don't use keys in subdirs as you are.