Skip to content

Commit

Permalink
web: add desktop session ID to audit log page
Browse files Browse the repository at this point in the history
The summary of desktop session events did not include the session ID,
which made it hard to search for events related to a particular session.

Include the session ID in the start/end events.
  • Loading branch information
zmb3 authored and github-actions committed Sep 10, 2024
1 parent 9f04ea4 commit 2792186
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
14 changes: 7 additions & 7 deletions web/packages/teleport/src/services/audit/makeEvent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1145,10 +1145,10 @@ export const formatters: Formatters = {
[eventCodes.DESKTOP_SESSION_STARTED]: {
type: 'windows.desktop.session.start',
desc: 'Windows Desktop Session Started',
format: ({ user, windows_domain, desktop_name, windows_user }) => {
let message = `User [${user}] has connected to Windows desktop [${windows_user}@${desktop_name}]`;
format: ({ user, windows_domain, desktop_name, sid, windows_user }) => {
let message = `User [${user}] started session ${sid} on Windows desktop [${windows_user}@${desktop_name}]`;
if (windows_domain) {
message += ` on [${windows_domain}]`;
message += ` with domain [${windows_domain}]`;
}
return message;
},
Expand All @@ -1159,20 +1159,20 @@ export const formatters: Formatters = {
format: ({ user, windows_domain, desktop_name, windows_user }) => {
let message = `User [${user}] was denied access to Windows desktop [${windows_user}@${desktop_name}]`;
if (windows_domain) {
message += ` on [${windows_domain}]`;
message += ` with domain [${windows_domain}]`;
}
return message;
},
},
[eventCodes.DESKTOP_SESSION_ENDED]: {
type: 'windows.desktop.session.end',
desc: 'Windows Desktop Session Ended',
format: ({ user, windows_domain, desktop_name, windows_user }) => {
format: ({ user, windows_domain, desktop_name, sid, windows_user }) => {
let desktopMessage = `[${windows_user}@${desktop_name}]`;
if (windows_domain) {
desktopMessage += ` on [${windows_domain}]`;
desktopMessage += ` with domain [${windows_domain}]`;
}
let message = `Session for Windows desktop ${desktopMessage} has ended for user [${user}]`;
let message = `Session ${sid} for Windows desktop ${desktopMessage} has ended for user [${user}]`;
return message;
},
},
Expand Down
2 changes: 2 additions & 0 deletions web/packages/teleport/src/services/audit/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1049,6 +1049,7 @@ export type RawEvents = {
{
desktop_addr: string;
desktop_name: string;
sid: string;
windows_user: string;
windows_domain: string;
}
Expand All @@ -1067,6 +1068,7 @@ export type RawEvents = {
{
desktop_addr: string;
desktop_name: string;
sid: string;
windows_user: string;
windows_domain: string;
}
Expand Down

0 comments on commit 2792186

Please sign in to comment.