Skip to content
This repository has been archived by the owner on Feb 8, 2024. It is now read-only.

Add two event codes for SSO test flow. #717

Merged
merged 5 commits into from
May 23, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions packages/teleport/src/Audit/EventList/EventTypeCell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ const EventIconMap: Record<EventCode, React.FC> = {
[eventCodes.USER_LOCAL_LOGINFAILURE]: Icons.Info,
[eventCodes.USER_SSO_LOGIN]: Icons.Info,
[eventCodes.USER_SSO_LOGINFAILURE]: Icons.Info,
[eventCodes.USER_SSO_TEST_FLOW_LOGIN]: Icons.Info,
[eventCodes.USER_SSO_TEST_FLOW_LOGINFAILURE]: Icons.Info,
[eventCodes.KUBE_REQUEST]: Icons.Kubernetes,
[eventCodes.DATABASE_SESSION_STARTED]: Icons.Database,
[eventCodes.DATABASE_SESSION_STARTED_FAILURE]: Icons.Database,
Expand Down
10 changes: 10 additions & 0 deletions packages/teleport/src/services/audit/makeEvent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,16 @@ export const formatters: Formatters = {
desc: 'SSO Login Failed',
format: ({ error }) => `SSO user login failed [${error}]`,
},
[eventCodes.USER_SSO_TEST_FLOW_LOGIN]: {
type: 'user.login',
desc: 'SSO Test Flow Login',
format: ({ user }) => `SSO Test Flow: user [${user}] successfully logged in`,
},
[eventCodes.USER_SSO_TEST_FLOW_LOGINFAILURE]: {
type: 'user.login',
desc: 'SSO Test Flow Login Failed',
format: ({ error }) => `SSO Test flow: user login failed [${error}]`,
},
[eventCodes.ROLE_CREATED]: {
type: 'role.created',
desc: 'User Role Created',
Expand Down
9 changes: 9 additions & 0 deletions packages/teleport/src/services/audit/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,8 @@ export const eventCodes = {
USER_PASSWORD_CHANGED: 'T1005I',
USER_SSO_LOGIN: 'T1001I',
USER_SSO_LOGINFAILURE: 'T1001W',
USER_SSO_TEST_FLOW_LOGIN: 'T1010I',
USER_SSO_TEST_FLOW_LOGINFAILURE: 'T1011W',
USER_UPDATED: 'T1003I',
X11_FORWARD: 'T3008I',
X11_FORWARD_FAILURE: 'T3008W',
Expand Down Expand Up @@ -356,6 +358,13 @@ export type RawEvents = {
error: string;
}
>;
[eventCodes.USER_SSO_TEST_FLOW_LOGIN]: RawEvent<typeof eventCodes.USER_SSO_TEST_FLOW_LOGIN>;
[eventCodes.USER_SSO_TEST_FLOW_LOGINFAILURE]: RawEvent<
typeof eventCodes.USER_SSO_TEST_FLOW_LOGINFAILURE,
{
error: string;
}
>;
[eventCodes.ROLE_CREATED]: RawEvent<typeof eventCodes.ROLE_CREATED, HasName>;
[eventCodes.ROLE_DELETED]: RawEvent<typeof eventCodes.ROLE_DELETED, HasName>;
[eventCodes.TRUSTED_CLUSTER_TOKEN_CREATED]: RawEvent<
Expand Down