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:
|
2022-11-20 20:03:01 -06:00
|
|
|
src: "lynis/{{ item }}"
|
2022-05-02 15:00:29 -05:00
|
|
|
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
|
|
|
|
|
2022-05-04 10:30:23 -05:00
|
|
|
- systemd:
|
|
|
|
daemon_reload: yes
|
|
|
|
become: yes
|
2024-03-07 12:27:21 -06:00
|
|
|
when: lynis_svc.changed
|
2022-05-02 15:00:29 -05:00
|
|
|
|
|
|
|
- name: Enable timers
|
|
|
|
become: yes
|
|
|
|
service:
|
2024-03-07 12:27:21 -06:00
|
|
|
name: sharingan-scan.timer
|
2022-05-02 15:00:29 -05:00
|
|
|
state: restarted
|
|
|
|
enabled: yes
|
2024-03-07 12:27:21 -06:00
|
|
|
|
|
|
|
- import_tasks: "./vscan.yml"
|
|
|
|
when: vscan_enabled is defined
|