diff --git a/backend/src/ee/services/audit-log/audit-log-types.ts b/backend/src/ee/services/audit-log/audit-log-types.ts index 225eda4f2..b9adab7a5 100644 --- a/backend/src/ee/services/audit-log/audit-log-types.ts +++ b/backend/src/ee/services/audit-log/audit-log-types.ts @@ -1776,6 +1776,7 @@ interface CreateCa { type: EventType.CREATE_CA; metadata: { caId: string; + name: string; dn?: string; }; } @@ -1784,6 +1785,7 @@ interface GetCa { type: EventType.GET_CA; metadata: { caId: string; + name: string; dn?: string; }; } @@ -1799,6 +1801,7 @@ interface UpdateCa { type: EventType.UPDATE_CA; metadata: { caId: string; + name: string; dn?: string; status: CaStatus; }; @@ -1808,6 +1811,7 @@ interface DeleteCa { type: EventType.DELETE_CA; metadata: { caId: string; + name: string; dn?: string; }; } @@ -2130,7 +2134,7 @@ interface GetSubscriberActiveCertBundle { type: EventType.GET_SUBSCRIBER_ACTIVE_CERT_BUNDLE; metadata: { subscriberId: string; - subscriberName: string; + name: string; certId: string; serialNumber: string; }; diff --git a/backend/src/server/routes/v1/certificate-authority-router.ts b/backend/src/server/routes/v1/certificate-authority-router.ts index 2041abd3f..47594ac87 100644 --- a/backend/src/server/routes/v1/certificate-authority-router.ts +++ b/backend/src/server/routes/v1/certificate-authority-router.ts @@ -95,6 +95,7 @@ export const registerCaRouter = async (server: FastifyZodProvider) => { event: { type: EventType.CREATE_CA, metadata: { + name: ca.name, caId: ca.id, dn: ca.dn } @@ -143,6 +144,7 @@ export const registerCaRouter = async (server: FastifyZodProvider) => { type: EventType.GET_CA, metadata: { caId: ca.id, + name: ca.name, dn: ca.dn } } @@ -230,6 +232,7 @@ export const registerCaRouter = async (server: FastifyZodProvider) => { metadata: { caId: ca.id, dn: ca.dn, + name: ca.name, status: ca.status as CaStatus } } @@ -276,6 +279,7 @@ export const registerCaRouter = async (server: FastifyZodProvider) => { event: { type: EventType.DELETE_CA, metadata: { + name: ca.name, caId: ca.id, dn: ca.dn } diff --git a/backend/src/server/routes/v1/certificate-authority-routers/certificate-authority-endpoints.ts b/backend/src/server/routes/v1/certificate-authority-routers/certificate-authority-endpoints.ts index 80855c558..01952c7f4 100644 --- a/backend/src/server/routes/v1/certificate-authority-routers/certificate-authority-endpoints.ts +++ b/backend/src/server/routes/v1/certificate-authority-routers/certificate-authority-endpoints.ts @@ -117,7 +117,8 @@ export const registerCertificateAuthorityEndpoints = < event: { type: EventType.GET_CA, metadata: { - caId: certificateAuthority.id + caId: certificateAuthority.id, + name: certificateAuthority.name } } }); @@ -153,6 +154,7 @@ export const registerCertificateAuthorityEndpoints = < event: { type: EventType.CREATE_CA, metadata: { + name: certificateAuthority.name, caId: certificateAuthority.id } } @@ -198,6 +200,7 @@ export const registerCertificateAuthorityEndpoints = < event: { type: EventType.UPDATE_CA, metadata: { + name: certificateAuthority.name, caId: certificateAuthority.id, status: certificateAuthority.status } @@ -243,6 +246,7 @@ export const registerCertificateAuthorityEndpoints = < event: { type: EventType.DELETE_CA, metadata: { + name: certificateAuthority.name, caId: certificateAuthority.id } } diff --git a/backend/src/server/routes/v1/pki-subscriber-router.ts b/backend/src/server/routes/v1/pki-subscriber-router.ts index b1b242ba1..761904fd1 100644 --- a/backend/src/server/routes/v1/pki-subscriber-router.ts +++ b/backend/src/server/routes/v1/pki-subscriber-router.ts @@ -535,7 +535,7 @@ export const registerPkiSubscriberRouter = async (server: FastifyZodProvider) => type: EventType.GET_SUBSCRIBER_ACTIVE_CERT_BUNDLE, metadata: { subscriberId: subscriber.id, - subscriberName: subscriber.name, + name: subscriber.name, certId: cert.id, serialNumber: cert.serialNumber } diff --git a/frontend/src/hooks/api/auditLogs/constants.tsx b/frontend/src/hooks/api/auditLogs/constants.tsx index f84ddabe7..6bef897f7 100644 --- a/frontend/src/hooks/api/auditLogs/constants.tsx +++ b/frontend/src/hooks/api/auditLogs/constants.tsx @@ -190,7 +190,16 @@ export const eventToNameMap: { [K in EventType]: string } = { [EventType.ADD_IDENTITY_LDAP_AUTH]: "Attached LDAP Auth to identity", [EventType.UPDATE_IDENTITY_LDAP_AUTH]: "Updated LDAP Auth for identity", [EventType.GET_IDENTITY_LDAP_AUTH]: "Retrieved LDAP Auth for identity", - [EventType.REVOKE_IDENTITY_LDAP_AUTH]: "Revoked LDAP Auth for identity" + [EventType.REVOKE_IDENTITY_LDAP_AUTH]: "Revoked LDAP Auth for identity", + + [EventType.CREATE_PKI_SUBSCRIBER]: "Create PKI subscriber", + [EventType.UPDATE_PKI_SUBSCRIBER]: "Update PKI subscriber", + [EventType.DELETE_PKI_SUBSCRIBER]: "Delete PKI subscriber", + [EventType.GET_PKI_SUBSCRIBER]: "Get PKI subscriber", + [EventType.ISSUE_PKI_SUBSCRIBER_CERT]: "Issue PKI subscriber certificate", + [EventType.SIGN_PKI_SUBSCRIBER_CERT]: "Sign PKI subscriber certificate", + [EventType.AUTOMATED_RENEW_SUBSCRIBER_CERT]: "Automated renew PKI subscriber certificate", + [EventType.LIST_PKI_SUBSCRIBER_CERTS]: "List PKI subscriber certificates" }; export const userAgentTypeToNameMap: { [K in UserAgentType]: string } = { diff --git a/frontend/src/hooks/api/auditLogs/enums.tsx b/frontend/src/hooks/api/auditLogs/enums.tsx index 82f07f385..a602367c0 100644 --- a/frontend/src/hooks/api/auditLogs/enums.tsx +++ b/frontend/src/hooks/api/auditLogs/enums.tsx @@ -184,5 +184,14 @@ export enum EventType { MICROSOFT_TEAMS_WORKFLOW_INTEGRATION_CHECK_INSTALLATION_STATUS = "microsoft-teams-workflow-integration-check-installation-status", MICROSOFT_TEAMS_WORKFLOW_INTEGRATION_GET_TEAMS = "microsoft-teams-workflow-integration-get-teams", MICROSOFT_TEAMS_WORKFLOW_INTEGRATION_GET = "microsoft-teams-workflow-integration-get", - MICROSOFT_TEAMS_WORKFLOW_INTEGRATION_LIST = "microsoft-teams-workflow-integration-list" + MICROSOFT_TEAMS_WORKFLOW_INTEGRATION_LIST = "microsoft-teams-workflow-integration-list", + + CREATE_PKI_SUBSCRIBER = "create-pki-subscriber", + UPDATE_PKI_SUBSCRIBER = "update-pki-subscriber", + DELETE_PKI_SUBSCRIBER = "delete-pki-subscriber", + GET_PKI_SUBSCRIBER = "get-pki-subscriber", + ISSUE_PKI_SUBSCRIBER_CERT = "issue-pki-subscriber-cert", + SIGN_PKI_SUBSCRIBER_CERT = "sign-pki-subscriber-cert", + AUTOMATED_RENEW_SUBSCRIBER_CERT = "automated-renew-subscriber-cert", + LIST_PKI_SUBSCRIBER_CERTS = "list-pki-subscriber-certs" } diff --git a/frontend/src/hooks/api/auditLogs/types.tsx b/frontend/src/hooks/api/auditLogs/types.tsx index 838f500eb..8774e1a73 100644 --- a/frontend/src/hooks/api/auditLogs/types.tsx +++ b/frontend/src/hooks/api/auditLogs/types.tsx @@ -505,7 +505,8 @@ interface CreateCa { type: EventType.CREATE_CA; metadata: { caId: string; - dn: string; + name: string; + dn?: string; }; } @@ -514,12 +515,14 @@ interface GetCa { metadata: { caId: string; dn: string; + name: string; }; } interface UpdateCa { type: EventType.UPDATE_CA; metadata: { + name: string; caId: string; dn: string; status: CaStatus; @@ -530,6 +533,7 @@ interface DeleteCa { type: EventType.DELETE_CA; metadata: { caId: string; + name: string; dn: string; }; }