How to Configure Amazon Q SSH Audit Log

Published
Length
3 min read

Luis Felipe Dias

All posts

To set up an amazon q ssh audit log, you must turn on server daemon logs and capture local shell activity. You then send both event streams to one central log store for review. Most teams start by giving the coding agent a developer SSH key to run remote tasks. When permissions are too broad, the agent can run risky commands on live hosts without clear oversight. How the native amazon q ssh audit log works Amazon Q Developer runs terminal commands on your local machine when you grant permissi

Audit Log Integrity + SSH Access Management: the complete guide

Architecture patterns, implementation strategies, and security best practices. Delivered to your inbox.

Free white paper. No spam. Unsubscribe anytime.

To set up an amazon q ssh audit log, you must turn on server daemon logs and capture local shell activity. You then send both event streams to one central log store for review. Most teams start by giving the coding agent a developer SSH key to run remote tasks. When permissions are too broad, the agent can run risky commands on live hosts without clear oversight.

How the native amazon q ssh audit log works

Amazon Q Developer runs terminal commands on your local machine when you grant permission. When a task needs remote host access, the agent uses your local OpenSSH client. It reads your local shell rules and uses your stored keys to log in to the remote host.

On the target server, the OpenSSH daemon handles the login check. Teams often use OpenSSH user certificates instead of static keys. A central authority key signs these user certificates. Each certificate holds a public key, an identity name, and allowed user names. The server daemon writes the key identity and login time to the system log.

To build the native log, you set the server daemon to record verbose login details. The server writes each login event, key fingerprint, and session start to a local file. You then use a log shipper to send those files to a central search tool. You also log local agent actions on the developer laptop to pair prompts with remote logins.

What native logging solves and the gap it leaves

Native OpenSSH logging is great for proving who logged in to a server. It shows which user certificate or public key opened the session and when it closed. Security teams can see which machine opened a network path and match that to a user identity.

Still, native server logs decide who logs in, not what individual commands do in flight. Once the SSH tunnel opens, the server daemon does not log every shell command by default. Even if you turn on kernel command tracking, you only see raw process calls after they run. You cannot tell if a human typed the command or if Amazon Q generated it.

Native logs also cannot stop a bad command before it harms a live host. If the AI agent runs a drop script or reads secret files, the log only records the damage later. Also, if a command prints customer emails, phone numbers, or card numbers, native tools return that raw text to the agent.

Audit Log Integrity + SSH Access Management: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

How to check and manage agent remote sessions

To keep live servers safe, teams need controls that work inside the active session. First, separate human logins from AI agent tasks by giving the agent its own role. Do not let the agent reuse a broad personal key that can reach every host.

Second, require human approval before any high-risk command runs on a production host. A basic local prompt is easy for a busy developer to click through without reading. Moving the check to the remote access path ensures that team leads approve big changes.

Third, apply data masking to command output before it reaches the local terminal. Masking rewrites matched fields like national IDs or card numbers in results. This stops private records from entering the AI model context window during debugging tasks.

Inspect one-shot SSH commands and file tasks

SSH certificates and host rules decide who is allowed on a machine. Setup alone does not check single commands or block sftp reads on sensitive paths. By design, hoop.dev runs an open-source SSH listener on the host where people and agents keep their normal ssh, sftp, and scp tools.

First, hoop.dev guardrails check one-shot commands and file paths before they run. Next, hoop.dev data masking masks matched values in file downloads. The audit trail logs the certificate principal, requested action, and verdict without storing session content. Interactive shells carry no guardrails and can be turned off when every action must be checked. Explore the code on GitHub.

Frequently asked questions

Does OpenSSH log every command Amazon Q runs by default?

No, the standard OpenSSH server daemon only logs login events, key checks, and session disconnects. To see every command, you must add host-level shell logging or use a tool that captures session input.

How can I tell Amazon Q commands apart from human commands in logs?

With native OpenSSH, you must assign a separate user certificate with a distinct identity string for agent tasks. That way, the server log marks the login with the agent identity instead of your personal user name.

Can native SSH logs hide private data from the AI agent?

No, native logs only write event records to disk and do not touch terminal output. You need an inline data masking control that rewrites emails or phone numbers in results before they reach the agent.

Save the open-source gateway.

hoop is MIT-licensed infrastructure for controlling how AI agents reach production data. Star hoophq/hoop so you can inspect it, deploy it, or share it when your team starts governing agent access.