Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v15] [web] update Kubernetes reference in audit log display #49461

Merged
merged 2 commits into from
Nov 26, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
Original file line number Diff line number Diff line change
Expand Up @@ -5731,7 +5731,7 @@ exports[`list of all events 1`] = `
<td
style="word-break: break-word;"
>
User [05ff66c9-a948-42f4-af0e-a1b6ba62561e.root] deleted kubernetes cluster [kube-local]
User [05ff66c9-a948-42f4-af0e-a1b6ba62561e.root] deleted Kubernetes cluster [kube-local]
</td>
<td
style="min-width: 120px;"
Expand Down Expand Up @@ -5779,7 +5779,7 @@ exports[`list of all events 1`] = `
<td
style="word-break: break-word;"
>
User [05ff66c9-a948-42f4-af0e-a1b6ba62561e.root] updated kubernetes cluster [kube-local]
User [05ff66c9-a948-42f4-af0e-a1b6ba62561e.root] updated Kubernetes cluster [kube-local]
</td>
<td
style="min-width: 120px;"
Expand Down Expand Up @@ -5827,7 +5827,7 @@ exports[`list of all events 1`] = `
<td
style="word-break: break-word;"
>
User [05ff66c9-a948-42f4-af0e-a1b6ba62561e.root] created kubernetes cluster [kube-local]
User [05ff66c9-a948-42f4-af0e-a1b6ba62561e.root] created Kubernetes cluster [kube-local]
</td>
<td
style="min-width: 120px;"
Expand Down Expand Up @@ -9347,7 +9347,7 @@ exports[`list of all events 1`] = `
<td
style="word-break: break-word;"
>
User [alex] received a [200] from a [GET /api/v1/namespaces/teletest/pods/test-pod] request to kubernetes cluster [gke_teleport-a]
User [alex] received a [200] from a [GET /api/v1/namespaces/teletest/pods/test-pod] request to Kubernetes cluster [gke_teleport-a]
</td>
<td
style="min-width: 120px;"
Expand Down Expand Up @@ -9503,7 +9503,7 @@ exports[`list of all events 1`] = `
<td
style="word-break: break-word;"
>
User [alex] executed a command on kubernetes cluster [clusterOne]
User [alex] executed a command on Kubernetes cluster [clusterOne]
</td>
<td
style="min-width: 120px;"
Expand Down
16 changes: 8 additions & 8 deletions web/packages/teleport/src/services/audit/makeEvent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,9 +166,9 @@ export const formatters: Formatters = {
const { proto, kubernetes_cluster, user = '' } = event;
if (proto === 'kube') {
if (!kubernetes_cluster) {
return `User [${user}] executed a kubernetes command`;
return `User [${user}] executed a Kubernetes command`;
}
return `User [${user}] executed a command on kubernetes cluster [${kubernetes_cluster}]`;
return `User [${user}] executed a command on Kubernetes cluster [${kubernetes_cluster}]`;
}

return `User [${user}] executed a command on node ${
Expand Down Expand Up @@ -616,9 +616,9 @@ export const formatters: Formatters = {

if (event.proto === 'kube') {
if (!event.kubernetes_cluster) {
return `User [${user}] has ended a kubernetes session [${event.sid}]`;
return `User [${user}] has ended a Kubernetes session [${event.sid}]`;
}
return `User [${user}] has ended a session [${event.sid}] on kubernetes cluster [${event.kubernetes_cluster}]`;
return `User [${user}] has ended a session [${event.sid}] on Kubernetes cluster [${event.kubernetes_cluster}]`;
}

if (!event.interactive) {
Expand Down Expand Up @@ -836,25 +836,25 @@ export const formatters: Formatters = {
type: 'kube.request',
desc: 'Kubernetes Request',
format: ({ user, kubernetes_cluster, verb, request_path, response_code }) =>
`User [${user}] received a [${response_code}] from a [${verb} ${request_path}] request to kubernetes cluster [${kubernetes_cluster}]`,
`User [${user}] received a [${response_code}] from a [${verb} ${request_path}] request to Kubernetes cluster [${kubernetes_cluster}]`,
},
[eventCodes.KUBE_CREATED]: {
type: 'kube.create',
desc: 'Kubernetes Created',
format: ({ user, name }) =>
`User [${user}] created kubernetes cluster [${name}]`,
`User [${user}] created Kubernetes cluster [${name}]`,
},
[eventCodes.KUBE_UPDATED]: {
type: 'kube.update',
desc: 'Kubernetes Updated',
format: ({ user, name }) =>
`User [${user}] updated kubernetes cluster [${name}]`,
`User [${user}] updated Kubernetes cluster [${name}]`,
},
[eventCodes.KUBE_DELETED]: {
type: 'kube.delete',
desc: 'Kubernetes Deleted',
format: ({ user, name }) =>
`User [${user}] deleted kubernetes cluster [${name}]`,
`User [${user}] deleted Kubernetes cluster [${name}]`,
},
[eventCodes.DATABASE_SESSION_STARTED]: {
type: 'db.session.start',
Expand Down
Loading