Prerequisites
- A plan that includes audit log streams
- An organization role with the Read and Edit actions on the Audit Log Streams policy
- The Admin role in PAM, which makes you a product admin (only a product admin can turn on session activity for a stream, or change a stream that sends it)
Turn on session activity
1
In your organization, go to Audit Logs and select the External Log Streams tab.
2
Select Add Log Stream to create a stream, or select the three dot menu next to an existing stream and select Edit.
3
Turn on Include PAM Session Activity.
4
To also send the output of each command, query, and request, turn on Include Output.Output can contain sensitive data, such as query results and file contents. It’s also usually much larger than the commands themselves.
5
Select Create Log Stream or Update.
Activity by account type
Infisical doesn’t send input that isn’t a command, such as a password typed at a prompt or data piped into a command. If a user connects without a terminal, Infisical can’t tell the commands they type apart from that kind of input, so it doesn’t send those commands either. This happens with
ssh -T and with ssh <host> bash. The session recording still shows the commands.
The account’s template also changes what reaches the stream:
- If the template masks sensitive values, the stream receives the masked text
- If a Command Blocking policy rejects a command, the event for that command includes
"blocked": true
To stream commands typed in an interactive SSH shell, update your Gateway to the latest version. Older Gateways record those commands only as terminal output, so the commands reach a stream only if it includes output. They also don’t mark blocked SSH commands with
"blocked": true.Event format
Session activity events have the same top-level fields as audit log events, exceptexpiresAt, updatedAt, and userAgentType, so the rules your logging system uses to parse audit logs can parse session activity too. Infisical delivers them in the same batches, with the same retries and failure alerts.
eventType is one of the following. Every session activity event type starts with pam-session-activity-, so you can filter on that prefix to separate session activity from the stream’s audit logs.
Every
eventMetadata also identifies the session and account with sessionId, accountId, accountName, accountType, folderName, and host. If a value is longer than 16,384 characters, Infisical shortens it and adds [truncated] at the end.