Hyperling b162731c29
General Improvements (#36)
* Add at and reword comment.

* Add cronie, thought this was already done but last pull request got wonky.

* Zypper is not happy about asking Brave repo to be added multiple times.

* Replace deprecated `include` commands.

* Add gcc.

* Add another cc command for openSUSE.

* include_tasks is not supporting ignore_errors like include used to, move to individual tasks.

* Do a better job of removing libreoffice from local package manager.

* Enhance reports.

* Add basic VIM setup.

* Undo some lynis changes, fix folder permissions so users can view.

* Change lynis back to chdir and local execution.

* Add doas.

* Add check against old usage of setup.sh BRANCH.

* Greatly reduce number of tasks, create temp file while building report.

* Create temp file while building report.
2023-02-19 10:04:10 -06:00

58 lines
1.4 KiB
YAML

---
# Lynis hardness check.
- name: General | Tests | Lynis | Set Facts
set_fact:
lynis_file: "{{ user_user.home }}/Reports/{{ lynis_report }}"
- name: General | Tests | Lynis | Set Facts 2
set_fact:
lynis_temp_file: "{{ lynis_file }}.tmp"
- name: General | Tests | Lynis | Rename Old Install
shell: mv "/usr/local/lynis" "/usr/local/src/"
ignore_errors: yes
- name: General | Tests | Lynis | Install
git:
repo: https://github.com/CISOfy/lynis
dest: "{{ lynis_install_dir }}"
clone: yes
force: yes
ignore_errors: yes
- name: General | Tests | Lynis | Ensure Permissions (Looking at you Parrot OS!)
file:
path: "{{ lynis_install_dir }}"
state: directory
mode: '0644'
owner: root
group: "{{ root_group }}"
recurse: yes
- name: General | Tests | Lynis | Ensure Permissions 2
file:
path: "{{ lynis_install_dir }}/lynis"
mode: '0755'
- name: General | Tests | Lynis | Ensure Folder Permissions
file:
path: "{{ lynis_install_dir }}"
state: directory
mode: '0755'
recurse: no
- name: General | Tests | Lynis | Run System Audit
shell: "{{ item }}"
loop:
- "./lynis audit system --no-colors > {{ lynis_temp_file }} 2>&1"
- "mv {{ lynis_temp_file }} {{ lynis_file }}"
args:
executable: "{{ bash_exec.stdout }}"
chdir: "{{ lynis_install_dir }}"
- name: General | Tests | Lynis | Make Report Readable
file:
path: "{{ lynis_file }}"
mode: '0644'