Rewrite system account detection and hardening and create tests (#621)

* rewrite system account detection and hardening

* resolve failures created when resolving merge conflicts

Signed-off-by: Sebastian Gumprich <[email protected]>

* add tests for shell removal tasks

Signed-off-by: Sebastian Gumprich <[email protected]>

* Update molecule/os_hardening/prepare.yml

Signed-off-by: Martin Schurz <[email protected]>

* split tasks for locking and setting shell

Signed-off-by: Martin Schurz <[email protected]>

* fix some more linting

Signed-off-by: Sebastian Gumprich <[email protected]>

Signed-off-by: Sebastian Gumprich <[email protected]>
Signed-off-by: Martin Schurz <[email protected]>
Co-authored-by: donestefan <[email protected]>
Co-authored-by: schurzi <[email protected]>
This commit is contained in:
authored and GitHub committed 2023-01-27 11:01:03 +01:00
1 parent f1169749f4
commit 89138be4ec
10 files changed
+54 -59

No files matched your search

+1 -1
View File
@@ -93,7 +93,7 @@
group: "{{ ssh_group }}"
when: ssh_client_hardening | bool
- name: Check if {{ sshd_moduli_file }} contains weak DH parameters
- name: Check if for weak DH parameters in {{ sshd_moduli_file }}
ansible.builtin.shell: awk '$5 < {{ sshd_moduli_minimum }}' {{ sshd_moduli_file }}
register: sshd_register_moduli
changed_when: false
+1 -1
View File
@@ -4,7 +4,7 @@
name: "{{ ssh_selinux_packages }}"
state: present
- name: Authorize {{ ssh_server_ports }} ports for selinux
- name: Authorize the following ports for selinux - {{ ssh_server_ports }}
community.general.seport:
ports: "{{ item }}"
proto: tcp