SSH Auditing Software / Bastion Host

Hello all,
I need to get auditing in place for SSH sessions, and was hoping that I could set up a bastion/gateway host that would act as a gateway that everyone had to SSH through (could be SSH in a web browser instead of directly from a terminal if required). The key requirement is that it needs to record all of the commands the user puts in, and has some soft of access management and logging.

I would prefer it if multiple different user accounts could log into the system, and connect to the underlying servers on a single administrator account, but we know who was performing the commands, due to the different user accounts used to log into the bastion/gateway server. This means that as administrators come and go, we just need to update the bastion/gateway server with the various login accounts, but the underlying servers don’t need a separate user and all the relevant permissions for each. This also means we don’t have to spend longer setting up the auditing configuration on the underlying servers, and just take great care in configuring the bastion/gateway with all of the access accounts. It also means that whenever we deploy a new server, we can just add it to the bastion in order to “share” it with all of the administrators (we don’t have to send everyone the relevant details such as IP address and possibly the port). It would also mean we can restrict the underlying servers firewall rules, to only allow them to be accessible from the bastion’s IP address.

If anyone has suggestions for such software and their experience, I would be grateful. Right now I’m re-looking into Teleport (gave up last time), and possibly Bastillion. Teleport looks like it is a better bet from a features/polish point of view, but afraid of getting rug-pulled.

1 Like

Redhat tends to provide good docs for this sort of task.

eg:
Configure Linux system auditing with auditd - standard Linux auditing
How to set up tlog on Linux hosts for terminal logging - terminal logging, not used that myself

sshd/linux already has access management and logging natively.

Tailscale SSH · Tailscale Docs also may offer a proprietary SaaS solution, which if you’re using tailscale anyway could be good and won’t need the bastion host.

Personally I’d be auditing every server, not just the bastion. And we’d try to avoid any sharing of a single admin account, everyone would be logging into all servers as themselves, then using sudo or doas etc as needed. There might be a bastion host, but we’d as much as possible try to arrange for it to be nothing more than a network hop into a private network, and should it be compromised that should not give access to anything further.

I would also be using infra/config as code as a rule, which makes setting up audit or adding the user to one host as much as doing it for all hosts. Even for a single host config as code is warranted in environments with audit requirements. In such a world the sshing into servers is only to troubleshoot and restart things, changes would go through the code repo.

1 Like

One suggestion for user management: sssd (managed through IaC) and LDAP.
I was going to suggest tailscale SSH too but I still haven’t tried it, 4 years later, only Teleport.