Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.
TypeScript acmeagentsai-agentscertificate-managementdevsecopsenvironment-variableskubernetesopen-sourcepampkipostgresprivate-caprivileged-access-managementsecret-managementsecret-managersecretssecrets-managementsecuritysecurity-toolsvault
refactor(kmip): drop configurable common name, derive cert CN from server name
bernie-gbac691f9c946
diff --git a/backend/src/db/migrations/20260605120000_kmip-server-cert-config.ts b/backend/src/db/migrations/20260605120000_kmip-server-cert-config.tsindex caa89d10aa..c3f791b1d3 100644--- a/backend/src/db/migrations/20260605120000_kmip-server-cert-config.ts+++ b/backend/src/db/migrations/20260605120000_kmip-server-cert-config.ts@@ -5,7 +5,7 @@ import { TableName } from "../schemas";// Enrollment-based KMIP servers store their certificate config on the resource itself (set in the// UI at creation) instead of having the daemon pass it on every launch. The /connect endpoint// reads these; the legacy machine-identity /server-registration path still takes them in the body.-const COLUMNS = ["hostnamesOrIps", "ttl", "commonName", "keyAlgorithm"] as const;+const COLUMNS = ["hostnamesOrIps", "ttl", "keyAlgorithm"] as const;export async function up(knex: Knex): Promise<void> {if (await knex.schema.hasTable(TableName.KmipServer)) {diff --git a/backend/src/db/schemas/kmip-servers.ts b/backend/src/db/schemas/kmip-servers.tsindex 2d13bace14..56f62ca75f 100644--- a/backend/src/db/schemas/kmip-servers.ts+++ b/backend/src/db/schemas/kmip-servers.ts@@ -17,7 +17,6 @@ export const KmipServersSchema = z.object({tokenVersion: z.number().default(0),hostnamesOrIps: z.string().nullable().optional(),ttl: z.string().nullable().optional(),- commonName: z.string().nullable().optional(),keyAlgorithm: z.string().nullable().optional()});diff --git a/backend/src/ee/routes/v1/kmip-server-router.ts b/backend/src/ee/routes/v1/kmip-server-router.tsindex 6ba28a53f3..7c3d825bf1 100644--- a/backend/src/ee/routes/v1/kmip-server-router.ts+++ b/backend/src/ee/routes/v1/kmip-server-router.ts@@ -20,7 +20,6 @@ const SanitizedKmipServerSchema = KmipServersSchema.pick({name: true,hostnamesOrIps: true,ttl: true,- commonName: true,keyAlgorithm: true,createdAt: true,updatedAt: true,@@ -102,7 +101,6 @@ export const registerKmipServerRouter = async (server: FastifyZodProvider) => {name: slugSchema({ min: 1, max: 32, field: "name" }),hostnamesOrIps: validateAltNamesField,ttl: ttlField.optional().default("1y"),- commonName: z.string().trim().min(1).optional(),keyAlgorithm: z.nativeEnum(CertKeyAlgorithm).optional().default(CertKeyAlgorithm.RSA_2048),authMethod: SettableAuthMethodInputSchema}),@@ -112,7 +110,7 @@ export const registerKmipServerRouter = async (server: FastifyZodProvider) => {},onRequest: verifyAuth([AuthMode.JWT, AuthMode.IDENTITY_ACCESS_TOKEN]),handler: async (req) => {- const { authMethod: authMethodInput, name, hostnamesOrIps, ttl, commonName, keyAlgorithm } = req.body;+ const { authMethod: authMethodInput, name, hostnamesOrIps, ttl, keyAlgorithm } = req.body;const authMethodArg =authMethodInput.method === ResourceAuthMethodType.Aws? {@@ -129,7 +127,6 @@ export const registerKmipServerRouter = async (server: FastifyZodProvider) => {name,hostnamesOrIps,ttl,- commonName,keyAlgorithm,authMethod: authMethodArg,actor: {@@ -213,7 +210,6 @@ export const registerKmipServerRouter = async (server: FastifyZodProvider) => {body: z.object({hostnamesOrIps: validateAltNamesField.optional(),ttl: ttlField.optional(),- commonName: z.string().trim().min(1).optional(),keyAlgorithm: z.nativeEnum(CertKeyAlgorithm).optional(),authMethod: SettableAuthMethodInputSchema.optional()}),@@ -223,16 +219,14 @@ export const registerKmipServerRouter = async (server: FastifyZodProvider) => {},onRequest: verifyAuth([AuthMode.JWT, AuthMode.IDENTITY_ACCESS_TOKEN]),handler: async (req) => {- const { hostnamesOrIps, ttl, commonName, keyAlgorithm } = req.body;- const hasFieldUpdate =- hostnamesOrIps !== undefined || ttl !== undefined || commonName !== undefined || keyAlgorithm !== undefined;+ const { hostnamesOrIps, ttl, keyAlgorithm } = req.body;+ const hasFieldUpdate = hostnamesOrIps !== undefined || ttl !== undefined || keyAlgorithm !== undefined;const kmipServer = hasFieldUpdate? await server.services.kmipServer.updateKmipServer({kmipServerId: req.params.kmipServerId,hostnamesOrIps,ttl,- commonName,keyAlgorithm,actor: req.permission})@@ -540,7 +534,9 @@ export const registerKmipServerRouter = async (server: FastifyZodProvider) => {});}- const resolvedCommonName = kmipServer.commonName ?? kmipServer.name;+ // The server certificate's subject CN is cosmetic (clients verify the SAN, and nothing reads+ // the server CN), so it's derived from the server name rather than being separately configurable.+ const resolvedCommonName = kmipServer.name;const resolvedTtl = kmipServer.ttl ?? "1y";const resolvedKeyAlgorithm = (kmipServer.keyAlgorithm as CertKeyAlgorithm) ?? undefined;diff --git a/backend/src/ee/services/kmip-server/kmip-server-service.ts b/backend/src/ee/services/kmip-server/kmip-server-service.tsindex 43a5aa410c..13fd64172f 100644--- a/backend/src/ee/services/kmip-server/kmip-server-service.ts+++ b/backend/src/ee/services/kmip-server/kmip-server-service.ts@@ -44,7 +44,6 @@ export const kmipServerServiceFactory = ({name,hostnamesOrIps,ttl,- commonName,keyAlgorithm,authMethod,actor@@ -52,7 +51,6 @@ export const kmipServerServiceFactory = ({name: string;hostnamesOrIps: string;ttl?: string;- commonName?: string;keyAlgorithm?: string;authMethod:| { method: "aws"; config: { stsEndpoint: string; allowedPrincipalArns: string; allowedAccountIds: string } }@@ -63,10 +61,7 @@ export const kmipServerServiceFactory = ({try {return await kmipServerDAL.transaction(async (tx) => {- const created = await kmipServerDAL.create(- { name, orgId: actor.orgId, hostnamesOrIps, ttl, commonName, keyAlgorithm },- tx- );+ const created = await kmipServerDAL.create({ name, orgId: actor.orgId, hostnamesOrIps, ttl, keyAlgorithm }, tx);await resourceAuthMethodService.initAtCreate({ resource: { type: "kmip", id: created.id }, authMethod }, tx);return created;});@@ -86,7 +81,6 @@ export const kmipServerServiceFactory = ({kmipServerId: string;hostnamesOrIps?: string;ttl?: string;- commonName?: string;keyAlgorithm?: string;actor: TActor;}) => {diff --git a/docs/cli/commands/kmip.mdx b/docs/cli/commands/kmip.mdxindex 70679981d0..2ea97b744b 100644--- a/docs/cli/commands/kmip.mdx+++ b/docs/cli/commands/kmip.mdx@@ -29,7 +29,7 @@ The Infisical KMIP server provides Key Management Interoperability Protocol (KMIThe server is created as an entity in the Infisical UI and then enrolled from the host where you run it, using either a one-time enrollment **token** or **AWS** authentication. The deploy command (including the enrollment token) can be copied from the server's detail page via **Show deploy command**.-The server's certificate configuration (hostnames/IPs, TTL, common name, and key algorithm) is defined on the server entity in the UI. The CLI fetches it on start, so you do not pass it on the command line. To change the certificate, edit the configuration in the UI and restart the server.+The server's certificate configuration (hostnames/IPs, TTL, and key algorithm) is defined on the server entity in the UI. The CLI fetches it on start, so you do not pass it on the command line. To change the certificate, edit the configuration in the UI and restart the server.For detailed information about KMIP integration, PKI setup, and client configuration, see the [KMIP Integration Guide](/documentation/platform/kms/kmip).diff --git a/docs/documentation/platform/kms/kmip.mdx b/docs/documentation/platform/kms/kmip.mdxindex 9b6b2991a3..3d9b14093a 100644--- a/docs/documentation/platform/kms/kmip.mdx+++ b/docs/documentation/platform/kms/kmip.mdx@@ -65,7 +65,6 @@ A KMIP server is created as an organization-wide entity in Infisical and then en2. Click **Create KMIP Server** and fill in:- **Name** of the server.- **Hostnames or IPs**: a comma-separated list of the hostnames or IPs that KMIP clients will use to reach this server (for example `kmip.example.com` or `10.0.1.50`). These become the Subject Alternative Names (SANs) of the server's TLS certificate, so they must match how clients connect.- - **Common Name** (optional): subject common name for the server certificate. Defaults to the server name.- **Certificate TTL**: validity period of the server certificate (for example `1y`).- **Key Algorithm**: key algorithm used to sign the server certificate.@@ -154,7 +153,7 @@ A KMIP server is created as an organization-wide entity in Infisical and then en</Warning><Note>- The server's certificate configuration (hostnames/IPs, TTL, common name, key algorithm) is read from the server entity you configured in the UI, so the deploy command does not include it. To change the certificate, edit the **Certificate Configuration** card on the server's detail page and restart the server.+ The server's certificate configuration (hostnames/IPs, TTL, key algorithm) is read from the server entity you configured in the UI, so the deploy command does not include it. To change the certificate, edit the **Certificate Configuration** card on the server's detail page and restart the server.</Note><Note>@@ -188,7 +187,7 @@ A KMIP server is created as an organization-wide entity in Infisical and then enFrom the KMIP server's detail page (under **Infisical KMS > KMIP Servers**):- **Show deploy command** — Generates a fresh enrollment token (token method) or re-displays the AWS start command. For token-method servers this does not disconnect a running server; the next enrollment with the new token supersedes the old one.-- **Edit certificate configuration**: Update the hostnames/IPs, common name, TTL, or key algorithm used for the server's TLS certificate. Restart the server after saving for the new certificate to take effect.+- **Edit certificate configuration**: Update the hostnames/IPs, TTL, or key algorithm used for the server's TLS certificate. Restart the server after saving for the new certificate to take effect.- **Edit authentication** — Switch between Token and AWS, or update the AWS allowlists.- **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.diff --git a/frontend/src/hooks/api/kmipServers/mutations.tsx b/frontend/src/hooks/api/kmipServers/mutations.tsxindex 9fb29392b1..216163d3bf 100644--- a/frontend/src/hooks/api/kmipServers/mutations.tsx+++ b/frontend/src/hooks/api/kmipServers/mutations.tsx@@ -47,14 +47,12 @@ export const useUpdateKmipServer = () => {authMethod,hostnamesOrIps,ttl,- commonName,keyAlgorithm}: TUpdateKmipServerDTO) => {const body: Record<string, unknown> = {};if (authMethod !== undefined) body.authMethod = authMethod;if (hostnamesOrIps !== undefined) body.hostnamesOrIps = hostnamesOrIps;if (ttl !== undefined) body.ttl = ttl;- if (commonName !== undefined) body.commonName = commonName;if (keyAlgorithm !== undefined) body.keyAlgorithm = keyAlgorithm;const { data } = await apiRequest.patch<TKmipServerWithAuthMethod>(diff --git a/frontend/src/hooks/api/kmipServers/types.ts b/frontend/src/hooks/api/kmipServers/types.tsindex 5866f495ab..cec15033d3 100644--- a/frontend/src/hooks/api/kmipServers/types.ts+++ b/frontend/src/hooks/api/kmipServers/types.ts@@ -30,7 +30,6 @@ export type TKmipServer = {heartbeat: string | null;hostnamesOrIps: string | null;ttl: string | null;- commonName: string | null;keyAlgorithm: string | null;};@@ -47,7 +46,6 @@ export type TCreateKmipServerDTO = {name: string;hostnamesOrIps: string;ttl?: string;- commonName?: string;keyAlgorithm?: CertKeyAlgorithm;authMethod:| {@@ -63,7 +61,6 @@ export type TUpdateKmipServerDTO = {kmipServerId: string;hostnamesOrIps?: string;ttl?: string;- commonName?: string;keyAlgorithm?: CertKeyAlgorithm;authMethod?:| {diff --git a/frontend/src/pages/organization/KmipServersPage/KmipServerDetailsByIDPage/components/KmipServerCertConfig/KmipServerCertConfigModal.tsx b/frontend/src/pages/organization/KmipServersPage/KmipServerDetailsByIDPage/components/KmipServerCertConfig/KmipServerCertConfigModal.tsxindex 72c167c3b2..1d6ef9ec81 100644--- a/frontend/src/pages/organization/KmipServersPage/KmipServerDetailsByIDPage/components/KmipServerCertConfig/KmipServerCertConfigModal.tsx+++ b/frontend/src/pages/organization/KmipServersPage/KmipServerDetailsByIDPage/components/KmipServerCertConfig/KmipServerCertConfigModal.tsx@@ -36,7 +36,6 @@ const keyAlgorithmOptions = certKeyAlgorithmsconst schema = z.object({hostnamesOrIps: z.string().trim().min(1, "At least one hostname or IP is required"),ttl: z.string().trim().min(1, "TTL is required"),- commonName: z.string().trim().optional(),keyAlgorithm: z.nativeEnum(CertKeyAlgorithm)});@@ -55,7 +54,6 @@ export const KmipServerCertConfigModal = ({ isOpen, onOpenChange, kmipServer }:const defaults: FormData = {hostnamesOrIps: kmipServer.hostnamesOrIps ?? "",ttl: kmipServer.ttl ?? "1y",- commonName: kmipServer.commonName ?? "",keyAlgorithm: (kmipServer.keyAlgorithm as CertKeyAlgorithm) ?? CertKeyAlgorithm.RSA_2048};@@ -80,7 +78,6 @@ export const KmipServerCertConfigModal = ({ isOpen, onOpenChange, kmipServer }:kmipServerId: kmipServer.id,hostnamesOrIps: form.hostnamesOrIps,ttl: form.ttl,- commonName: form.commonName?.trim() ? form.commonName.trim() : undefined,keyAlgorithm: form.keyAlgorithm});createNotification({@@ -120,23 +117,6 @@ export const KmipServerCertConfigModal = ({ isOpen, onOpenChange, kmipServer }:</Field>)}/>- <Controller- control={control}- name="commonName"- render={({ field, fieldState: { error } }) => (- <Field>- <FieldLabel>Common Name</FieldLabel>- <FieldContent>- <Input- {...field}- isError={Boolean(error)}- placeholder="(defaults to server name)"- />- <FieldError errors={[error]} />- </FieldContent>- </Field>- )}- /><Controllercontrol={control}name="ttl"diff --git a/frontend/src/pages/organization/KmipServersPage/KmipServerDetailsByIDPage/components/KmipServerDeploySection/KmipServerDeployCommandDialog.tsx b/frontend/src/pages/organization/KmipServersPage/KmipServerDetailsByIDPage/components/KmipServerDeploySection/KmipServerDeployCommandDialog.tsxindex d64b7d7a31..430b540c71 100644--- a/frontend/src/pages/organization/KmipServersPage/KmipServerDetailsByIDPage/components/KmipServerDeploySection/KmipServerDeployCommandDialog.tsx+++ b/frontend/src/pages/organization/KmipServersPage/KmipServerDetailsByIDPage/components/KmipServerDeploySection/KmipServerDeployCommandDialog.tsx@@ -65,8 +65,8 @@ export const KmipServerDeployCommandDialog = ({const badgeLabel = authMethod === "aws" ? "AWS Auth" : "Token Auth";const helperText =authMethod === "aws"- ? "The host must have AWS credentials whose principal matches your allowlist. The certificate config (hostnames/IPs, TTL, common name, key algorithm) is read from the server's settings."- : "The enrollment token expires in 1 hour and can only be used once. The certificate config (hostnames/IPs, TTL, common name, key algorithm) is read from the server's settings.";+ ? "The host must have AWS credentials whose principal matches your allowlist. The certificate config (hostnames/IPs, TTL, key algorithm) is read from the server's settings."+ : "The enrollment token expires in 1 hour and can only be used once. The certificate config (hostnames/IPs, TTL, key algorithm) is read from the server's settings.";return (<Modal isOpen={isOpen} onOpenChange={onOpenChange}>diff --git a/frontend/src/pages/organization/KmipServersPage/KmipServerDetailsByIDPage/components/KmipServerDetailsCard/KmipServerDetailsCard.tsx b/frontend/src/pages/organization/KmipServersPage/KmipServerDetailsByIDPage/components/KmipServerDetailsCard/KmipServerDetailsCard.tsxindex c32052a2e9..e953a3deef 100644--- a/frontend/src/pages/organization/KmipServersPage/KmipServerDetailsByIDPage/components/KmipServerDetailsCard/KmipServerDetailsCard.tsx+++ b/frontend/src/pages/organization/KmipServersPage/KmipServerDetailsByIDPage/components/KmipServerDetailsCard/KmipServerDetailsCard.tsx@@ -123,12 +123,6 @@ export const KmipServerDetailsCard = ({{kmipServer.hostnamesOrIps || <span className="text-muted">—</span>}</DetailValue></Detail>- <Detail>- <DetailLabel>Common Name</DetailLabel>- <DetailValue>- {kmipServer.commonName || <span className="text-muted">{kmipServer.name}</span>}- </DetailValue>- </Detail><Detail><DetailLabel>Certificate TTL</DetailLabel><DetailValue>{kmipServer.ttl || "1y"}</DetailValue>diff --git a/frontend/src/pages/organization/KmipServersPage/components/components/KmipServerDeployModal.tsx b/frontend/src/pages/organization/KmipServersPage/components/components/KmipServerDeployModal.tsxindex 372d41f8f2..57b5a80c80 100644--- a/frontend/src/pages/organization/KmipServersPage/components/components/KmipServerDeployModal.tsx+++ b/frontend/src/pages/organization/KmipServersPage/components/components/KmipServerDeployModal.tsx@@ -27,7 +27,6 @@ const schema = z.object({name: z.string().trim().min(1, "Name is required"),hostnamesOrIps: z.string().trim().min(1, "At least one hostname or IP is required"),ttl: z.string().trim().min(1, "TTL is required"),- commonName: z.string().trim().optional(),keyAlgorithm: z.nativeEnum(CertKeyAlgorithm)});@@ -55,7 +54,6 @@ export const KmipServerDeployModal = ({ isOpen, onOpenChange }: Props) => {name: "",hostnamesOrIps: "",ttl: "1y",- commonName: "",keyAlgorithm: CertKeyAlgorithm.RSA_2048}});@@ -66,7 +64,6 @@ export const KmipServerDeployModal = ({ isOpen, onOpenChange }: Props) => {name: form.name,hostnamesOrIps: form.hostnamesOrIps,ttl: form.ttl,- commonName: form.commonName?.trim() ? form.commonName.trim() : undefined,keyAlgorithm: form.keyAlgorithm,authMethod: { method: "token" }});@@ -127,20 +124,6 @@ export const KmipServerDeployModal = ({ isOpen, onOpenChange }: Props) => {</FormControl>)}/>- <Controller- control={control}- name="commonName"- render={({ field, fieldState: { error } }) => (- <FormControl- label="Common Name"- isError={Boolean(error)}- errorText={error?.message}- helperText="Subject common name for the server certificate. Defaults to the server name."- >- <Input {...field} placeholder="(defaults to server name)" />- </FormControl>- )}- /><Controllercontrol={control}name="ttl"