The idea behind Isolate is that we should somehow manage how do people get access to our servers. How can we make this process more secure? How could we prevent a system from being compromised when someone lost the laptop with ssh key. What would we do in case someone quits the company - is there an alternative to just changing all passwords, keys, etc?
Technically you should generate and place the bastion host key on endpoint servers, and users will get regular access to Isolate server with the sudoer access to ssh command.
Once they want to connect to the endpoint server, the system executes ssh command and ssh client running with privileged user permissions gets server key and using it the system gets access to the server we need to get access to.
# apt update; apt install python python-pip python-dev -y
ansible/hosts.ini
cd ansible
ansible-playbook main.yml
# reboot
/etc/bashrc (/etc/bash.bashrcon debian/ubuntu):
if [ -f /opt/auth/shared/bash.sh ]; then
source /opt/auth/shared/bash.sh;
fi
/etc/sudoers (or usevisudo )
%auth ALL=(auth) NOPASSWD: /opt/auth/wrappers/ssh.py
/etc/ssh/sshd_config:
# AuthorizedKeysFile /etc/keys/%u_authorized_keys
PermitRootLogin without-password
PasswordAuthentication yes
GSSAPIAuthentication no
AllowAgentForwarding no
AllowTcpForwarding no
X11Forwarding no
UseDNS no
MaxStartups 48:20:300
TCPKeepAlive yes
ClientAliveInterval 36
ClientAliveCountMax 2400
systemctl restart sshd
systemctl status sshd
/etc/pam.d/sshd (/etc/pam.d/common-auth on debian/ubuntu):
auth required pam_oath.so usersfile=/etc/oath/users.oath window=20 digits=6
#%PAM-1.0
auth required pam_sepermit.so
auth substack password-auth
auth required pam_oath.so usersfile=/etc/oath/users.oath window=20 digits=6
auth include postlogin
...>
sed -i -e 's/ChallengeResponseAuthentication no/ChallengeResponseAuthentication yes/g' /etc/ssh/sshd_config
/etc/ssh/sshd_config
Match Group auth
AuthenticationMethods keyboard-interactive
systemctl restart sshd
systemctl status sshd