mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-04 14:26:25 +00:00
Add frontend audit log ui for pki alerting / collection
This commit is contained in:
@@ -148,7 +148,6 @@ export enum EventType {
|
|||||||
GET_PKI_ALERT = "get-pki-alert",
|
GET_PKI_ALERT = "get-pki-alert",
|
||||||
UPDATE_PKI_ALERT = "update-pki-alert",
|
UPDATE_PKI_ALERT = "update-pki-alert",
|
||||||
DELETE_PKI_ALERT = "delete-pki-alert",
|
DELETE_PKI_ALERT = "delete-pki-alert",
|
||||||
// new
|
|
||||||
CREATE_PKI_COLLECTION = "create-pki-collection",
|
CREATE_PKI_COLLECTION = "create-pki-collection",
|
||||||
GET_PKI_COLLECTION = "get-pki-collection",
|
GET_PKI_COLLECTION = "get-pki-collection",
|
||||||
UPDATE_PKI_COLLECTION = "update-pki-collection",
|
UPDATE_PKI_COLLECTION = "update-pki-collection",
|
||||||
@@ -156,7 +155,6 @@ export enum EventType {
|
|||||||
GET_PKI_COLLECTION_ITEMS = "get-pki-collection-items",
|
GET_PKI_COLLECTION_ITEMS = "get-pki-collection-items",
|
||||||
ADD_PKI_COLLECTION_ITEM = "add-pki-collection-item",
|
ADD_PKI_COLLECTION_ITEM = "add-pki-collection-item",
|
||||||
DELETE_PKI_COLLECTION_ITEM = "delete-pki-collection-item",
|
DELETE_PKI_COLLECTION_ITEM = "delete-pki-collection-item",
|
||||||
// end
|
|
||||||
CREATE_KMS = "create-kms",
|
CREATE_KMS = "create-kms",
|
||||||
UPDATE_KMS = "update-kms",
|
UPDATE_KMS = "update-kms",
|
||||||
DELETE_KMS = "delete-kms",
|
DELETE_KMS = "delete-kms",
|
||||||
|
|||||||
@@ -57,6 +57,17 @@ export const eventToNameMap: { [K in EventType]: string } = {
|
|||||||
[EventType.DELETE_CERT]: "Delete certificate",
|
[EventType.DELETE_CERT]: "Delete certificate",
|
||||||
[EventType.REVOKE_CERT]: "Revoke certificate",
|
[EventType.REVOKE_CERT]: "Revoke certificate",
|
||||||
[EventType.GET_CERT_BODY]: "Get certificate body",
|
[EventType.GET_CERT_BODY]: "Get certificate body",
|
||||||
|
[EventType.CREATE_PKI_ALERT]: "Create PKI alert",
|
||||||
|
[EventType.GET_PKI_ALERT]: "Get PKI alert",
|
||||||
|
[EventType.UPDATE_PKI_ALERT]: "Update PKI alert",
|
||||||
|
[EventType.DELETE_PKI_ALERT]: "Delete PKI alert",
|
||||||
|
[EventType.CREATE_PKI_COLLECTION]: "Create PKI collection",
|
||||||
|
[EventType.GET_PKI_COLLECTION]: "Get PKI collection",
|
||||||
|
[EventType.UPDATE_PKI_COLLECTION]: "Update PKI collection",
|
||||||
|
[EventType.DELETE_PKI_COLLECTION]: "Delete PKI collection",
|
||||||
|
[EventType.GET_PKI_COLLECTION_ITEMS]: "Get PKI collection items",
|
||||||
|
[EventType.ADD_PKI_COLLECTION_ITEM]: "Add PKI collection item",
|
||||||
|
[EventType.DELETE_PKI_COLLECTION_ITEM]: "Delete PKI collection item",
|
||||||
[EventType.ORG_ADMIN_ACCESS_PROJECT]: "Org admin accessed project"
|
[EventType.ORG_ADMIN_ACCESS_PROJECT]: "Org admin accessed project"
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -71,5 +71,16 @@ export enum EventType {
|
|||||||
DELETE_CERT = "delete-cert",
|
DELETE_CERT = "delete-cert",
|
||||||
REVOKE_CERT = "revoke-cert",
|
REVOKE_CERT = "revoke-cert",
|
||||||
GET_CERT_BODY = "get-cert-body",
|
GET_CERT_BODY = "get-cert-body",
|
||||||
|
CREATE_PKI_ALERT = "create-pki-alert",
|
||||||
|
GET_PKI_ALERT = "get-pki-alert",
|
||||||
|
UPDATE_PKI_ALERT = "update-pki-alert",
|
||||||
|
DELETE_PKI_ALERT = "delete-pki-alert",
|
||||||
|
CREATE_PKI_COLLECTION = "create-pki-collection",
|
||||||
|
GET_PKI_COLLECTION = "get-pki-collection",
|
||||||
|
UPDATE_PKI_COLLECTION = "update-pki-collection",
|
||||||
|
DELETE_PKI_COLLECTION = "delete-pki-collection",
|
||||||
|
GET_PKI_COLLECTION_ITEMS = "get-pki-collection-items",
|
||||||
|
ADD_PKI_COLLECTION_ITEM = "add-pki-collection-item",
|
||||||
|
DELETE_PKI_COLLECTION_ITEM = "delete-pki-collection-item",
|
||||||
ORG_ADMIN_ACCESS_PROJECT = "org-admin-accessed-project"
|
ORG_ADMIN_ACCESS_PROJECT = "org-admin-accessed-project"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import { CaStatus } from "../ca";
|
import { CaStatus } from "../ca";
|
||||||
import { IdentityTrustedIp } from "../identities/types";
|
import { IdentityTrustedIp } from "../identities/types";
|
||||||
|
import { PkiItemType } from "../pkiCollections/constants";
|
||||||
import { ActorType, EventType, UserAgentType } from "./enums";
|
import { ActorType, EventType, UserAgentType } from "./enums";
|
||||||
|
|
||||||
interface UserActorMetadata {
|
interface UserActorMetadata {
|
||||||
@@ -579,6 +580,95 @@ interface GetCertBody {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
interface CreatePkiAlert {
|
||||||
|
type: EventType.CREATE_PKI_ALERT;
|
||||||
|
metadata: {
|
||||||
|
pkiAlertId: string;
|
||||||
|
pkiCollectionId: string;
|
||||||
|
name: string;
|
||||||
|
alertBeforeDays: number;
|
||||||
|
recipientEmails: string;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
interface GetPkiAlert {
|
||||||
|
type: EventType.GET_PKI_ALERT;
|
||||||
|
metadata: {
|
||||||
|
pkiAlertId: string;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
interface UpdatePkiAlert {
|
||||||
|
type: EventType.UPDATE_PKI_ALERT;
|
||||||
|
metadata: {
|
||||||
|
pkiAlertId: string;
|
||||||
|
pkiCollectionId?: string;
|
||||||
|
name?: string;
|
||||||
|
alertBeforeDays?: number;
|
||||||
|
recipientEmails?: string;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
interface DeletePkiAlert {
|
||||||
|
type: EventType.DELETE_PKI_ALERT;
|
||||||
|
metadata: {
|
||||||
|
pkiAlertId: string;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
interface CreatePkiCollection {
|
||||||
|
type: EventType.CREATE_PKI_COLLECTION;
|
||||||
|
metadata: {
|
||||||
|
pkiCollectionId: string;
|
||||||
|
name: string;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
interface GetPkiCollection {
|
||||||
|
type: EventType.GET_PKI_COLLECTION;
|
||||||
|
metadata: {
|
||||||
|
pkiCollectionId: string;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
interface UpdatePkiCollection {
|
||||||
|
type: EventType.UPDATE_PKI_COLLECTION;
|
||||||
|
metadata: {
|
||||||
|
pkiCollectionId: string;
|
||||||
|
name?: string;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
interface DeletePkiCollection {
|
||||||
|
type: EventType.DELETE_PKI_COLLECTION;
|
||||||
|
metadata: {
|
||||||
|
pkiCollectionId: string;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
interface GetPkiCollectionItems {
|
||||||
|
type: EventType.GET_PKI_COLLECTION_ITEMS;
|
||||||
|
metadata: {
|
||||||
|
pkiCollectionId: string;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
interface AddPkiCollectionItem {
|
||||||
|
type: EventType.ADD_PKI_COLLECTION_ITEM;
|
||||||
|
metadata: {
|
||||||
|
pkiCollectionItemId: string;
|
||||||
|
pkiCollectionId: string;
|
||||||
|
type: PkiItemType;
|
||||||
|
itemId: string;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
interface DeletePkiCollectionItem {
|
||||||
|
type: EventType.DELETE_PKI_COLLECTION_ITEM;
|
||||||
|
metadata: {
|
||||||
|
pkiCollectionItemId: string;
|
||||||
|
pkiCollectionId: string;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
interface OrgAdminAccessProjectEvent {
|
interface OrgAdminAccessProjectEvent {
|
||||||
type: EventType.ORG_ADMIN_ACCESS_PROJECT;
|
type: EventType.ORG_ADMIN_ACCESS_PROJECT;
|
||||||
metadata: {
|
metadata: {
|
||||||
@@ -646,6 +736,17 @@ export type Event =
|
|||||||
| DeleteCert
|
| DeleteCert
|
||||||
| RevokeCert
|
| RevokeCert
|
||||||
| GetCertBody
|
| GetCertBody
|
||||||
|
| CreatePkiAlert
|
||||||
|
| GetPkiAlert
|
||||||
|
| UpdatePkiAlert
|
||||||
|
| DeletePkiAlert
|
||||||
|
| CreatePkiCollection
|
||||||
|
| GetPkiCollection
|
||||||
|
| UpdatePkiCollection
|
||||||
|
| DeletePkiCollection
|
||||||
|
| GetPkiCollectionItems
|
||||||
|
| AddPkiCollectionItem
|
||||||
|
| DeletePkiCollectionItem
|
||||||
| OrgAdminAccessProjectEvent;
|
| OrgAdminAccessProjectEvent;
|
||||||
|
|
||||||
export type AuditLog = {
|
export type AuditLog = {
|
||||||
|
|||||||
@@ -323,6 +323,65 @@ export const LogsTableRow = ({ auditLog }: Props) => {
|
|||||||
<p>{`Email: ${event.metadata.email}`}</p>
|
<p>{`Email: ${event.metadata.email}`}</p>
|
||||||
</Td>
|
</Td>
|
||||||
);
|
);
|
||||||
|
case EventType.CREATE_PKI_ALERT:
|
||||||
|
case EventType.UPDATE_PKI_ALERT:
|
||||||
|
return (
|
||||||
|
<Td>
|
||||||
|
<p>{`Alert ID: ${event.metadata.pkiAlertId}`}</p>
|
||||||
|
<p>{`Name: ${event.metadata.name}`}</p>
|
||||||
|
<p>{`Alert Before Days: ${event.metadata.alertBeforeDays}`}</p>
|
||||||
|
</Td>
|
||||||
|
);
|
||||||
|
case EventType.GET_PKI_ALERT:
|
||||||
|
case EventType.DELETE_PKI_ALERT:
|
||||||
|
return (
|
||||||
|
<Td>
|
||||||
|
<p>{`Alert ID: ${event.metadata.pkiAlertId}`}</p>
|
||||||
|
</Td>
|
||||||
|
);
|
||||||
|
case EventType.CREATE_PKI_COLLECTION:
|
||||||
|
return (
|
||||||
|
<Td>
|
||||||
|
<p>{`Collection ID: ${event.metadata.pkiCollectionId}`}</p>
|
||||||
|
<p>{`Name: ${event.metadata.name}`}</p>
|
||||||
|
</Td>
|
||||||
|
);
|
||||||
|
case EventType.UPDATE_PKI_COLLECTION:
|
||||||
|
return (
|
||||||
|
<Td>
|
||||||
|
<p>{`Collection ID: ${event.metadata.pkiCollectionId}`}</p>
|
||||||
|
<p>{`Name: ${event.metadata.name}`}</p>
|
||||||
|
</Td>
|
||||||
|
);
|
||||||
|
case EventType.GET_PKI_COLLECTION:
|
||||||
|
case EventType.DELETE_PKI_COLLECTION:
|
||||||
|
return (
|
||||||
|
<Td>
|
||||||
|
<p>{`Collection ID: ${event.metadata.pkiCollectionId}`}</p>
|
||||||
|
</Td>
|
||||||
|
);
|
||||||
|
case EventType.GET_PKI_COLLECTION_ITEMS:
|
||||||
|
return (
|
||||||
|
<Td>
|
||||||
|
<p>{`Collection ID: ${event.metadata.pkiCollectionId}`}</p>
|
||||||
|
</Td>
|
||||||
|
);
|
||||||
|
case EventType.ADD_PKI_COLLECTION_ITEM:
|
||||||
|
return (
|
||||||
|
<Td>
|
||||||
|
<p>{`Collection ID: ${event.metadata.pkiCollectionId}`}</p>
|
||||||
|
<p>{`Collection Item ID: ${event.metadata.pkiCollectionItemId}`}</p>
|
||||||
|
<p>{`Type: ${event.metadata.type}`}</p>
|
||||||
|
<p>{`Item ID: ${event.metadata.itemId}`}</p>
|
||||||
|
</Td>
|
||||||
|
);
|
||||||
|
case EventType.DELETE_PKI_COLLECTION_ITEM:
|
||||||
|
return (
|
||||||
|
<Td>
|
||||||
|
<p>{`Collection ID: ${event.metadata.pkiCollectionId}`}</p>
|
||||||
|
<p>{`Collection Item ID: ${event.metadata.pkiCollectionItemId}`}</p>
|
||||||
|
</Td>
|
||||||
|
);
|
||||||
case EventType.CREATE_CA:
|
case EventType.CREATE_CA:
|
||||||
case EventType.GET_CA:
|
case EventType.GET_CA:
|
||||||
case EventType.UPDATE_CA:
|
case EventType.UPDATE_CA:
|
||||||
|
|||||||
+2
@@ -51,6 +51,8 @@ export const formSchema = z.object({
|
|||||||
"ip-allowlist": generalPermissionSchema,
|
"ip-allowlist": generalPermissionSchema,
|
||||||
"certificate-authorities": generalPermissionSchema,
|
"certificate-authorities": generalPermissionSchema,
|
||||||
certificates: generalPermissionSchema,
|
certificates: generalPermissionSchema,
|
||||||
|
"pki-alerts": generalPermissionSchema,
|
||||||
|
"pki-collections": generalPermissionSchema,
|
||||||
// akhilmhdh: refactor all keys like below
|
// akhilmhdh: refactor all keys like below
|
||||||
[ProjectPermissionSub.SecretApproval]: generalPermissionSchema,
|
[ProjectPermissionSub.SecretApproval]: generalPermissionSchema,
|
||||||
workspace: z
|
workspace: z
|
||||||
|
|||||||
+8
@@ -81,6 +81,14 @@ const SINGLE_PERMISSION_LIST = [
|
|||||||
title: "Certificates",
|
title: "Certificates",
|
||||||
formName: "certificates"
|
formName: "certificates"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
title: "PKI Collections",
|
||||||
|
formName: "pki-collections"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "PKI Alerts",
|
||||||
|
formName: "pki-alerts"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
title: "Secret Rollback",
|
title: "Secret Rollback",
|
||||||
formName: "secret-rollback"
|
formName: "secret-rollback"
|
||||||
|
|||||||
Reference in New Issue
Block a user