2022-05-02 15:00:29 -05:00
|
|
|
---
|
|
|
|
|
|
|
|
- name: Install lynis
|
|
|
|
register: lynis_pkg
|
|
|
|
become: yes
|
|
|
|
package:
|
|
|
|
name:
|
|
|
|
- lynis
|
|
|
|
- arch-audit
|
|
|
|
- clamav
|
|
|
|
state: present
|
|
|
|
|
|
|
|
- name: lynis config
|
|
|
|
register: lynis_conf
|
|
|
|
become: yes
|
|
|
|
copy:
|
|
|
|
src: lynis/custom.prf
|
|
|
|
dest: /etc/lynis/custom.prf
|
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: 0600
|
|
|
|
|
2022-05-03 16:57:52 -05:00
|
|
|
- name: Scanning services
|
2022-05-02 15:00:29 -05:00
|
|
|
become: yes
|
2022-05-04 10:30:23 -05:00
|
|
|
register: lynis_svc
|
2022-05-02 15:00:29 -05:00
|
|
|
copy:
|
|
|
|
src: "lynis/{{ item }}"
|
|
|
|
dest: /usr/lib/systemd/system/
|
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: 0664
|
|
|
|
loop:
|
2022-05-03 16:57:52 -05:00
|
|
|
- sharingan-scan.service
|
|
|
|
- sharingan-scan.timer
|
|
|
|
|
|
|
|
- name: Scanning services
|
|
|
|
become: yes
|
2022-05-04 10:30:23 -05:00
|
|
|
register: clam_svc
|
2022-05-03 16:57:52 -05:00
|
|
|
copy:
|
|
|
|
src: "clamav/{{ item }}"
|
|
|
|
dest: /usr/lib/systemd/system/
|
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: 0664
|
|
|
|
loop:
|
2022-05-02 15:00:29 -05:00
|
|
|
- freshclam.service
|
|
|
|
- freshclam.timer
|
2022-05-04 10:30:23 -05:00
|
|
|
- clamscan.service
|
|
|
|
- clamscan.timer
|
|
|
|
|
|
|
|
- systemd:
|
|
|
|
daemon_reload: yes
|
|
|
|
become: yes
|
|
|
|
when: clam_svc.changed or lynis_svc.changed
|
|
|
|
|
2022-05-02 15:00:29 -05:00
|
|
|
|
|
|
|
- name: Enable timers
|
|
|
|
become: yes
|
|
|
|
loop:
|
|
|
|
- freshclam.timer
|
2022-05-03 16:57:52 -05:00
|
|
|
- sharingan-scan.timer
|
2022-05-02 15:00:29 -05:00
|
|
|
service:
|
|
|
|
name: "{{ item }}"
|
|
|
|
state: restarted
|
|
|
|
enabled: yes
|