dtoch56.ssh
ssh-role
SSH Server and client configuration
Based on Mozilla InfoSec recommendations: https://infosec.mozilla.org/guidelines/openssh.html
Requirements
None.
Role Variables
Available variables are listed below, along with default values (see defaults/main.yml):
| Variable | Description | Default |
|---|---|---|
| ssh_configure_server | true | |
| ssh_configure_client | true | |
| ssh_port | Ssh-server listening port | 22 |
| ssh_ansible_user | Account for Ansible | ansible |
| ssh_users | List of accounts to accept incoming SSH connections | {} |
| ssh_allow_tcp_forwarding | Allow tunneling out via SSH | False |
| ssh_host_key_algorithms | Ref | |
| ssh_kex_algorithms | Ref | |
| ssh_ciphers | Ref | |
| ssh_macs | Ref | |
| sshd_host_key_algorithms | Host keys the client should accepts | Ref |
| sshd_kex_algorithms | Specifies the available KEX (Key Exchange) algorithms | Ref |
| sshd_ciphers | Specifies the ciphers allowed | Ref |
| sshd_macs | Specifies the available MAC algorithms | Ref |
| sshd_ca_signature_algorithms | Allow this incoming sessions only | Ref |
| sshd_hostbased_accepted_key_types | Ref | |
| sshd_pubkey_accepted_key_types | Ref |
HostKeyAlgorithms
Defaults:
- ssh-ed25519-cert-v01@openssh.com
- ssh-rsa-cert-v01@openssh.com
- ssh-ed25519,ssh-rsa
- ecdsa-sha2-nistp521-cert-v01@openssh.com
- ecdsa-sha2-nistp384-cert-v01@openssh.com
- ecdsa-sha2-nistp256-cert-v01@openssh.com
- ecdsa-sha2-nistp521
- ecdsa-sha2-nistp384
- ecdsa-sha2-nistp256
KexAlgorithms
Defaults:
- curve25519-sha256@libssh.org
- ecdh-sha2-nistp521
- ecdh-sha2-nistp384
- ecdh-sha2-nistp256
- diffie-hellman-group-exchange-sha256
Ciphers
Defaults:
- chacha20-poly1305@openssh.com
- aes256-gcm@openssh.com
- aes128-gcm@openssh.com
- aes256-ctr
- aes192-ctr
- aes128-ctr
MACs
Defaults:
- hmac-sha2-512-etm@openssh.com
- hmac-sha2-256-etm@openssh.com
- umac-128-etm@openssh.com
- hmac-sha2-512
- hmac-sha2-256
- umac-128@openssh.com
HostKeyAlgorithms
Defaults:
- ssh-ed25519-cert-v01@openssh.com
- ssh-ed25519
KexAlgorithms
Defaults:
Ciphers
Defaults:
MACs
Defaults:
- hmac-sha2-512
- hmac-sha2-512-etm@openssh.com
CASignatureAlgorithms
Defaults:
- ssh-ed25519
HostbasedAcceptedKeyTypes
Defaults:
- ssh-ed25519
PubkeyAcceptedKeyTypes
Defaults:
- ssh-ed25519
Dependencies
None.
Example Playbook
- hosts: servers
roles:
- { role: dtoch56.ssh }
License
MIT / BSD
Author Information
This role was created in 2021 by Max Mudrichenko.
Development
pip install pipenv
pipenv install
