37 lines
894 B
YAML
37 lines
894 B
YAML
---
|
|
# CIS 2.4.1.x: cron/at auf autorisierte Nutzer beschraenken.
|
|
|
|
- name: cron.deny/at.deny entfernen (deny-Listen sind fehleranfaelliger als allow-Listen)
|
|
ansible.builtin.file:
|
|
path: "{{ item }}"
|
|
state: absent
|
|
loop:
|
|
- /etc/cron.deny
|
|
- /etc/at.deny
|
|
|
|
- name: cron.allow / at.allow auf root und den Jumphost-Service-User beschraenken
|
|
ansible.builtin.copy:
|
|
dest: "{{ item }}"
|
|
owner: root
|
|
group: root
|
|
mode: "0600"
|
|
content: |
|
|
root
|
|
loop:
|
|
- /etc/cron.allow
|
|
- /etc/at.allow
|
|
|
|
- name: Berechtigungen der cron-Verzeichnisse absichern (CIS 2.4.1.7-2.4.1.11)
|
|
ansible.builtin.file:
|
|
path: "{{ item }}"
|
|
owner: root
|
|
group: root
|
|
mode: "0700"
|
|
loop:
|
|
- /etc/cron.d
|
|
- /etc/cron.daily
|
|
- /etc/cron.hourly
|
|
- /etc/cron.monthly
|
|
- /etc/cron.weekly
|
|
ignore_errors: true # nicht jedes Basis-Image legt alle Verzeichnisse an
|