-
Notifications
You must be signed in to change notification settings - Fork 718
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
16 changed files
with
53 additions
and
15 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
--- | ||
|
||
# true if IPv6 is needed | ||
network_ipv6_enable: true # sshd + ssh | ||
|
||
|
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,23 @@ | ||
--- | ||
|
||
- name: Install openssh package(s) | ||
ansible.builtin.package: | ||
name: "{{ pkg }}" | ||
state: present | ||
loop: "{{ ssh_pkgs }}" | ||
loop_control: | ||
loop_var: pkg | ||
|
||
# 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
--- | ||
ssh_pkgs: | ||
- openssh | ||
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,6 @@ | ||
--- | ||
ssh_pkgs: | ||
- openssh | ||
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 |
---|---|---|
@@ -1,4 +1,6 @@ | ||
--- | ||
ssh_pkgs: | ||
- openssh | ||
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,6 @@ | ||
--- | ||
ssh_pkgs: | ||
- openssh | ||
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,6 @@ | ||
--- | ||
ssh_pkgs: | ||
- openssh-portable | ||
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 |
---|---|---|
@@ -1,4 +1,6 @@ | ||
--- | ||
ssh_pkgs: | ||
- openssh | ||
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,6 @@ | ||
--- | ||
ssh_pkgs: | ||
- openssh | ||
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,6 @@ | ||
--- | ||
ssh_pkgs: | ||
- openssh | ||
sshd_path: /usr/lib/ssh/sshd | ||
ssh_host_keys_dir: /var/ssh | ||
sshd_service_name: ssh | ||
|
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,6 @@ | ||
--- | ||
ssh_pkgs: | ||
- openssh | ||
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_macs_53_default: | ||
- hmac-ripemd160 | ||
- hmac-sha1 | ||
|