diff --git a/web/packages/teleport/src/services/recordings/makeRecording.ts b/web/packages/teleport/src/services/recordings/makeRecording.ts index 3a9264f3630f3..3b69c2508fa41 100644 --- a/web/packages/teleport/src/services/recordings/makeRecording.ts +++ b/web/packages/teleport/src/services/recordings/makeRecording.ts @@ -66,6 +66,7 @@ function makeDesktopRecording({ function makeSshOrKubeRecording({ participants, + user, time, session_start, session_stop, @@ -84,9 +85,13 @@ function makeSshOrKubeRecording({ ); let hostname = server_hostname || 'N/A'; + // SSH interactive/non-interactive and k8s interactive sessions user participants are in the participants field. + let userParticipants = participants; // For Kubernetes sessions, put the full pod name as 'hostname'. if (proto === 'kube') { hostname = `${kubernetes_cluster}/${kubernetes_pod_namespace}/${kubernetes_pod_name}`; + // For non-interactive k8s sessions the participant is the Teleport user running the command + if (!interactive) userParticipants = [user]; } // Description set to play for interactive so users can search by "play". @@ -101,7 +106,7 @@ function makeSshOrKubeRecording({ durationText, sid, createdDate: new Date(time), - users: participants ? participants.join(', ') : [], + users: userParticipants ? userParticipants.join(', ') : [], hostname, description, recordingType: kubernetes_cluster ? 'k8s' : 'ssh', diff --git a/web/packages/teleport/src/services/recordings/recordings.test.ts b/web/packages/teleport/src/services/recordings/recordings.test.ts index 248d6199b10da..507828e3a9490 100644 --- a/web/packages/teleport/src/services/recordings/recordings.test.ts +++ b/web/packages/teleport/src/services/recordings/recordings.test.ts @@ -51,7 +51,7 @@ test('fetch session recordings, response formatting', async () => { playable: false, recordingType: 'k8s', sid: '456b933c-4ec4-59f1-862c-90ca9f7648b1', - users: [], + users: 'onuweeme@wiuke.mh', }, ], startKey: '',