How to Configure OpenHands SSH Audit Log
You set up an openhands ssh audit log by turning on verbose server logging and using signed user certificates. This links every remote login event back to the specific agent identity. Teams often give coding agents broad shell keys to fix servers fast. Broad keys make it hard to see which task ran a bad command. When permissions are too wide, one agent mistake can break a live server. How an openhands ssh audit log works in practice OpenHands agents run shell commands on remote hosts to write
Audit Log Integrity + SSH Access Management: the complete guide
Architecture patterns, implementation strategies, and security best practices. Delivered to your inbox.
You set up an openhands ssh audit log by turning on verbose server logging and using signed user certificates. This links every remote login event back to the specific agent identity. Teams often give coding agents broad shell keys to fix servers fast. Broad keys make it hard to see which task ran a bad command. When permissions are too wide, one agent mistake can break a live server.
How an openhands ssh audit log works in practice
OpenHands agents run shell commands on remote hosts to write code and fix bugs. To track these actions, you must set up the remote SSH daemon first. Standard public keys often look the same inside basic server logs. Multiple agents might share one system user on the target Linux host. That shared user hides who started the session.
OpenSSH certificates solve this identity problem without complex tools. A certificate Authority key signs a user public key to make a certificate. This certificate holds a public key, an identity string, and allowed principal names. It also holds a set of options signed by the Authority key. OpenSSH uses a much simpler format than standard web certificates. You set a key identity string when you sign the user certificate. The remote server writes that exact identity string into the system log.
Setting up certificates and host log rules
First, create a Certificate Authority key pair on a secure admin machine. Tell your target servers to trust this Authority public key for user logins. Next, sign the agent key and attach a clear identity name. You should also list the exact principal names the agent can use. Set a short time window when you sign the certificate. If you skip the time window, the certificate stays valid forever.
You can also add options to the certificate to limit agent actions. These options can restrict port forwarding or force a single command to run. Once the agent logs in, the target host checks the Authority signature. The host then writes the certificate identity and key fingerprint to its log. Your team forwards these host logs to a central log store for review.
Audit Log Integrity + SSH Access Management: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
What native logging solves and what it misses
Native OpenSSH logging proves which agent key logged in and when it happened. It gives security teams a clear record of login times and source addresses. Short certificate time windows also stop old agent keys from working later. This setup works well for tracking basic host entry across your fleet.
Still, native SSH logs only check who logs into the host. The server daemon does not inspect individual shell commands while they run. Once the agent opens a shell, it has full user permissions. Native logs do not block a dangerous command before it hits the disk. They also cannot mask sensitive fields like emails or card numbers in output. If an agent reads a file with phone numbers, the raw text flows back. Plus, a rogue agent with root rights can alter local log files.
Check SSH commands and file transfers on the host
OpenSSH keys and certificates decide who can log into a Linux host. They do not check what a one-shot command or file transfer does once the session starts. With hoop.dev, you run an open-source SSH server with guardrails on the host. It checks callers with OpenSSH certificates and works with ssh, sftp, scp, and rsync clients.
When a caller runs a one-shot command or moves a file, hoop.dev guardrails check the command or path before it runs. Then hoop.dev data masking masks matched sensitive patterns in downloads and output. Interactive shells carry no guardrails because keystrokes have no statement boundary. Teams can turn interactive shells off and allow only commands and file tasks. The audit trail logs who connected and what was allowed or refused, without storing keystrokes or file bytes. See the source on GitHub.
Frequently asked questions
What does a native SSH log capture during an agent session?
Native SSH logs record the login time, user name, and source IP address. When you use certificates, the log also records the key identity string. It does not capture the full text of every command and output.
How do OpenSSH certificates improve agent tracking?
Certificates let you bake a unique identity name right into the signed key. Even if ten agents share one Linux user, the log shows which certificate entered. You can also set certificates to expire after a few hours.
Can SSH daemon settings mask sensitive data in command output?
No, the SSH daemon only encrypts and moves bytes between the hosts. It cannot read the stream to rewrite emails, phone numbers, or national IDs. You need an inline control point to rewrite matched fields in results.
Related guides
In this post