2022-01-07 09:06:18 +00:00
|
|
|
---
|
|
|
|
|
|
2022-03-30 16:18:11 +01:00
|
|
|
- name: "4.2.3 | PATCH | Ensure permissions on all logfiles are configured"
|
2023-01-12 11:38:53 +00:00
|
|
|
block:
|
|
|
|
|
- name: "4.2.3 | AUDIT | Ensure permissions on all logfiles are configured | find files"
|
2023-01-12 13:47:13 +00:00
|
|
|
ansible.builtin.find:
|
2023-01-12 11:38:53 +00:00
|
|
|
paths: "/var/log"
|
2023-01-12 15:01:59 +00:00
|
|
|
file_type: file
|
|
|
|
|
recurse: true
|
2023-10-19 13:19:07 +01:00
|
|
|
hidden: true
|
2023-01-12 11:38:53 +00:00
|
|
|
register: logfiles
|
|
|
|
|
|
2023-01-19 11:29:03 +00:00
|
|
|
- name: "4.2.3 | PATCH | Ensure permissions on all logfiles are configured | change permissions"
|
2023-01-12 11:38:53 +00:00
|
|
|
ansible.builtin.file:
|
2023-01-12 15:01:59 +00:00
|
|
|
path: "{{ item.path }}"
|
2024-02-12 16:21:31 +01:00
|
|
|
mode: "{{ '0600' if item.mode == '0600' else '0640' }}"
|
2023-01-12 15:01:59 +00:00
|
|
|
loop: "{{ logfiles.files }}"
|
|
|
|
|
loop_control:
|
|
|
|
|
label: "{{ item.path }}"
|
2023-01-19 11:29:03 +00:00
|
|
|
when:
|
|
|
|
|
- item.path != "/var/log/btmp"
|
|
|
|
|
- item.path != "/var/log/utmp"
|
|
|
|
|
- item.path != "/var/log/wtmp"
|
2022-01-07 09:06:18 +00:00
|
|
|
when:
|
|
|
|
|
- rhel9cis_rule_4_2_3
|
|
|
|
|
tags:
|
|
|
|
|
- level1-server
|
|
|
|
|
- level1-workstation
|
|
|
|
|
- patch
|
2022-03-30 16:18:11 +01:00
|
|
|
- logfiles
|
2022-01-07 09:06:18 +00:00
|
|
|
- rule_4.2.3
|