diff --git a/web/packages/teleport/src/Audit/EventList/EventTypeCell.tsx b/web/packages/teleport/src/Audit/EventList/EventTypeCell.tsx index 76e23b69742e1..5c6004c271578 100644 --- a/web/packages/teleport/src/Audit/EventList/EventTypeCell.tsx +++ b/web/packages/teleport/src/Audit/EventList/EventTypeCell.tsx @@ -247,6 +247,10 @@ const EventIconMap: Record = { [eventCodes.SECURITY_REPORT_RUN]: Icons.Info, [eventCodes.EXTERNAL_AUDIT_STORAGE_ENABLE]: Icons.Database, [eventCodes.EXTERNAL_AUDIT_STORAGE_DISABLE]: Icons.Database, + [eventCodes.DISCOVERY_CONFIG_CREATE]: Icons.Info, + [eventCodes.DISCOVERY_CONFIG_UPDATE]: Icons.Info, + [eventCodes.DISCOVERY_CONFIG_DELETE]: Icons.Info, + [eventCodes.DISCOVERY_CONFIG_DELETE_ALL]: Icons.Info, [eventCodes.UNKNOWN]: Icons.Question, }; diff --git a/web/packages/teleport/src/Audit/__snapshots__/Audit.story.test.tsx.snap b/web/packages/teleport/src/Audit/__snapshots__/Audit.story.test.tsx.snap index b97fe32f2150f..764af1a19d056 100644 --- a/web/packages/teleport/src/Audit/__snapshots__/Audit.story.test.tsx.snap +++ b/web/packages/teleport/src/Audit/__snapshots__/Audit.story.test.tsx.snap @@ -429,12 +429,12 @@ exports[`list of all events 1`] = ` - - 215 + 219 of - 215 + 219 + + + + +
+ + + + + + + + Discovery Config Deleted +
+ + + User [undefined] deleted a discovery config [discovery-config] + + + 2023-05-08T19:21:38.144Z + + + + + + + +
+ + + + + + + + Discovery Config Updated +
+ + + User [undefined] updated a discovery config [discovery-config] + + + 2023-05-08T19:21:37.144Z + + + + + + + +
+ + + + + + + + Discovery Config Created +
+ + + User [undefined] created a discovery config [discovery-config] + + + 2023-05-08T19:21:36.144Z + + + + + `User [${updated_by}] disabled External Audit Storage`, }, + [eventCodes.DISCOVERY_CONFIG_CREATE]: { + type: 'discovery_config.create', + desc: 'Discovery Config Created', + format: ({ user, name }) => { + return `User [${user}] created a discovery config [${name}]`; + }, + }, + [eventCodes.DISCOVERY_CONFIG_UPDATE]: { + type: 'discovery_config.update', + desc: 'Discovery Config Updated', + format: ({ user, name }) => { + return `User [${user}] updated a discovery config [${name}]`; + }, + }, + [eventCodes.DISCOVERY_CONFIG_DELETE]: { + type: 'discovery_config.delete', + desc: 'Discovery Config Deleted', + format: ({ user, name }) => { + return `User [${user}] deleted a discovery config [${name}]`; + }, + }, + [eventCodes.DISCOVERY_CONFIG_DELETE_ALL]: { + type: 'discovery_config.delete_all', + desc: 'All Discovery Configs Deleted', + format: ({ user }) => { + return `User [${user}] deleted all discovery configs`; + }, + }, [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 3820ae9f77b35..79c06ea8f4e77 100644 --- a/web/packages/teleport/src/services/audit/types.ts +++ b/web/packages/teleport/src/services/audit/types.ts @@ -265,6 +265,10 @@ export const eventCodes = { SECURITY_REPORT_RUN: 'SRE002I', EXTERNAL_AUDIT_STORAGE_ENABLE: 'TEA001I', EXTERNAL_AUDIT_STORAGE_DISABLE: 'TEA002I', + DISCOVERY_CONFIG_CREATE: 'DC001I', + DISCOVERY_CONFIG_UPDATE: 'DC002I', + DISCOVERY_CONFIG_DELETE: 'DC003I', + DISCOVERY_CONFIG_DELETE_ALL: 'DC004I', } as const; /** @@ -1476,6 +1480,21 @@ export type RawEvents = { updated_by: string; } >; + [eventCodes.DISCOVERY_CONFIG_CREATE]: RawEvent< + typeof eventCodes.DISCOVERY_CONFIG_CREATE, + HasName + >; + [eventCodes.DISCOVERY_CONFIG_UPDATE]: RawEvent< + typeof eventCodes.DISCOVERY_CONFIG_UPDATE, + HasName + >; + [eventCodes.DISCOVERY_CONFIG_DELETE]: RawEvent< + typeof eventCodes.DISCOVERY_CONFIG_DELETE, + HasName + >; + [eventCodes.DISCOVERY_CONFIG_DELETE_ALL]: RawEvent< + typeof eventCodes.DISCOVERY_CONFIG_DELETE_ALL + >; }; /**