Skip to content

Commit

Permalink
Merge pull request #23 from Dunedan/umask-077
Browse files Browse the repository at this point in the history
Set a more restrictive default umask
  • Loading branch information
Dunedan authored Mar 19, 2024
2 parents 3670ee5 + 32f55e0 commit 8ba20e3
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions roles/misc/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,31 @@
---
- name: Set the default umask to 077
ansible.builtin.lineinfile:
path: /etc/login.defs
regexp: '^UMASK\t'
line: "UMASK\t\t077"
state: present

- name: Use pam_umask to enforce the file mode creation umask
ansible.builtin.lineinfile:
path: /etc/pam.d/common-session
regexp: 'pam_umask\.so'
line: "session\toptional\tpam_umask.so"
state: present

- name: Get all skeleton files
ansible.builtin.find:
paths: /etc/skel
hidden: true
recurse: true
register: skeleton_files

- name: Change file permissions of skeleton files
ansible.builtin.file:
path: "{{ item.path }}"
mode: 0700
loop: "{{ skeleton_files.files }}"

- name: Ensure undesired ntp services aren't installed
ansible.builtin.apt:
name:
Expand Down

0 comments on commit 8ba20e3

Please sign in to comment.