2021-01-31 17:21:39 -06:00
|
|
|
---
|
2021-02-03 21:17:48 -06:00
|
|
|
# Lynis hardness check.
|
2021-01-31 17:21:39 -06:00
|
|
|
|
2021-02-02 21:28:17 -06:00
|
|
|
- name: General | Tests | Lynis | Install
|
2021-01-31 17:17:14 -06:00
|
|
|
git:
|
2020-12-28 20:57:05 -06:00
|
|
|
repo: https://github.com/CISOfy/lynis
|
2020-12-28 21:32:28 -06:00
|
|
|
dest: "{{ lynis_install_dir }}"
|
2020-12-28 20:57:05 -06:00
|
|
|
clone: yes
|
|
|
|
force: yes
|
|
|
|
|
2021-07-11 11:11:33 -05:00
|
|
|
- name: General | Tests | Lynis | Ensure Permissions (Looking at you Parrot OS!)
|
|
|
|
file:
|
|
|
|
path: "{{ lynis_install_dir }}"
|
|
|
|
state: directory
|
2021-07-11 12:09:33 -05:00
|
|
|
mode: '0644'
|
2021-07-11 11:11:33 -05:00
|
|
|
owner: root
|
2021-07-13 08:04:49 -05:00
|
|
|
group: "{{ root_group }}"
|
2021-07-11 11:11:33 -05:00
|
|
|
recurse: yes
|
2021-07-11 11:08:08 -05:00
|
|
|
|
2021-07-11 12:09:33 -05:00
|
|
|
- name: General | Tests | Lynis | Ensure Permissions 2
|
|
|
|
file:
|
|
|
|
path: "{{ lynis_install_dir }}/lynis"
|
|
|
|
mode: '0755'
|
|
|
|
|
2021-02-02 21:28:17 -06:00
|
|
|
- name: General | Tests | Lynis | Run System Audit
|
2021-02-06 07:27:57 -06:00
|
|
|
shell: "{{ lynis_install_dir }}/lynis audit system --no-colors > {{ lynis_report }} 2>&1"
|
|
|
|
args:
|
|
|
|
executable: "{{ bash_exec.stdout }}"
|
2020-12-28 21:19:01 -06:00
|
|
|
|
2021-02-02 21:28:17 -06:00
|
|
|
- name: General | Tests | Lynis | Make Report Readable
|
2021-01-31 17:17:14 -06:00
|
|
|
file:
|
2021-01-31 13:55:18 -06:00
|
|
|
path: "{{ lynis_report }}"
|
2021-02-06 07:37:31 -06:00
|
|
|
mode: '0777'
|