mirror of
https://github.com/dev-sec/ansible-collection-hardening
synced 2024-11-10 09:14:18 +00:00
103135ce9a
Signed-off-by: Martin Schurz <Martin.Schurz@t-systems.com>
28 lines
789 B
YAML
28 lines
789 B
YAML
---
|
|
# Granting write access to this directory for non-privileged users could provide
|
|
# them the means for gaining unauthorized elevated privileges.
|
|
# Granting read access to this directory could give an unprivileged user insight
|
|
# in how to gain elevated privileges or circumvent auditing controls.
|
|
# CIS 5.1.2 - CIS 5.1.7
|
|
#
|
|
- name: Find cron files and directories
|
|
find:
|
|
paths:
|
|
- /etc
|
|
patterns:
|
|
- cron.hourly
|
|
- cron.daily
|
|
- cron.weekly
|
|
- cron.monthly
|
|
- cron.d
|
|
- crontab
|
|
file_type: any
|
|
register: cron_directories
|
|
|
|
- name: Ensure permissions on cron files and directories are configured
|
|
ansible.builtin.file:
|
|
path: "{{ item.path }}"
|
|
owner: root
|
|
group: root
|
|
mode: og-rwx
|
|
with_items: "{{ cron_directories.files }}"
|