-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add session_type
and format
to session.recording.access
audit event event
#47309
Add session_type
and format
to session.recording.access
audit event event
#47309
Conversation
Is this related to a ticket ? I'm curious on the background around this task, I'm somewhat concerned about how we present information in the audit log that can be potentially spoofed by an attacker. |
https://github.com/gravitational/teleport/blob/master/rfd/0171-database-session-playback.md Postgres PTY playback can be done through web or The event is mainly used to collect the usage/adoption data of this feature. To me, collecting the format is similar to collecting user agents, where it can be spoofed but it is not critical to the event itself and patterns can be collected even if there is an attacker. If we really want to prevent spoofing though, some redesign of the backend api may be needed. |
This is the same idea as the However, the value was added to the audit event as it was already available as always-present data when users access their recordings (which then are converted into prehog events). This is similar to user-agent reporting (as @greedy52 said), which is also present in the audit events (for example, on login events). We could take advantage of knowing the possible values and validate them (avoiding custom values), but it may not make it better (in terms of security). |
@strideynet @fheinecke Friendly ping. |
@gabrielcorado See the table below for backport results.
|
…vent event (#47309) * feat: add `session_type` and `format` to session recording access event * chore(metadata): change conditional
…vent event (#47309) * feat: add `session_type` and `format` to session recording access event * chore(metadata): change conditional
This is part of adding usage metrics for session recording access. This PR adds the fields
format
andsession_type
to the audit event. Possible values forformat
arejson
,yaml
,text
, andpty
.session_type
value comes from the access checker, which lists the last audit event from the recording to ensure the user can access the recording type. We had to update theactionForKindSession
function to return this type based on the last recording event type.format
is set by the clients (if applicable) using the gRPC context value. The context was used instead of adding an additional value to the function call because it is only used to enhance the audit event and is not used in the streaming process. This simplifies the usage and avoids increasing the complexity of the streaming functions for metadata values.Changelog: Include the
format
(indicates which format the session was accessed in) andsession_type
(represents the type of the recording, for example,ssh
) fields for thesession.recording.access
audit event.Example of audit event