diff --git a/web/packages/teleport/src/Audit/EventList/EventTypeCell.tsx b/web/packages/teleport/src/Audit/EventList/EventTypeCell.tsx index 704de4b00e33e..c67d72df4e970 100644 --- a/web/packages/teleport/src/Audit/EventList/EventTypeCell.tsx +++ b/web/packages/teleport/src/Audit/EventList/EventTypeCell.tsx @@ -297,6 +297,9 @@ const EventIconMap: Record = { [eventCodes.USER_TASK_CREATE]: Icons.Info, [eventCodes.USER_TASK_UPDATE]: Icons.Info, [eventCodes.USER_TASK_DELETE]: Icons.Info, + [eventCodes.PLUGIN_CREATE]: Icons.Info, + [eventCodes.PLUGIN_UPDATE]: Icons.Info, + [eventCodes.PLUGIN_DELETE]: Icons.Info, [eventCodes.UNKNOWN]: Icons.Question, }; diff --git a/web/packages/teleport/src/services/audit/makeEvent.ts b/web/packages/teleport/src/services/audit/makeEvent.ts index caab90105eeab..8babf183d6d4f 100644 --- a/web/packages/teleport/src/services/audit/makeEvent.ts +++ b/web/packages/teleport/src/services/audit/makeEvent.ts @@ -1971,6 +1971,27 @@ export const formatters: Formatters = { return `User [${user}] deleted a user task [${name}]`; }, }, + [eventCodes.PLUGIN_CREATE]: { + type: 'plugin.create', + desc: 'Plugin Created', + format: ({ user, name, plugin_type }) => { + return `User [${user}] created a plugin [${name}] of type [${plugin_type}]`; + }, + }, + [eventCodes.PLUGIN_UPDATE]: { + type: 'plugin.update', + desc: 'Plugin Updated', + format: ({ user, name, plugin_type }) => { + return `User [${user}] updated a plugin [${name}] of type [${plugin_type}]`; + }, + }, + [eventCodes.PLUGIN_DELETE]: { + type: 'plugin.delete', + desc: 'Plugin Deleted', + format: ({ user, name }) => { + return `User [${user}] deleted a plugin [${name}]`; + }, + }, [eventCodes.UNKNOWN]: { type: 'unknown', desc: 'Unknown Event', diff --git a/web/packages/teleport/src/services/audit/types.ts b/web/packages/teleport/src/services/audit/types.ts index 3a52afb6617f5..fee6ce368c7ed 100644 --- a/web/packages/teleport/src/services/audit/types.ts +++ b/web/packages/teleport/src/services/audit/types.ts @@ -317,6 +317,9 @@ export const eventCodes = { USER_TASK_CREATE: 'UT001I', USER_TASK_UPDATE: 'UT002I', USER_TASK_DELETE: 'UT003I', + PLUGIN_CREATE: 'PG001I', + PLUGIN_UPDATE: 'PG002I', + PLUGIN_DELETE: 'PG003I', } as const; /** @@ -1746,6 +1749,18 @@ export type RawEvents = { typeof eventCodes.USER_TASK_DELETE, HasName >; + [eventCodes.PLUGIN_CREATE]: RawEvent< + typeof eventCodes.PLUGIN_CREATE, + Merge + >; + [eventCodes.PLUGIN_UPDATE]: RawEvent< + typeof eventCodes.PLUGIN_UPDATE, + Merge + >; + [eventCodes.PLUGIN_DELETE]: RawEvent< + typeof eventCodes.PLUGIN_DELETE, + Merge + >; }; /**