Skip to main content
Infisical can send the activity in each PAM session to your own logging system while the session runs. The activity includes the commands a user runs on a server, the queries they run on a database, and the requests they send to a Kubernetes cluster. Streaming it lets you alert on risky commands in your SIEM and keep session activity next to the rest of your logs. Infisical sends session activity through an audit log stream. You turn it on for each stream, and the stream then sends session activity along with its audit logs. Infisical keeps the session recording either way.

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)
Deleting a stream doesn’t need the PAM Admin role. Anyone with the Edit action on the Audit Log Streams policy can delete a stream, including one that sends session activity.

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.
Infisical sends a session’s activity in batches while the session runs, usually within 20 seconds of when it happens. Activity the Gateway records before you turn on Include PAM Session Activity but uploads afterward is sent too.

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:
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, except expiresAt, 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.