Refactor SSH configuration in ansible-apply.yaml and update playbook execution with ECDSA private key
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
failed_when: false
|
||||
register: ssh_version
|
||||
tags:
|
||||
- roles::cis::sshd
|
||||
- sshd
|
||||
- sshd_config
|
||||
|
||||
@@ -13,6 +14,7 @@
|
||||
ansible.builtin.set_fact:
|
||||
ssh_installed_version: "{{ ssh_version.stderr | regex_search('^OpenSSH_([0-9+].[0-9]+)', '\\1') | join('.') | float }}" # noqa jinja[spacing]
|
||||
tags:
|
||||
- roles::cis::sshd
|
||||
- sshd
|
||||
- sshd_config
|
||||
|
||||
@@ -21,6 +23,7 @@
|
||||
path: /etc/sysconfig/sshd
|
||||
register: sysconfig_sshd
|
||||
tags:
|
||||
- roles::cis::sshd
|
||||
- sshd
|
||||
- sshd_config
|
||||
- M1041
|
||||
@@ -33,6 +36,7 @@
|
||||
regexp: ^\s*CRYPTO_POLICY.*$
|
||||
when: sysconfig_sshd.stat.exists
|
||||
tags:
|
||||
- roles::cis::sshd
|
||||
- sshd
|
||||
- CCE-80939-2
|
||||
- M1041
|
||||
@@ -44,6 +48,7 @@
|
||||
changed_when: false
|
||||
failed_when: false
|
||||
tags:
|
||||
- roles::cis::sshd
|
||||
- sshd
|
||||
- sshd_config
|
||||
- M1041
|
||||
@@ -53,6 +58,7 @@
|
||||
path: /etc/ssh/sshd_config.d
|
||||
register: sshd_config_d
|
||||
tags:
|
||||
- roles::cis::sshd
|
||||
- sshd
|
||||
- sshd_config
|
||||
- M1041
|
||||
@@ -65,6 +71,7 @@
|
||||
group: root
|
||||
mode: "0600"
|
||||
tags:
|
||||
- roles::cis::sshd
|
||||
- sshd
|
||||
- sshd_config
|
||||
|
||||
@@ -83,6 +90,7 @@
|
||||
- Restart sshd service
|
||||
- Restart ssh service
|
||||
tags:
|
||||
- roles::cis::sshd
|
||||
- sshd
|
||||
- sshd_config
|
||||
- CCE-80895-6
|
||||
@@ -137,6 +145,7 @@
|
||||
- Restart sshd service
|
||||
- Restart ssh service
|
||||
tags:
|
||||
- roles::cis::sshd
|
||||
- sshd
|
||||
- sshd_config
|
||||
- CCE-80895-6
|
||||
@@ -184,6 +193,7 @@
|
||||
state: absent
|
||||
when: sshd_config_d.stat.exists and grep_include.rc == 0
|
||||
tags:
|
||||
- roles::cis::sshd
|
||||
- sshd
|
||||
- sshd_config
|
||||
|
||||
@@ -196,6 +206,7 @@
|
||||
excludes: "*.pub"
|
||||
register: ssh_host_keys
|
||||
tags:
|
||||
- roles::cis::sshd
|
||||
- sshd
|
||||
- M1022
|
||||
- M1041
|
||||
@@ -211,6 +222,7 @@
|
||||
loop_control:
|
||||
label: "{{ item.path }}"
|
||||
tags:
|
||||
- roles::cis::sshd
|
||||
- sshd
|
||||
- CCE-82424-3
|
||||
- CIS-UBUNTU2004-5.3.2
|
||||
@@ -222,6 +234,7 @@
|
||||
path: /etc/ssh/ssh_config.d
|
||||
register: ssh_config_d
|
||||
tags:
|
||||
- roles::cis::ssh
|
||||
- ssh
|
||||
- ssh_config
|
||||
- M1041
|
||||
@@ -236,6 +249,7 @@
|
||||
owner: root
|
||||
group: root
|
||||
tags:
|
||||
- roles::cis::ssh
|
||||
- ssh
|
||||
- ssh_config
|
||||
- CCE-82880-6
|
||||
|
||||
Reference in New Issue
Block a user