Ansible playbook to setup an SSH bastion server and clients. Clients can be configured in 'standalone' mode.
Only really matters if the key gets compromised, in which case i'm fucked anyway! |
||
|---|---|---|
| .circleci | ||
| .gitignore | ||
| bastion.yml | ||
| hosts | ||
| README.md | ||
| sshd_config_bastion | ||
| sshd_config_client | ||
| sshd_config_common | ||
| sshd_config_standalone | ||
| vars.yml | ||
Ansible SSH Config
Ansible playbook to setup an SSH bastion server and clients.
Security Features
- Non-standard SSH port for bastion
- Require key and password for bastion connections
- 5 minute connection timeout
- Login within 30 seconds of initial connection
- Disable SSHv1
- Separate key for connection to bastion and further hosts
- No warnings from
ssh-audit
Some of the hardening and configuration is based on https://joscor.com/blog/hardening-openssh-server-ubuntu-14-04/.
Usage
- Modify the values in
vars.ymlto match your requirements:useris the user to be used on both the client and bastion machinesbastion_ssh_keyis the key to use to connect to the bastion machine.enable_rootenables SSH connections as root to the bastionbastion_ipis the IP of the bastion, to be baked into the config of the clients.
- Populate
hostswith your required hosts. A singlebastion, and however manyclients.standalonecan be used to configure clients who don't require connections through the bastion. - Run the playbook with
ansible-playbook bastion.yml -i hosts --ask-pass -K