by vngzs · 4y ago · 0 comments
Now, if you're just using a bastion as a jump host, you don't need to offer shells on it. Just allow people to proxy a port to behind the bastion and be done with it.
PermitTTY no
ForceCommand /usr/sbin/nologin
AllowTcpForwarding yes
AllowAgentForwarding no AllowAgentForwarding no
AllowTcpForwarding yes
X11Forwarding no
PermitTunnel no
GatewayPorts no
PermitOpen *:22
ForceCommand echo 'Nope'
Then: ssh -J finaluser@finalhost user@bastion
You can nicely use your local agent, etc. Bastion is relatively hardened. Etc.There's also a lot you can do to harden that boundary. You can harden your kernel, you can execute user's shells in constrained environments like docker containers or restricted shells, leverage sandboxing technologies like apparmor or selinux, etc.
The user/root boundary can be a lot thinner than people expect, so I get why you'd want to point out that reliance on the attacker not escalating should be met with an evaluation of that boundary, but I think it may be understating the boundary to unconditionally not trust a host based firewall, or to say that getting onto the bastion itself is enough to disable the firewall when it does indeed require escalation.