Skip to content
This repository was archived by the owner on Dec 26, 2020. It is now read-only.

Commit f50f22c

Browse files
authored
Merge pull request #294 from aqw/master
add SmartOS support
2 parents 6fddedc + 670be01 commit f50f22c

File tree

12 files changed

+36
-4
lines changed

12 files changed

+36
-4
lines changed

meta/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ galaxy_info:
2222
- name: Amazon
2323
- name: Fedora
2424
- name: Archlinux
25+
- name: SmartOS
2526
galaxy_tags:
2627
- system
2728
- security

tasks/crypto_hostkeys.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,21 @@
11
---
22
- name: set hostkeys according to openssh-version if openssh >= 5.3
33
set_fact:
4-
ssh_host_key_files: ['/etc/ssh/ssh_host_rsa_key']
4+
ssh_host_key_files:
5+
- "{{ ssh_host_keys_dir }}/ssh_host_rsa_key"
56
when: sshd_version is version('5.3', '>=')
67

78
- name: set hostkeys according to openssh-version if openssh >= 6.0
89
set_fact:
9-
ssh_host_key_files: ['/etc/ssh/ssh_host_rsa_key', '/etc/ssh/ssh_host_ecdsa_key']
10+
ssh_host_key_files:
11+
- "{{ ssh_host_keys_dir }}/ssh_host_rsa_key"
12+
- "{{ ssh_host_keys_dir }}/ssh_host_ecdsa_key"
1013
when: sshd_version is version('6.0', '>=')
1114

1215
- name: set hostkeys according to openssh-version if openssh >= 6.3
1316
set_fact:
14-
ssh_host_key_files: ['/etc/ssh/ssh_host_rsa_key', '/etc/ssh/ssh_host_ecdsa_key', '/etc/ssh/ssh_host_ed25519_key']
17+
ssh_host_key_files:
18+
- "{{ ssh_host_keys_dir }}/ssh_host_rsa_key"
19+
- "{{ ssh_host_keys_dir }}/ssh_host_ecdsa_key"
20+
- "{{ ssh_host_keys_dir }}/ssh_host_ed25519_key"
1521
when: sshd_version is version('6.3', '>=')

tasks/hardening.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
mode: '0600'
5151
owner: '{{ ssh_owner }}'
5252
group: '{{ ssh_group }}'
53-
validate: '/usr/sbin/sshd -T -C user=root -C host=localhost -C addr=localhost -C lport=22 -f %s'
53+
validate: '{{ sshd_path }} -T -C user=root -C host=localhost -C addr=localhost -C lport=22 -f %s'
5454
notify: restart sshd
5555
when: ssh_server_hardening | bool
5656

vars/Archlinux.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
---
2+
sshd_path: /usr/sbin/sshd
3+
ssh_host_keys_dir: '/etc/ssh'
14
sshd_service_name: sshd
25
ssh_owner: root
36
ssh_group: root

vars/Debian.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
---
2+
sshd_path: /usr/sbin/sshd
3+
ssh_host_keys_dir: '/etc/ssh'
24
sshd_service_name: ssh
35
ssh_owner: root
46
ssh_group: root

vars/Fedora.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
---
2+
sshd_path: /usr/sbin/sshd
3+
ssh_host_keys_dir: '/etc/ssh'
24
sshd_service_name: sshd
35
ssh_owner: root
46
ssh_group: root

vars/FreeBSD.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
---
2+
sshd_path: /usr/sbin/sshd
3+
ssh_host_keys_dir: '/etc/ssh'
24
sshd_service_name: sshd
35
ssh_owner: root
46
ssh_group: wheel

vars/OpenBSD.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
---
2+
sshd_path: /usr/sbin/sshd
3+
ssh_host_keys_dir: '/etc/ssh'
24
sshd_service_name: sshd
35
ssh_owner: root
46
ssh_group: wheel

vars/Oracle Linux.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
---
2+
sshd_path: /usr/sbin/sshd
3+
ssh_host_keys_dir: '/etc/ssh'
24
sshd_service_name: sshd
35
ssh_owner: root
46
ssh_group: root

vars/RedHat.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
---
2+
sshd_path: /usr/sbin/sshd
3+
ssh_host_keys_dir: '/etc/ssh'
24
sshd_service_name: sshd
35
ssh_owner: root
46
ssh_group: root

vars/RedHat_8.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
---
2+
sshd_path: /usr/sbin/sshd
3+
ssh_host_keys_dir: '/etc/ssh'
24
sshd_service_name: sshd
35
ssh_owner: root
46
ssh_group: root

vars/SmartOS.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
sshd_path: /usr/lib/ssh/sshd
3+
ssh_host_keys_dir: '/var/ssh'
4+
sshd_service_name: ssh
5+
ssh_owner: root
6+
ssh_group: root
7+
8+
ssh_pam_support: false

0 commit comments

Comments
 (0)