-
Notifications
You must be signed in to change notification settings - Fork 739
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Sevan Murriguian-Watrin <git@byh0ki.fr>
- Loading branch information
Showing
9 changed files
with
31 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
--- | ||
|
||
- name: Install openssh package | ||
ansible.builtin.package: | ||
name: "{{ ssh_pkg_name }}" | ||
state: present | ||
|
||
# see https://github.com/dev-sec/ansible-collection-hardening/issues/763 | ||
- name: Change Debian/Ubuntu systems so ssh starts traditionally instead of socket-activated | ||
ansible.builtin.include_tasks: disable-systemd-socket.yml | ||
when: | ||
- ssh_server_hardening | bool | ||
- ssh_server_enabled | bool | ||
- (ansible_facts.distribution == 'Ubuntu' and ansible_facts.distribution_major_version is version('22.04', '>=')) or | ||
(ansible_facts.os_family == 'Debian' and ansible_facts.distribution_major_version is version('12', '>=')) | ||
|
||
- name: Enable or disable sshd service | ||
ansible.builtin.service: | ||
name: "{{ sshd_service_name }}" | ||
enabled: "{{ ssh_server_service_enabled }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
--- | ||
ssh_pkg_name: ssh | ||
sshd_path: /usr/sbin/sshd | ||
ssh_host_keys_dir: /etc/ssh | ||
sshd_service_name: sshd | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
--- | ||
ssh_pkg_name: ssh | ||
sshd_path: /usr/sbin/sshd | ||
ssh_host_keys_dir: /etc/ssh | ||
sshd_service_name: sshd | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
--- | ||
ssh_pkg_name: "openssh-server openssh-client" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,7 @@ | ||
--- | ||
|
||
ssh_pkg_name: openssh | ||
|
||
ssh_macs_53_default: | ||
- hmac-ripemd160 | ||
- hmac-sha1 | ||
|