Skip to content

Commit

Permalink
Merge pull request dev-sec#294 from aqw/master
Browse files Browse the repository at this point in the history
add SmartOS support
  • Loading branch information
rndmh3ro committed Jul 28, 2020
2 parents 10554f2 + 855f8a9 commit 1a55251
Show file tree
Hide file tree
Showing 12 changed files with 36 additions and 4 deletions.
1 change: 1 addition & 0 deletions meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ galaxy_info:
- name: Amazon
- name: Fedora
- name: Archlinux
- name: SmartOS
galaxy_tags:
- system
- security
Expand Down
12 changes: 9 additions & 3 deletions tasks/crypto_hostkeys.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
---
- name: set hostkeys according to openssh-version if openssh >= 5.3
set_fact:
ssh_host_key_files: ['/etc/ssh/ssh_host_rsa_key']
ssh_host_key_files:
- "{{ ssh_host_keys_dir }}/ssh_host_rsa_key"
when: sshd_version is version('5.3', '>=')

- name: set hostkeys according to openssh-version if openssh >= 6.0
set_fact:
ssh_host_key_files: ['/etc/ssh/ssh_host_rsa_key', '/etc/ssh/ssh_host_ecdsa_key']
ssh_host_key_files:
- "{{ ssh_host_keys_dir }}/ssh_host_rsa_key"
- "{{ ssh_host_keys_dir }}/ssh_host_ecdsa_key"
when: sshd_version is version('6.0', '>=')

- name: set hostkeys according to openssh-version if openssh >= 6.3
set_fact:
ssh_host_key_files: ['/etc/ssh/ssh_host_rsa_key', '/etc/ssh/ssh_host_ecdsa_key', '/etc/ssh/ssh_host_ed25519_key']
ssh_host_key_files:
- "{{ ssh_host_keys_dir }}/ssh_host_rsa_key"
- "{{ ssh_host_keys_dir }}/ssh_host_ecdsa_key"
- "{{ ssh_host_keys_dir }}/ssh_host_ed25519_key"
when: sshd_version is version('6.3', '>=')
2 changes: 1 addition & 1 deletion tasks/hardening.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
mode: '0600'
owner: '{{ ssh_owner }}'
group: '{{ ssh_group }}'
validate: '/usr/sbin/sshd -T -C user=root -C host=localhost -C addr=localhost -C lport=22 -f %s'
validate: '{{ sshd_path }} -T -C user=root -C host=localhost -C addr=localhost -C lport=22 -f %s'
notify: restart sshd
when: ssh_server_hardening | bool

Expand Down
3 changes: 3 additions & 0 deletions vars/Archlinux.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
---
sshd_path: /usr/sbin/sshd
ssh_host_keys_dir: '/etc/ssh'
sshd_service_name: sshd
ssh_owner: root
ssh_group: root
Expand Down
2 changes: 2 additions & 0 deletions vars/Debian.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
---
sshd_path: /usr/sbin/sshd
ssh_host_keys_dir: '/etc/ssh'
sshd_service_name: ssh
ssh_owner: root
ssh_group: root
Expand Down
2 changes: 2 additions & 0 deletions vars/Fedora.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
---
sshd_path: /usr/sbin/sshd
ssh_host_keys_dir: '/etc/ssh'
sshd_service_name: sshd
ssh_owner: root
ssh_group: root
Expand Down
2 changes: 2 additions & 0 deletions vars/FreeBSD.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
---
sshd_path: /usr/sbin/sshd
ssh_host_keys_dir: '/etc/ssh'
sshd_service_name: sshd
ssh_owner: root
ssh_group: wheel
2 changes: 2 additions & 0 deletions vars/OpenBSD.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
---
sshd_path: /usr/sbin/sshd
ssh_host_keys_dir: '/etc/ssh'
sshd_service_name: sshd
ssh_owner: root
ssh_group: wheel
Expand Down
2 changes: 2 additions & 0 deletions vars/Oracle Linux.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
---
sshd_path: /usr/sbin/sshd
ssh_host_keys_dir: '/etc/ssh'
sshd_service_name: sshd
ssh_owner: root
ssh_group: root
Expand Down
2 changes: 2 additions & 0 deletions vars/RedHat.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
---
sshd_path: /usr/sbin/sshd
ssh_host_keys_dir: '/etc/ssh'
sshd_service_name: sshd
ssh_owner: root
ssh_group: root
Expand Down
2 changes: 2 additions & 0 deletions vars/RedHat_8.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
---
sshd_path: /usr/sbin/sshd
ssh_host_keys_dir: '/etc/ssh'
sshd_service_name: sshd
ssh_owner: root
ssh_group: root
Expand Down
8 changes: 8 additions & 0 deletions vars/SmartOS.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
sshd_path: /usr/lib/ssh/sshd
ssh_host_keys_dir: '/var/ssh'
sshd_service_name: ssh
ssh_owner: root
ssh_group: root

ssh_pam_support: false

0 comments on commit 1a55251

Please sign in to comment.