- name: Gather the package facts
package_facts:
manager: auto
tags:
- CJIS-5.10.1.3
- NIST-800-53-CM-6(a) - NIST-800-53-SI-7
- NIST-800-53-SI-7(1)
- PCI-DSS-Req-11.5
- PCI-DSSv4-11.5.2
- aide_periodic_checking_systemd_timer
- configure_strategy
- low_complexity
- low_disruption
- medium_severity
- no_reboot_needed
- name: Configure Systemd Timer Execution of AIDE - Define AIDE Periodic Check Service
ansible.builtin.blockinfile:
create: true
dest: /etc/systemd/system/aidecheck.service
owner: root
group: root
mode: '0644'
block: |
[Unit]
Description=Aide Check
[Service]
Type=simple
ExecStart=/usr/sbin/aide --check
[Install]
WantedBy=multi-user.target
when:
- ansible_virtualization_type not in ["docker", "lxc", "openvz", "podman", "container"]
- '"aide" in ansible_facts.packages'
tags:
- CJIS-5.10.1.3
- NIST-800-53-CM-6(a)
- NIST-800-53-SI-7
- NIST-800-53-SI-7(1)
- PCI-DSS-Req-11.5
- PCI-DSSv4-11.5.2
- aide_periodic_checking_systemd_timer
- configure_strategy
- low_complexity
- low_disruption
- medium_severity
- no_reboot_needed
- name: Configure Systemd Timer Execution of AIDE - Define AIDE Periodic Check Service
Timer
ansible.builtin.blockinfile:
create: true
dest: /etc/systemd/system/aidecheck.timer
owner: root
group: root
mode: '0644'
block: |
[Unit]
Description=Aide check every day at 5AM
[Timer]
OnCalendar=*-*-* 05:00:00
Unit=aidecheck.service
[Install]
WantedBy=multi-user.target
when:
- ansible_virtualization_type not in ["docker", "lxc", "openvz", "podman", "container"]
- '"aide" in ansible_facts.packages'
tags:
- CJIS-5.10.1.3
- NIST-800-53-CM-6(a)
- NIST-800-53-SI-7
- NIST-800-53-SI-7(1)
- PCI-DSS-Req-11.5
- PCI-DSSv4-11.5.2
- aide_periodic_checking_systemd_timer
- configure_strategy
- low_complexity
- low_disruption
- medium_severity
- no_reboot_needed
- name: Configure Systemd Timer Execution of AIDE - Ensure AIDE Service is Enabled
ansible.builtin.systemd:
name: aidecheck.service
enabled: true
daemon_reload: true
masked: false
when:
- ansible_virtualization_type not in ["docker", "lxc", "openvz", "podman", "container"]
- '"aide" in ansible_facts.packages'
tags:
- CJIS-5.10.1.3
- NIST-800-53-CM-6(a)
- NIST-800-53-SI-7
- NIST-800-53-SI-7(1)
- PCI-DSS-Req-11.5
- PCI-DSSv4-11.5.2
- aide_periodic_checking_systemd_timer
- configure_strategy
- low_complexity
- low_disruption
- medium_severity
- no_reboot_needed
- name: Configure Systemd Timer Execution of AIDE - Ensure AIDE Service Timer is Enabled
ansible.builtin.systemd:
name: aidecheck.timer
state: started
enabled: true
daemon_reload: true
masked: false
when:
- ansible_virtualization_type not in ["docker", "lxc", "openvz", "podman", "container"]
- '"aide" in ansible_facts.packages'
tags:
- CJIS-5.10.1.3
- NIST-800-53-CM-6(a)
- NIST-800-53-SI-7
- NIST-800-53-SI-7(1)
- PCI-DSS-Req-11.5
- PCI-DSSv4-11.5.2
- aide_periodic_checking_systemd_timer
- configure_strategy
- low_complexity
- low_disruption
- medium_severity
- no_reboot_needed