Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

feat(kmip): dedicated kmip-server-connect audit event

bernie-g6dced8e1f4a7
diff --git a/backend/src/ee/routes/v1/kmip-server-router.ts b/backend/src/ee/routes/v1/kmip-server-router.ts
index 344651b424..e514cc7dfb 100644
--- a/backend/src/ee/routes/v1/kmip-server-router.ts
+++ b/backend/src/ee/routes/v1/kmip-server-router.ts
@@ -10,7 +10,6 @@ import { ms } from "@app/lib/ms";
import { readLimit, writeLimit } from "@app/server/config/rateLimiter";
import { slugSchema } from "@app/server/lib/schemas";
import { verifyAuth } from "@app/server/plugins/auth/verify-auth";
-import { booleanSchema } from "@app/server/routes/sanitizedSchemas";
import { ActorType, AuthMode } from "@app/services/auth/auth-type";
import { CertKeyAlgorithm } from "@app/services/certificate/certificate-types";
import { validateAltNamesField } from "@app/services/certificate-authority/certificate-authority-validators";
@@ -560,13 +559,6 @@ export const registerKmipServerRouter = async (server: FastifyZodProvider) => {
url: "/connect",
config: { rateLimit: writeLimit },
schema: {
- querystring: z.object({
- isRenewal: booleanSchema
- .default(false)
- .describe(
- "Set by the KMIP server daemon when fetching a replacement certificate for one it is already serving, so renewals are distinguishable from first-time connects in the audit log."
- )
- }),
response: {
200: z.object({
clientCertificateChain: z.string(),
@@ -610,14 +602,13 @@ export const registerKmipServerRouter = async (server: FastifyZodProvider) => {
...req.auditLogInfo,
orgId: req.permission.orgId,
event: {
- type: EventType.REGISTER_KMIP_SERVER,
+ type: EventType.KMIP_SERVER_CONNECT,
metadata: {
serverCertificateSerialNumber: configs.serverCertificateSerialNumber,
hostnamesOrIps: kmipServer.hostnamesOrIps,
commonName: resolvedCommonName,
keyAlgorithm: resolvedKeyAlgorithm ?? CertKeyAlgorithm.RSA_2048,
- ttl: resolvedTtl,
- isRenewal: req.query.isRenewal
+ ttl: resolvedTtl
}
}
});
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 d761c66aa1..0c3209a863 100644
--- a/backend/src/ee/services/audit-log/audit-log-types.ts
+++ b/backend/src/ee/services/audit-log/audit-log-types.ts
@@ -593,6 +593,7 @@ export enum EventType {
SETUP_KMIP = "setup-kmip",
GET_KMIP = "get-kmip",
REGISTER_KMIP_SERVER = "register-kmip-server",
+ KMIP_SERVER_CONNECT = "kmip-server-connect",
KMIP_OPERATION_CREATE = "kmip-operation-create",
KMIP_OPERATION_GET = "kmip-operation-get",
@@ -5016,7 +5017,17 @@ interface RegisterKmipServerEvent {
commonName: string;
keyAlgorithm: CertKeyAlgorithm;
ttl: string;
- isRenewal?: boolean;
+ };
+}
+
+interface KmipServerConnectEvent {
+ type: EventType.KMIP_SERVER_CONNECT;
+ metadata: {
+ serverCertificateSerialNumber: string;
+ hostnamesOrIps: string;
+ commonName: string;
+ keyAlgorithm: CertKeyAlgorithm;
+ ttl: string;
};
}
@@ -7402,6 +7413,7 @@ export type Event =
| SetupKmipEvent
| GetKmipEvent
| RegisterKmipServerEvent
+ | KmipServerConnectEvent
| KmipOperationGetEvent
| KmipOperationDestroyEvent
| KmipOperationCreateEvent
diff --git a/docs/documentation/platform/kms/kmip.mdx b/docs/documentation/platform/kms/kmip.mdx
index 76b3eb78bd..98e8335122 100644
--- a/docs/documentation/platform/kms/kmip.mdx
+++ b/docs/documentation/platform/kms/kmip.mdx
@@ -193,13 +193,13 @@ From the KMIP server's detail page (under **Infisical KMS > KMIP Servers**):
- **Options → Revoke Access** — Invalidates the server's outstanding access tokens and enrollment tokens. The server must re-enroll to reconnect.
- **Options → Delete** — Permanently removes the KMIP server entity.
-### Certificate Auto-Renewal
+### Renewal Failures
-A running KMIP server renews its TLS certificate automatically once two-thirds of the certificate's validity period has elapsed. Renewal happens in the background: no restart is needed, existing client connections are not interrupted, and new connections use the renewed certificate right away. Each renewal is recorded in the organization audit log as a `register-kmip-server` event with `isRenewal: true`.
+The server's TLS certificate renews automatically in the background; no action is needed and existing client connections are never interrupted. You only need to step in if renewal fails, which the server reports with `Certificate renewal failed` warnings and errors in its logs.
-If a renewal attempt fails (for example, the Infisical platform is temporarily unreachable), the server keeps serving its current certificate and retries with increasing frequency as expiry approaches, logging warnings and errors so you can intervene. Once the platform is reachable again, the next retry succeeds and normal operation resumes.
+If the failure is transient (for example, the Infisical platform is temporarily unreachable), the server keeps serving its current certificate and retries with increasing frequency as expiry approaches. Once the platform is reachable again, the next retry succeeds and normal operation resumes on its own.
-If you revoke the server's access, renewal fails with an authentication error. AWS-enrolled servers recover automatically by re-authenticating via STS. Token-enrolled servers cannot, since enrollment tokens are single-use; the server logs an error asking you to re-enroll. Generate a new enrollment token via **Show deploy command** and restart the server with it to recover.
+If the failure is an authentication error (for example, after revoking the server's access), recovery depends on the auth method. AWS-enrolled servers recover automatically by re-authenticating via STS. Token-enrolled servers cannot, since enrollment tokens are single-use; the server logs an error asking you to re-enroll. Generate a new enrollment token via **Show deploy command** and restart the server with it to recover.
## Register a KMIP Client
diff --git a/frontend/src/hooks/api/auditLogs/constants.tsx b/frontend/src/hooks/api/auditLogs/constants.tsx
index aa54ee1cd9..017aa657a6 100644
--- a/frontend/src/hooks/api/auditLogs/constants.tsx
+++ b/frontend/src/hooks/api/auditLogs/constants.tsx
@@ -204,6 +204,7 @@ export const eventToNameMap: { [K in EventType]: string } = {
[EventType.SETUP_KMIP]: "Setup KMIP configuration",
[EventType.GET_KMIP]: "Get KMIP configuration",
[EventType.REGISTER_KMIP_SERVER]: "Register KMIP server",
+ [EventType.KMIP_SERVER_CONNECT]: "KMIP server connect",
[EventType.KMIP_OPERATION_CREATE]: "KMIP operation create",
[EventType.KMIP_OPERATION_GET]: "KMIP operation get",
[EventType.KMIP_OPERATION_DESTROY]: "KMIP operation destroy",
diff --git a/frontend/src/hooks/api/auditLogs/enums.tsx b/frontend/src/hooks/api/auditLogs/enums.tsx
index 7bafbb061b..0d4f2ab1b9 100644
--- a/frontend/src/hooks/api/auditLogs/enums.tsx
+++ b/frontend/src/hooks/api/auditLogs/enums.tsx
@@ -211,6 +211,7 @@ export enum EventType {
SETUP_KMIP = "setup-kmip",
GET_KMIP = "get-kmip",
REGISTER_KMIP_SERVER = "register-kmip-server",
+ KMIP_SERVER_CONNECT = "kmip-server-connect",
KMIP_OPERATION_CREATE = "kmip-operation-create",
KMIP_OPERATION_GET = "kmip-operation-get",
KMIP_OPERATION_DESTROY = "kmip-operation-destroy",