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
Address PR comments
Carlos Monastyrski46e346190ffd
diff --git a/backend/src/@types/fastify.d.ts b/backend/src/@types/fastify.d.tsindex 3237a724c0..b37b77f642 100644--- a/backend/src/@types/fastify.d.ts+++ b/backend/src/@types/fastify.d.ts@@ -326,7 +326,7 @@ declare module "fastify" {pkiSync: TPkiSyncServiceFactory;pkiDiscovery: TPkiDiscoveryServiceFactory;pkiInstallation: TPkiInstallationServiceFactory;- signer: TSignerServiceFactory;+ pkiSigner: TSignerServiceFactory;secretScanning: TSecretScanningServiceFactory;license: TLicenseServiceFactory;trustedIp: TTrustedIpServiceFactory;diff --git a/backend/src/@types/knex.d.ts b/backend/src/@types/knex.d.tsindex b19fd684bf..d297584bd2 100644--- a/backend/src/@types/knex.d.ts+++ b/backend/src/@types/knex.d.ts@@ -365,6 +365,12 @@ import {TPkiEstEnrollmentConfigs,TPkiEstEnrollmentConfigsInsert,TPkiEstEnrollmentConfigsUpdate,+ TPkiSigners,+ TPkiSignersInsert,+ TPkiSignersUpdate,+ TPkiSigningOperations,+ TPkiSigningOperationsInsert,+ TPkiSigningOperationsUpdate,TPkiSubscribers,TPkiSubscribersInsert,TPkiSubscribersUpdate,@@ -557,12 +563,6 @@ import {TServiceTokens,TServiceTokensInsert,TServiceTokensUpdate,- TSigners,- TSignersInsert,- TSignersUpdate,- TSigningOperations,- TSigningOperationsInsert,- TSigningOperationsUpdate,TSlackIntegrations,TSlackIntegrationsInsert,TSlackIntegrationsUpdate,@@ -943,11 +943,11 @@ declare module "knex/types/tables" {TPkiDiscoveryScanHistoryInsert,TPkiDiscoveryScanHistoryUpdate>;- [TableName.Signers]: KnexOriginal.CompositeTableType<TSigners, TSignersInsert, TSignersUpdate>;- [TableName.SigningOperations]: KnexOriginal.CompositeTableType<- TSigningOperations,- TSigningOperationsInsert,- TSigningOperationsUpdate+ [TableName.PkiSigners]: KnexOriginal.CompositeTableType<TPkiSigners, TPkiSignersInsert, TPkiSignersUpdate>;+ [TableName.PkiSigningOperations]: KnexOriginal.CompositeTableType<+ TPkiSigningOperations,+ TPkiSigningOperationsInsert,+ TPkiSigningOperationsUpdate>;[TableName.CertificateSync]: KnexOriginal.CompositeTableType<TCertificateSyncs,diff --git a/backend/src/db/migrations/20260309141236_code-signing-tables.ts b/backend/src/db/migrations/20260309141236_code-signing-tables.tsindex 3817734781..b9bff1448d 100644--- a/backend/src/db/migrations/20260309141236_code-signing-tables.ts+++ b/backend/src/db/migrations/20260309141236_code-signing-tables.ts@@ -4,8 +4,8 @@ import { TableName } from "../schemas";import { createOnUpdateTrigger, dropOnUpdateTrigger } from "../utils";export async function up(knex: Knex): Promise<void> {- if (!(await knex.schema.hasTable(TableName.Signers))) {- await knex.schema.createTable(TableName.Signers, (t) => {+ if (!(await knex.schema.hasTable(TableName.PkiSigners))) {+ await knex.schema.createTable(TableName.PkiSigners, (t) => {t.uuid("id", { primaryKey: true }).defaultTo(knex.fn.uuid());t.string("projectId").notNullable().index();t.foreign("projectId").references("id").inTable(TableName.Project).onDelete("CASCADE");@@ -14,7 +14,7 @@ export async function up(knex: Knex): Promise<void> {t.string("status").notNullable().defaultTo("active");t.uuid("certificateId").notNullable();t.foreign("certificateId").references("id").inTable(TableName.Certificate).onDelete("RESTRICT");- t.uuid("approvalPolicyId").notNullable();+ t.uuid("approvalPolicyId").nullable();t.foreign("approvalPolicyId").references("id").inTable(TableName.ApprovalPolicies).onDelete("RESTRICT");t.datetime("lastSignedAt").nullable();t.timestamps(true, true, true);@@ -23,14 +23,14 @@ export async function up(knex: Knex): Promise<void> {t.index("approvalPolicyId");});- await createOnUpdateTrigger(knex, TableName.Signers);+ await createOnUpdateTrigger(knex, TableName.PkiSigners);}- if (!(await knex.schema.hasTable(TableName.SigningOperations))) {- await knex.schema.createTable(TableName.SigningOperations, (t) => {+ if (!(await knex.schema.hasTable(TableName.PkiSigningOperations))) {+ await knex.schema.createTable(TableName.PkiSigningOperations, (t) => {t.uuid("id", { primaryKey: true }).defaultTo(knex.fn.uuid());t.uuid("signerId").notNullable();- t.foreign("signerId").references("id").inTable(TableName.Signers).onDelete("CASCADE");+ t.foreign("signerId").references("id").inTable(TableName.PkiSigners).onDelete("CASCADE");t.string("projectId").notNullable();t.foreign("projectId").references("id").inTable(TableName.Project).onDelete("CASCADE");t.string("status").notNullable();@@ -55,15 +55,15 @@ export async function up(knex: Knex): Promise<void> {if (!hasCol) {await knex.schema.alterTable(TableName.ApprovalRequestGrants, (t) => {t.uuid("granteeMachineIdentityId").nullable().index();- t.foreign("granteeMachineIdentityId").references("id").inTable(TableName.Identity).onDelete("SET NULL");+ t.foreign("granteeMachineIdentityId").references("id").inTable(TableName.Identity).onDelete("CASCADE");});}}export async function down(knex: Knex): Promise<void> {- await knex.schema.dropTableIfExists(TableName.SigningOperations);- await dropOnUpdateTrigger(knex, TableName.Signers);- await knex.schema.dropTableIfExists(TableName.Signers);+ await knex.schema.dropTableIfExists(TableName.PkiSigningOperations);+ await dropOnUpdateTrigger(knex, TableName.PkiSigners);+ await knex.schema.dropTableIfExists(TableName.PkiSigners);const hasCol = await knex.schema.hasColumn(TableName.ApprovalRequestGrants, "granteeMachineIdentityId");if (hasCol) {diff --git a/backend/src/db/schemas/index.ts b/backend/src/db/schemas/index.tsindex 7f29b50d64..75c8a29286 100644--- a/backend/src/db/schemas/index.ts+++ b/backend/src/db/schemas/index.ts@@ -141,6 +141,8 @@ export * from "./pki-discovery-configs";export * from "./pki-discovery-installations";export * from "./pki-discovery-scan-history";export * from "./pki-est-enrollment-configs";+export * from "./pki-signers";+export * from "./pki-signing-operations";export * from "./pki-subscribers";export * from "./pki-syncs";export * from "./project-bots";@@ -209,8 +211,6 @@ export * from "./secret-versions-v2";export * from "./secrets";export * from "./secrets-v2";export * from "./service-tokens";-export * from "./signers";-export * from "./signing-operations";export * from "./slack-integrations";export * from "./ssh-certificate-authorities";export * from "./ssh-certificate-authority-secrets";diff --git a/backend/src/db/schemas/models.ts b/backend/src/db/schemas/models.tsindex f4983a0474..fb52d4e818 100644--- a/backend/src/db/schemas/models.ts+++ b/backend/src/db/schemas/models.ts@@ -268,8 +268,8 @@ export enum TableName {ApprovalRequestGrants = "approval_request_grants",// Code Signing- Signers = "signers",- SigningOperations = "signing_operations",+ PkiSigners = "pki_signers",+ PkiSigningOperations = "pki_signing_operations",QueueJobs = "queue_jobs",CaSigningConfig = "ca_signing_configs"diff --git a/backend/src/db/schemas/signers.ts b/backend/src/db/schemas/pki-signers.tssimilarity index 60%rename from backend/src/db/schemas/signers.tsrename to backend/src/db/schemas/pki-signers.tsindex 1a5299b391..44ece44210 100644--- a/backend/src/db/schemas/signers.ts+++ b/backend/src/db/schemas/pki-signers.ts@@ -7,19 +7,19 @@ import { z } from "zod";import { TImmutableDBKeys } from "./models";-export const SignersSchema = z.object({+export const PkiSignersSchema = z.object({id: z.string().uuid(),projectId: z.string(),name: z.string(),description: z.string().nullable().optional(),status: z.string().default("active"),certificateId: z.string().uuid(),- approvalPolicyId: z.string().uuid(),+ approvalPolicyId: z.string().uuid().nullable().optional(),lastSignedAt: z.date().nullable().optional(),createdAt: z.date(),updatedAt: z.date()});-export type TSigners = z.infer<typeof SignersSchema>;-export type TSignersInsert = Omit<z.input<typeof SignersSchema>, TImmutableDBKeys>;-export type TSignersUpdate = Partial<Omit<z.input<typeof SignersSchema>, TImmutableDBKeys>>;+export type TPkiSigners = z.infer<typeof PkiSignersSchema>;+export type TPkiSignersInsert = Omit<z.input<typeof PkiSignersSchema>, TImmutableDBKeys>;+export type TPkiSignersUpdate = Partial<Omit<z.input<typeof PkiSignersSchema>, TImmutableDBKeys>>;diff --git a/backend/src/db/schemas/signing-operations.ts b/backend/src/db/schemas/pki-signing-operations.tssimilarity index 66%rename from backend/src/db/schemas/signing-operations.tsrename to backend/src/db/schemas/pki-signing-operations.tsindex ec7e7a7902..a8ab1c76d1 100644--- a/backend/src/db/schemas/signing-operations.ts+++ b/backend/src/db/schemas/pki-signing-operations.ts@@ -7,7 +7,7 @@ import { z } from "zod";import { TImmutableDBKeys } from "./models";-export const SigningOperationsSchema = z.object({+export const PkiSigningOperationsSchema = z.object({id: z.string().uuid(),signerId: z.string().uuid(),projectId: z.string(),@@ -23,6 +23,6 @@ export const SigningOperationsSchema = z.object({createdAt: z.date()});-export type TSigningOperations = z.infer<typeof SigningOperationsSchema>;-export type TSigningOperationsInsert = Omit<z.input<typeof SigningOperationsSchema>, TImmutableDBKeys>;-export type TSigningOperationsUpdate = Partial<Omit<z.input<typeof SigningOperationsSchema>, TImmutableDBKeys>>;+export type TPkiSigningOperations = z.infer<typeof PkiSigningOperationsSchema>;+export type TPkiSigningOperationsInsert = Omit<z.input<typeof PkiSigningOperationsSchema>, TImmutableDBKeys>;+export type TPkiSigningOperationsUpdate = Partial<Omit<z.input<typeof PkiSigningOperationsSchema>, TImmutableDBKeys>>;diff --git a/backend/src/ee/services/audit-log/audit-log-types.ts b/backend/src/ee/services/audit-log/audit-log-types.tsindex d16d890b02..20b561b23b 100644--- a/backend/src/ee/services/audit-log/audit-log-types.ts+++ b/backend/src/ee/services/audit-log/audit-log-types.ts@@ -686,14 +686,14 @@ export enum EventType {DELETE_PKI_INSTALLATION = "delete-pki-installation",// Code Signing- CREATE_SIGNER = "create-signer",- UPDATE_SIGNER = "update-signer",- DELETE_SIGNER = "delete-signer",- GET_SIGNER = "get-signer",- GET_SIGNERS = "get-signers",- GET_SIGNER_PUBLIC_KEY = "get-signer-public-key",- GET_SIGNING_OPERATIONS = "get-signing-operations",- SIGNER_SIGN = "signer-sign"+ CREATE_PKI_SIGNER = "create-pki-signer",+ UPDATE_PKI_SIGNER = "update-pki-signer",+ DELETE_PKI_SIGNER = "delete-pki-signer",+ GET_PKI_SIGNER = "get-pki-signer",+ GET_PKI_SIGNERS = "get-pki-signers",+ GET_PKI_SIGNER_PUBLIC_KEY = "get-pki-signer-public-key",+ GET_PKI_SIGNING_OPERATIONS = "get-pki-signing-operations",+ PKI_SIGNER_SIGN = "pki-signer-sign"}export const filterableSecretEvents: EventType[] = [@@ -3793,42 +3793,42 @@ interface DeletePkiInstallationEvent {};}-interface CreateSignerEvent {- type: EventType.CREATE_SIGNER;+interface CreatePkiSignerEvent {+ type: EventType.CREATE_PKI_SIGNER;metadata: {signerId: string;name: string;certificateId: string;- approvalPolicyId: string;+ approvalPolicyId?: string | null;};}-interface UpdateSignerEvent {- type: EventType.UPDATE_SIGNER;+interface UpdatePkiSignerEvent {+ type: EventType.UPDATE_PKI_SIGNER;metadata: {signerId: string;name: string;};}-interface DeleteSignerEvent {- type: EventType.DELETE_SIGNER;+interface DeletePkiSignerEvent {+ type: EventType.DELETE_PKI_SIGNER;metadata: {signerId: string;name: string;};}-interface GetSignerEvent {- type: EventType.GET_SIGNER;+interface GetPkiSignerEvent {+ type: EventType.GET_PKI_SIGNER;metadata: {signerId: string;name: string;};}-interface GetSignersEvent {- type: EventType.GET_SIGNERS;+interface GetPkiSignersEvent {+ type: EventType.GET_PKI_SIGNERS;metadata: {count: number;offset: number;@@ -3836,24 +3836,24 @@ interface GetSignersEvent {};}-interface GetSignerPublicKeyEvent {- type: EventType.GET_SIGNER_PUBLIC_KEY;+interface GetPkiSignerPublicKeyEvent {+ type: EventType.GET_PKI_SIGNER_PUBLIC_KEY;metadata: {signerId: string;name: string;};}-interface GetSigningOperationsEvent {- type: EventType.GET_SIGNING_OPERATIONS;+interface GetPkiSigningOperationsEvent {+ type: EventType.GET_PKI_SIGNING_OPERATIONS;metadata: {signerId: string;count: number;};}-interface SignerSignEvent {- type: EventType.SIGNER_SIGN;+interface PkiSignerSignEvent {+ type: EventType.PKI_SIGNER_SIGN;metadata: {signerId: string;name: string;@@ -5735,14 +5735,14 @@ export type Event =| GetPkiInstallationsEvent| UpdatePkiInstallationEvent| DeletePkiInstallationEvent- | CreateSignerEvent- | UpdateSignerEvent- | DeleteSignerEvent- | GetSignerEvent- | GetSignersEvent- | GetSignerPublicKeyEvent- | GetSigningOperationsEvent- | SignerSignEvent+ | CreatePkiSignerEvent+ | UpdatePkiSignerEvent+ | DeletePkiSignerEvent+ | GetPkiSignerEvent+ | GetPkiSignersEvent+ | GetPkiSignerPublicKeyEvent+ | GetPkiSigningOperationsEvent+ | PkiSignerSignEvent| OidcGroupMembershipMappingAssignUserEvent| OidcGroupMembershipMappingRemoveUserEvent| CreateKmipClientEventdiff --git a/backend/src/server/routes/index.ts b/backend/src/server/routes/index.tsindex ce312457a3..ac220b12a2 100644--- a/backend/src/server/routes/index.ts+++ b/backend/src/server/routes/index.ts@@ -3003,7 +3003,7 @@ export const registerRoutes = async (pkiSync: pkiSyncService,pkiDiscovery: pkiDiscoveryService,pkiInstallation: pkiInstallationService,- signer: signerService,+ pkiSigner: signerService,pkiTemplate: pkiTemplateService,secretScanning: secretScanningService,license: licenseService,diff --git a/backend/src/server/routes/v1/approval-policy-routers/index.ts b/backend/src/server/routes/v1/approval-policy-routers/index.tsindex 9b7deb563e..48435c63a5 100644--- a/backend/src/server/routes/v1/approval-policy-routers/index.ts+++ b/backend/src/server/routes/v1/approval-policy-routers/index.ts@@ -59,10 +59,10 @@ export const APPROVAL_POLICY_REGISTER_ROUTER_MAP: Record<inputsSchema: CertRequestPolicyInputsSchema});},- [ApprovalPolicyType.CertManagerCodeSigning]: async (server: FastifyZodProvider) => {+ [ApprovalPolicyType.CertCodeSigning]: async (server: FastifyZodProvider) => {registerApprovalPolicyEndpoints({server,- policyType: ApprovalPolicyType.CertManagerCodeSigning,+ policyType: ApprovalPolicyType.CertCodeSigning,createPolicySchema: CreateCodeSigningPolicySchema,updatePolicySchema: UpdateCodeSigningPolicySchema,policyResponseSchema: CodeSigningPolicySchema,diff --git a/backend/src/server/routes/v1/signer-router.ts b/backend/src/server/routes/v1/signer-router.tsindex f1f5fce2e8..ed7341cfb8 100644--- a/backend/src/server/routes/v1/signer-router.ts+++ b/backend/src/server/routes/v1/signer-router.ts@@ -1,6 +1,6 @@import { z } from "zod";-import { SignersSchema, SigningOperationsSchema } from "@app/db/schemas";+import { PkiSignersSchema, PkiSigningOperationsSchema } from "@app/db/schemas";import { EventType } from "@app/ee/services/audit-log/audit-log-types";import { ApiDocsTags } from "@app/lib/api-docs";import { SigningAlgorithm } from "@app/lib/crypto/sign/types";@@ -25,15 +25,15 @@ export const registerSignerRouter = async (server: FastifyZodProvider) => {name: slugSchema({ min: 1, max: 64, field: "name" }),description: z.string().trim().max(256).optional(),certificateId: z.string().uuid(),- approvalPolicyId: z.string().uuid()+ approvalPolicyId: z.string().uuid().optional()}),response: {- 200: SignersSchema+ 200: PkiSignersSchema}},onRequest: verifyAuth([AuthMode.JWT, AuthMode.IDENTITY_ACCESS_TOKEN]),handler: async (req) => {- const signer = await server.services.signer.create({+ const signer = await server.services.pkiSigner.create({...req.body,actor: req.permission.type,actorId: req.permission.id,@@ -45,7 +45,7 @@ export const registerSignerRouter = async (server: FastifyZodProvider) => {...req.auditLogInfo,projectId: signer.projectId,event: {- type: EventType.CREATE_SIGNER,+ type: EventType.CREATE_PKI_SIGNER,metadata: {signerId: signer.id,name: signer.name,@@ -77,7 +77,7 @@ export const registerSignerRouter = async (server: FastifyZodProvider) => {response: {200: z.object({signers: z.array(- SignersSchema.extend({+ PkiSignersSchema.extend({certificateCommonName: z.string().nullable().optional(),certificateSerialNumber: z.string().nullable().optional(),certificateNotAfter: z.date().nullable().optional(),@@ -90,7 +90,7 @@ export const registerSignerRouter = async (server: FastifyZodProvider) => {},onRequest: verifyAuth([AuthMode.JWT, AuthMode.IDENTITY_ACCESS_TOKEN]),handler: async (req) => {- const { signers, totalCount } = await server.services.signer.list({+ const { signers, totalCount } = await server.services.pkiSigner.list({...req.query,actor: req.permission.type,actorId: req.permission.id,@@ -102,7 +102,7 @@ export const registerSignerRouter = async (server: FastifyZodProvider) => {...req.auditLogInfo,projectId: req.query.projectId,event: {- type: EventType.GET_SIGNERS,+ type: EventType.GET_PKI_SIGNERS,metadata: {count: signers.length,offset: req.query.offset,@@ -128,7 +128,7 @@ export const registerSignerRouter = async (server: FastifyZodProvider) => {signerId: z.string().uuid()}),response: {- 200: SignersSchema.extend({+ 200: PkiSignersSchema.extend({certificateCommonName: z.string().nullable().optional(),certificateSerialNumber: z.string().nullable().optional(),certificateNotAfter: z.date().nullable().optional(),@@ -142,7 +142,7 @@ export const registerSignerRouter = async (server: FastifyZodProvider) => {},onRequest: verifyAuth([AuthMode.JWT, AuthMode.IDENTITY_ACCESS_TOKEN]),handler: async (req) => {- const signer = await server.services.signer.getById({+ const signer = await server.services.pkiSigner.getById({signerId: req.params.signerId,actor: req.permission.type,actorId: req.permission.id,@@ -154,7 +154,7 @@ export const registerSignerRouter = async (server: FastifyZodProvider) => {...req.auditLogInfo,projectId: signer.projectId,event: {- type: EventType.GET_SIGNER,+ type: EventType.GET_PKI_SIGNER,metadata: {signerId: signer.id,name: signer.name@@ -183,15 +183,15 @@ export const registerSignerRouter = async (server: FastifyZodProvider) => {description: z.string().trim().max(256).nullable().optional(),status: z.nativeEnum(SignerStatus).optional(),certificateId: z.string().uuid().optional(),- approvalPolicyId: z.string().uuid().optional()+ approvalPolicyId: z.string().uuid().nullable().optional()}),response: {- 200: SignersSchema+ 200: PkiSignersSchema}},onRequest: verifyAuth([AuthMode.JWT, AuthMode.IDENTITY_ACCESS_TOKEN]),handler: async (req) => {- const signer = await server.services.signer.update({+ const signer = await server.services.pkiSigner.update({signerId: req.params.signerId,...req.body,actor: req.permission.type,@@ -204,7 +204,7 @@ export const registerSignerRouter = async (server: FastifyZodProvider) => {...req.auditLogInfo,projectId: signer.projectId,event: {- type: EventType.UPDATE_SIGNER,+ type: EventType.UPDATE_PKI_SIGNER,metadata: {signerId: signer.id,name: signer.name@@ -229,12 +229,12 @@ export const registerSignerRouter = async (server: FastifyZodProvider) => {signerId: z.string().uuid()}),response: {- 200: SignersSchema+ 200: PkiSignersSchema}},onRequest: verifyAuth([AuthMode.JWT, AuthMode.IDENTITY_ACCESS_TOKEN]),handler: async (req) => {- const signer = await server.services.signer.delete({+ const signer = await server.services.pkiSigner.delete({signerId: req.params.signerId,actor: req.permission.type,actorId: req.permission.id,@@ -246,7 +246,7 @@ export const registerSignerRouter = async (server: FastifyZodProvider) => {...req.auditLogInfo,projectId: signer.projectId,event: {- type: EventType.DELETE_SIGNER,+ type: EventType.DELETE_PKI_SIGNER,metadata: {signerId: signer.id,name: signer.name@@ -299,7 +299,7 @@ export const registerSignerRouter = async (server: FastifyZodProvider) => {actorName = req.auth.identityName ?? undefined;}- const result = await server.services.signer.sign({+ const result = await server.services.pkiSigner.sign({signerId: req.params.signerId,...req.body,actorName,@@ -313,7 +313,7 @@ export const registerSignerRouter = async (server: FastifyZodProvider) => {...req.auditLogInfo,projectId: result.projectId,event: {- type: EventType.SIGNER_SIGN,+ type: EventType.PKI_SIGNER_SIGN,metadata: {signerId: req.params.signerId,name: result.signerName,@@ -347,7 +347,7 @@ export const registerSignerRouter = async (server: FastifyZodProvider) => {},onRequest: verifyAuth([AuthMode.JWT, AuthMode.IDENTITY_ACCESS_TOKEN]),handler: async (req) => {- const result = await server.services.signer.getPublicKey({+ const result = await server.services.pkiSigner.getPublicKey({signerId: req.params.signerId,actor: req.permission.type,actorId: req.permission.id,@@ -359,7 +359,7 @@ export const registerSignerRouter = async (server: FastifyZodProvider) => {...req.auditLogInfo,projectId: result.projectId,event: {- type: EventType.GET_SIGNER_PUBLIC_KEY,+ type: EventType.GET_PKI_SIGNER_PUBLIC_KEY,metadata: {signerId: req.params.signerId,name: result.signerName@@ -391,7 +391,7 @@ export const registerSignerRouter = async (server: FastifyZodProvider) => {response: {200: z.object({operations: z.array(- SigningOperationsSchema.extend({+ PkiSigningOperationsSchema.extend({actorName: z.string().nullable(),actorMembershipId: z.string().uuid().nullable()})@@ -402,7 +402,7 @@ export const registerSignerRouter = async (server: FastifyZodProvider) => {},onRequest: verifyAuth([AuthMode.JWT, AuthMode.IDENTITY_ACCESS_TOKEN]),handler: async (req) => {- const result = await server.services.signer.listOperations({+ const result = await server.services.pkiSigner.listOperations({signerId: req.params.signerId,...req.query,actor: req.permission.type,@@ -415,7 +415,7 @@ export const registerSignerRouter = async (server: FastifyZodProvider) => {...req.auditLogInfo,projectId: result.projectId,event: {- type: EventType.GET_SIGNING_OPERATIONS,+ type: EventType.GET_PKI_SIGNING_OPERATIONS,metadata: {signerId: req.params.signerId,count: result.operations.lengthdiff --git a/backend/src/services/approval-policy/approval-policy-enums.ts b/backend/src/services/approval-policy/approval-policy-enums.tsindex 628a7e1638..1ea3e65e6d 100644--- a/backend/src/services/approval-policy/approval-policy-enums.ts+++ b/backend/src/services/approval-policy/approval-policy-enums.ts@@ -1,7 +1,7 @@export enum ApprovalPolicyType {PamAccess = "pam-access",CertRequest = "cert-request",- CertManagerCodeSigning = "cert-manager-code-signing"+ CertCodeSigning = "cert-code-signing"}export enum ApproverType {diff --git a/backend/src/services/approval-policy/approval-policy-factory.ts b/backend/src/services/approval-policy/approval-policy-factory.tsindex 43494c0aa3..0462101424 100644--- a/backend/src/services/approval-policy/approval-policy-factory.ts+++ b/backend/src/services/approval-policy/approval-policy-factory.ts@@ -18,5 +18,5 @@ type TApprovalPolicyFactoryImplementation = TApprovalResourceFactory<export const APPROVAL_POLICY_FACTORY_MAP: Record<ApprovalPolicyType, TApprovalPolicyFactoryImplementation> = {[ApprovalPolicyType.PamAccess]: pamAccessPolicyFactory as TApprovalPolicyFactoryImplementation,[ApprovalPolicyType.CertRequest]: certRequestPolicyFactory as TApprovalPolicyFactoryImplementation,- [ApprovalPolicyType.CertManagerCodeSigning]: codeSigningPolicyFactory as TApprovalPolicyFactoryImplementation+ [ApprovalPolicyType.CertCodeSigning]: codeSigningPolicyFactory as TApprovalPolicyFactoryImplementation};diff --git a/backend/src/services/approval-policy/code-signing/code-signing-policy-factory.ts b/backend/src/services/approval-policy/code-signing/code-signing-policy-factory.tsindex 475748fed8..12429d1e65 100644--- a/backend/src/services/approval-policy/code-signing/code-signing-policy-factory.ts+++ b/backend/src/services/approval-policy/code-signing/code-signing-policy-factory.ts@@ -1,4 +1,3 @@-import { BadRequestError } from "@app/lib/errors";import { ms } from "@app/lib/ms";import { ApprovalRequestGrantStatus } from "../approval-policy-enums";@@ -10,7 +9,6 @@ import {TApprovalRequestFactoryValidateConstraints,TApprovalResourceFactory} from "../approval-policy-types";-import { CodeSigningApprovalMode } from "./code-signing-policy-schemas";import {TCodeSigningGrantAttributes,TCodeSigningPolicy,@@ -82,24 +80,25 @@ export const codeSigningPolicyFactory: TApprovalResourceFactory<inputs) => {const errors: string[] = [];- const { approvalMode, maxWindowDuration, maxSignings } = policy.constraints.constraints;+ const { maxWindowDuration, maxSignings } = policy.constraints.constraints;- if (inputs.approvalMode !== approvalMode) {- errors.push(`Request approval mode '${inputs.approvalMode}' does not match policy mode '${approvalMode}'`);- }+ const hasTimeConstraint = Boolean(maxWindowDuration);+ const hasCountConstraint = Boolean(maxSignings);+ const isManual = !hasTimeConstraint && !hasCountConstraint;- if (approvalMode === CodeSigningApprovalMode.Manual) {+ // Manual mode (neither constraint set): no extra parameters allowed+ if (isManual) {if (inputs.requestedWindowStart || inputs.requestedWindowEnd) {- errors.push("Manual mode does not accept time-window parameters");+ errors.push("This policy does not allow time-window parameters");}if (inputs.requestedSignings) {- errors.push("Manual mode does not accept requestedSignings");+ errors.push("This policy does not allow requestedSignings");}}- if (approvalMode === CodeSigningApprovalMode.TimeWindow) {+ if (hasTimeConstraint && (inputs.requestedWindowStart || inputs.requestedWindowEnd)) {if (!inputs.requestedWindowStart || !inputs.requestedWindowEnd) {- errors.push("Time-window mode requires requestedWindowStart and requestedWindowEnd");+ errors.push("Both requestedWindowStart and requestedWindowEnd are required");} else {const startTime = new Date(inputs.requestedWindowStart).getTime();const endTime = new Date(inputs.requestedWindowEnd).getTime();@@ -115,19 +114,29 @@ export const codeSigningPolicyFactory: TApprovalResourceFactory<errors.push(`Requested window duration exceeds maximum of ${maxWindowDuration}`);}}+ }++ if (hasCountConstraint && inputs.requestedSignings) {+ if (maxSignings && inputs.requestedSignings > maxSignings) {+ errors.push(`Requested signings (${inputs.requestedSignings}) exceeds maximum of ${maxSignings}`);+ }+ }++ if (hasTimeConstraint && !hasCountConstraint) {+ if (!inputs.requestedWindowStart && !inputs.requestedWindowEnd && !inputs.requestedSignings) {+ errors.push("This policy requires time-window parameters");+ }if (inputs.requestedSignings) {- errors.push("Time-window mode does not accept requestedSignings");+ errors.push("This policy does not allow requestedSignings");}}- if (approvalMode === CodeSigningApprovalMode.NSignings) {- if (!inputs.requestedSignings) {- errors.push("Count-limited mode requires requestedSignings");- } else if (maxSignings && inputs.requestedSignings > maxSignings) {- errors.push(`Requested signings (${inputs.requestedSignings}) exceeds maximum of ${maxSignings}`);+ if (hasCountConstraint && !hasTimeConstraint) {+ if (!inputs.requestedSignings && !inputs.requestedWindowStart) {+ errors.push("This policy requires requestedSignings");}if (inputs.requestedWindowStart || inputs.requestedWindowEnd) {- errors.push("Count-limited mode does not accept time-window parameters");+ errors.push("This policy does not allow time-window parameters");}}@@ -139,7 +148,6 @@ export const codeSigningPolicyFactory: TApprovalResourceFactory<const postApprovalRoutine: TApprovalRequestFactoryPostApprovalRoutine = async (approvalRequestGrantsDAL, request) => {const requestData = request.requestData.requestData as TCodeSigningRequestData;- const approvalMode = requestData.approvalMode ?? CodeSigningApprovalMode.Manual;const grantAttributes: TCodeSigningGrantAttributes = {signerId: requestData.signerId,@@ -148,26 +156,19 @@ export const codeSigningPolicyFactory: TApprovalResourceFactory<let expiresAt: Date | undefined;- switch (approvalMode) {- case CodeSigningApprovalMode.Manual:- grantAttributes.maxSignings = 1;- break;- case CodeSigningApprovalMode.TimeWindow:- if (requestData.requestedWindowStart) {- grantAttributes.windowStart = requestData.requestedWindowStart;- }- if (requestData.requestedWindowEnd) {- expiresAt = new Date(requestData.requestedWindowEnd);- }- break;- case CodeSigningApprovalMode.NSignings:- if (!requestData.requestedSignings) {- throw new BadRequestError({ message: "NSignings mode requires requestedSignings to be set" });- }- grantAttributes.maxSignings = requestData.requestedSignings;- break;- default:- grantAttributes.maxSignings = 1;+ if (requestData.requestedSignings) {+ grantAttributes.maxSignings = requestData.requestedSignings;+ }++ if (requestData.requestedWindowStart) {+ grantAttributes.windowStart = requestData.requestedWindowStart;+ }+ if (requestData.requestedWindowEnd) {+ expiresAt = new Date(requestData.requestedWindowEnd);+ }++ if (!requestData.requestedSignings && !requestData.requestedWindowStart) {+ grantAttributes.maxSignings = 1;}await approvalRequestGrantsDAL.create({diff --git a/backend/src/services/approval-policy/code-signing/code-signing-policy-schemas.ts b/backend/src/services/approval-policy/code-signing/code-signing-policy-schemas.tsindex 87d4efb462..aaf4c320f7 100644--- a/backend/src/services/approval-policy/code-signing/code-signing-policy-schemas.ts+++ b/backend/src/services/approval-policy/code-signing/code-signing-policy-schemas.ts@@ -18,12 +18,6 @@ export const CodeSigningPolicyInputsSchema = z.object({export const CodeSigningPolicyConditionsSchema = z.object({}).array();-export enum CodeSigningApprovalMode {- Manual = "manual",- TimeWindow = "time-window",- NSignings = "n-signings"-}-const WindowDurationSchema = z.string().refine(@@ -37,7 +31,6 @@ const WindowDurationSchema = z.optional();export const CodeSigningPolicyConstraintsSchema = z.object({- approvalMode: z.nativeEnum(CodeSigningApprovalMode),maxWindowDuration: WindowDurationSchema,maxSignings: z.number().int().positive().optional()});@@ -46,7 +39,6 @@ export const CodeSigningPolicyRequestDataSchema = z.object({signerId: z.string().uuid(),approvalPolicyId: z.string().uuid(),signerName: z.string(),- approvalMode: z.nativeEnum(CodeSigningApprovalMode),justification: z.string().max(512).optional(),requestedWindowStart: z.string().datetime().optional(),requestedWindowEnd: z.string().datetime().optional(),diff --git a/backend/src/services/signer/signer-dal.ts b/backend/src/services/signer/signer-dal.tsindex 8d32a8a720..558cd5a7a8 100644--- a/backend/src/services/signer/signer-dal.ts+++ b/backend/src/services/signer/signer-dal.ts@@ -1,12 +1,12 @@import { Knex } from "knex";import { TDbClient } from "@app/db";-import { TableName, TSigners } from "@app/db/schemas";+import { TableName, TPkiSigners } from "@app/db/schemas";import { DatabaseError } from "@app/lib/errors";import { sanitizeSqlLikeString } from "@app/lib/fn/string";import { ormify, selectAllTableCols } from "@app/lib/knex";-export type TSignerWithCertificate = TSigners & {+export type TSignerWithCertificate = TPkiSigners & {certificateCommonName: string | null;certificateSerialNumber: string | null;certificateNotAfter: Date | null;@@ -17,7 +17,7 @@ export type TSignerWithCertificate = TSigners & {approvalPolicyName: string | null;};-export type TSignerWithCertificateSummary = TSigners & {+export type TSignerWithCertificateSummary = TPkiSigners & {certificateCommonName: string | null;certificateSerialNumber: string | null;certificateNotAfter: Date | null;@@ -27,18 +27,18 @@ export type TSignerWithCertificateSummary = TSigners & {export type TSignerDALFactory = ReturnType<typeof signerDALFactory>;export const signerDALFactory = (db: TDbClient) => {- const orm = ormify(db, TableName.Signers);+ const orm = ormify(db, TableName.PkiSigners);const findByIdWithCertificate = async (signerId: string, tx?: Knex): Promise<TSignerWithCertificate | undefined> => {try {- const result = await (tx || db.replicaNode())(TableName.Signers)- .leftJoin(TableName.Certificate, `${TableName.Signers}.certificateId`, `${TableName.Certificate}.id`)+ const result = await (tx || db.replicaNode())(TableName.PkiSigners)+ .leftJoin(TableName.Certificate, `${TableName.PkiSigners}.certificateId`, `${TableName.Certificate}.id`).leftJoin(TableName.ApprovalPolicies,- `${TableName.Signers}.approvalPolicyId`,+ `${TableName.PkiSigners}.approvalPolicyId`,`${TableName.ApprovalPolicies}.id`)- .select(selectAllTableCols(TableName.Signers))+ .select(selectAllTableCols(TableName.PkiSigners)).select(db.ref("commonName").withSchema(TableName.Certificate).as("certificateCommonName"),db.ref("serialNumber").withSchema(TableName.Certificate).as("certificateSerialNumber"),@@ -49,7 +49,7 @@ export const signerDALFactory = (db: TDbClient) => {db.ref("caId").withSchema(TableName.Certificate).as("certificateCaId"),db.ref("name").withSchema(TableName.ApprovalPolicies).as("approvalPolicyName"))- .where(`${TableName.Signers}.id`, signerId)+ .where(`${TableName.PkiSigners}.id`, signerId).first();return result as TSignerWithCertificate | undefined;@@ -72,33 +72,33 @@ export const signerDALFactory = (db: TDbClient) => {tx?: Knex) => {try {- let query: Knex.QueryBuilder = (tx || db.replicaNode())(TableName.Signers)- .leftJoin(TableName.Certificate, `${TableName.Signers}.certificateId`, `${TableName.Certificate}.id`)+ let query: Knex.QueryBuilder = (tx || db.replicaNode())(TableName.PkiSigners)+ .leftJoin(TableName.Certificate, `${TableName.PkiSigners}.certificateId`, `${TableName.Certificate}.id`).leftJoin(TableName.ApprovalPolicies,- `${TableName.Signers}.approvalPolicyId`,+ `${TableName.PkiSigners}.approvalPolicyId`,`${TableName.ApprovalPolicies}.id`)- .select(selectAllTableCols(TableName.Signers))+ .select(selectAllTableCols(TableName.PkiSigners)).select(db.ref("commonName").withSchema(TableName.Certificate).as("certificateCommonName"),db.ref("serialNumber").withSchema(TableName.Certificate).as("certificateSerialNumber"),db.ref("notAfter").withSchema(TableName.Certificate).as("certificateNotAfter"),db.ref("name").withSchema(TableName.ApprovalPolicies).as("approvalPolicyName"))- .where(`${TableName.Signers}.projectId`, projectId);+ .where(`${TableName.PkiSigners}.projectId`, projectId);if (search) {const sanitizedSearch = `%${sanitizeSqlLikeString(search)}%`;query = query.where((qb) => {void qb- .whereILike(`${TableName.Signers}.name`, sanitizedSearch)+ .whereILike(`${TableName.PkiSigners}.name`, sanitizedSearch).orWhereILike(`${TableName.Certificate}.commonName`, sanitizedSearch);});}return (await query- .orderBy(`${TableName.Signers}.createdAt`, "desc")+ .orderBy(`${TableName.PkiSigners}.createdAt`, "desc").offset(offset).limit(limit)) as TSignerWithCertificateSummary[];} catch (error) {@@ -108,18 +108,18 @@ export const signerDALFactory = (db: TDbClient) => {const countByProjectId = async (projectId: string, search?: string, tx?: Knex) => {try {- let query: Knex.QueryBuilder = (tx || db.replicaNode())(TableName.Signers).where(- `${TableName.Signers}.projectId`,+ let query: Knex.QueryBuilder = (tx || db.replicaNode())(TableName.PkiSigners).where(+ `${TableName.PkiSigners}.projectId`,projectId);if (search) {const sanitizedSearch = `%${sanitizeSqlLikeString(search)}%`;query = query- .leftJoin(TableName.Certificate, `${TableName.Signers}.certificateId`, `${TableName.Certificate}.id`)+ .leftJoin(TableName.Certificate, `${TableName.PkiSigners}.certificateId`, `${TableName.Certificate}.id`).where((qb) => {void qb- .whereILike(`${TableName.Signers}.name`, sanitizedSearch)+ .whereILike(`${TableName.PkiSigners}.name`, sanitizedSearch).orWhereILike(`${TableName.Certificate}.commonName`, sanitizedSearch);});}diff --git a/backend/src/services/signer/signer-service.ts b/backend/src/services/signer/signer-service.tsindex 746b9a1217..0ac3858c2f 100644--- a/backend/src/services/signer/signer-service.ts+++ b/backend/src/services/signer/signer-service.ts@@ -1,6 +1,5 @@import { ForbiddenError } from "@casl/ability";import { KeyObject } from "crypto";-import RE2 from "re2";import { ActionProjectType } from "@app/db/schemas";import { TPermissionServiceFactory } from "@app/ee/services/permission/permission-service-types";@@ -38,8 +37,6 @@ import {} from "./signer-types";import { TSigningOperationDALFactory } from "./signing-operation-dal";-const SIGNER_NAME_REGEX = new RE2("^[a-z0-9-]+$");-const MAX_DATA_BYTES = 128;type TSignerServiceFactoryDep = {@@ -114,12 +111,6 @@ export const signerServiceFactory = ({ProjectPermissionSub.CodeSigners);- if (!SIGNER_NAME_REGEX.test(dto.name)) {- throw new BadRequestError({- message: "Signer name must contain only lowercase letters, numbers, and hyphens"- });- }-const certificate = await certificateDAL.findById(dto.certificateId);if (!certificate) {throw new NotFoundError({ message: `Certificate with ID '${dto.certificateId}' not found` });@@ -145,17 +136,19 @@ export const signerServiceFactory = ({throw new BadRequestError({ message: "Certificate must have an associated private key" });}- const approvalPolicy = await approvalPolicyDAL.findById(dto.approvalPolicyId);- if (!approvalPolicy) {- throw new NotFoundError({ message: `Approval policy with ID '${dto.approvalPolicyId}' not found` });- }- if (approvalPolicy.projectId !== dto.projectId) {- throw new BadRequestError({ message: "Approval policy must belong to the same project" });- }- if (approvalPolicy.type !== ApprovalPolicyType.CertManagerCodeSigning) {- throw new BadRequestError({- message: "Approval policy must be of type cert-manager-code-signing"- });+ if (dto.approvalPolicyId) {+ const approvalPolicy = await approvalPolicyDAL.findById(dto.approvalPolicyId);+ if (!approvalPolicy) {+ throw new NotFoundError({ message: `Approval policy with ID '${dto.approvalPolicyId}' not found` });+ }+ if (approvalPolicy.projectId !== dto.projectId) {+ throw new BadRequestError({ message: "Approval policy must belong to the same project" });+ }+ if (approvalPolicy.type !== ApprovalPolicyType.CertCodeSigning) {+ throw new BadRequestError({+ message: "Approval policy must be of type cert-code-signing"+ });+ }}try {@@ -164,7 +157,7 @@ export const signerServiceFactory = ({name: dto.name,description: dto.description,certificateId: dto.certificateId,- approvalPolicyId: dto.approvalPolicyId,+ approvalPolicyId: dto.approvalPolicyId ?? null,status: SignerStatus.Active});@@ -249,12 +242,6 @@ export const signerServiceFactory = ({ProjectPermissionSub.CodeSigners);- if (dto.name !== undefined && !SIGNER_NAME_REGEX.test(dto.name)) {- throw new BadRequestError({- message: "Signer name must contain only lowercase letters, numbers, and hyphens"- });- }-if (dto.certificateId !== undefined) {const certificate = await certificateDAL.findById(dto.certificateId);if (!certificate) {@@ -275,7 +262,7 @@ export const signerServiceFactory = ({}}- if (dto.approvalPolicyId !== undefined) {+ if (dto.approvalPolicyId !== undefined && dto.approvalPolicyId !== null) {const approvalPolicy = await approvalPolicyDAL.findById(dto.approvalPolicyId);if (!approvalPolicy) {throw new NotFoundError({ message: `Approval policy with ID '${dto.approvalPolicyId}' not found` });@@ -283,9 +270,9 @@ export const signerServiceFactory = ({if (approvalPolicy.projectId !== projectId) {throw new BadRequestError({ message: "Approval policy must belong to the same project" });}- if (approvalPolicy.type !== ApprovalPolicyType.CertManagerCodeSigning) {+ if (approvalPolicy.type !== ApprovalPolicyType.CertCodeSigning) {throw new BadRequestError({- message: "Approval policy must be of type cert-manager-code-signing"+ message: "Approval policy must be of type cert-code-signing"});}}@@ -380,85 +367,93 @@ export const signerServiceFactory = ({const keyAlgorithm = getKeyAlgorithm(privateKeyObject);validateSigningAlgorithmForKey(dto.signingAlgorithm, keyAlgorithm);+ const requiresApproval = Boolean(signer.approvalPolicyId);+const result = await projectDAL.transaction(async (tx) => {- const [userGrants, identityGrants] = await Promise.all([- approvalRequestGrantsDAL.find(- {- granteeUserId: dto.actorId,- type: ApprovalPolicyType.CertManagerCodeSigning,- status: ApprovalRequestGrantStatus.Active,- projectId,- revokedAt: null- },- { tx }- ),- approvalRequestGrantsDAL.find(- {- granteeMachineIdentityId: dto.actorId,- type: ApprovalPolicyType.CertManagerCodeSigning,- status: ApprovalRequestGrantStatus.Active,- projectId,- revokedAt: null- },- { tx }- )- ]);-- const activeGrants = [...userGrants, ...identityGrants];-- let matchingGrant: (typeof activeGrants)[number] | undefined;-- const now = new Date();- const expiredGrantIds: string[] = [];-- for (const grant of activeGrants) {- const attrs = grant.attributes as TCodeSigningGrantAttributes | null;- if (attrs && attrs.signerId === signer.id) {- const windowNotStarted = attrs.windowStart && new Date(attrs.windowStart) > now;- if (!windowNotStarted) {- if (grant.expiresAt && new Date(grant.expiresAt) < now) {- expiredGrantIds.push(grant.id);- } else if (!matchingGrant) {- matchingGrant = grant;+ let grantId: string | null = null;+ let matchedGrantAttrs: TCodeSigningGrantAttributes | null = null;++ if (requiresApproval) {+ const [userGrants, identityGrants] = await Promise.all([+ approvalRequestGrantsDAL.find(+ {+ granteeUserId: dto.actorId,+ type: ApprovalPolicyType.CertCodeSigning,+ status: ApprovalRequestGrantStatus.Active,+ projectId,+ revokedAt: null+ },+ { tx }+ ),+ approvalRequestGrantsDAL.find(+ {+ granteeMachineIdentityId: dto.actorId,+ type: ApprovalPolicyType.CertCodeSigning,+ status: ApprovalRequestGrantStatus.Active,+ projectId,+ revokedAt: null+ },+ { tx }+ )+ ]);++ const activeGrants = [...userGrants, ...identityGrants];++ let matchingGrant: (typeof activeGrants)[number] | undefined;++ const now = new Date();+ const expiredGrantIds: string[] = [];++ for (const grant of activeGrants) {+ const attrs = grant.attributes as TCodeSigningGrantAttributes | null;+ if (attrs && attrs.signerId === signer.id) {+ const windowNotStarted = attrs.windowStart && new Date(attrs.windowStart) > now;+ if (!windowNotStarted) {+ if (grant.expiresAt && new Date(grant.expiresAt) < now) {+ expiredGrantIds.push(grant.id);+ } else if (!matchingGrant) {+ matchingGrant = grant;+ }}}}- }- await Promise.all(- expiredGrantIds.map((id) =>- approvalRequestGrantsDAL.updateById(id, { status: ApprovalRequestGrantStatus.Expired }, tx)- )- );+ await Promise.all(+ expiredGrantIds.map((id) =>+ approvalRequestGrantsDAL.updateById(id, { status: ApprovalRequestGrantStatus.Expired }, tx)+ )+ );- if (matchingGrant) {- const lockedGrant = await approvalRequestGrantsDAL.findByIdForUpdate(matchingGrant.id, tx);- if (!lockedGrant || lockedGrant.status !== ApprovalRequestGrantStatus.Active) {- matchingGrant = undefined;- } else {- const matchAttrs = lockedGrant.attributes as TCodeSigningGrantAttributes | null;- if (matchAttrs?.maxSignings) {- const usedCount = await signingOperationDAL.countByGrantId(matchingGrant.id, tx);- if (usedCount >= matchAttrs.maxSignings) {- await approvalRequestGrantsDAL.updateById(- matchingGrant.id,- { status: ApprovalRequestGrantStatus.Expired },- tx- );- matchingGrant = undefined;+ if (matchingGrant) {+ const lockedGrant = await approvalRequestGrantsDAL.findByIdForUpdate(matchingGrant.id, tx);+ if (!lockedGrant || lockedGrant.status !== ApprovalRequestGrantStatus.Active) {+ matchingGrant = undefined;+ } else {+ const matchAttrs = lockedGrant.attributes as TCodeSigningGrantAttributes | null;+ if (matchAttrs?.maxSignings) {+ const usedCount = await signingOperationDAL.countByGrantId(matchingGrant.id, tx);+ if (usedCount >= matchAttrs.maxSignings) {+ await approvalRequestGrantsDAL.updateById(+ matchingGrant.id,+ { status: ApprovalRequestGrantStatus.Expired },+ tx+ );+ matchingGrant = undefined;+ }}}}- }- if (!matchingGrant) {- throw new ForbiddenRequestError({- message: "Signing requires approval. Request access and get approved before signing.",- name: "ApprovalRequired"- });- }+ if (!matchingGrant) {+ throw new ForbiddenRequestError({+ message: "Signing requires approval. Request access and get approved before signing.",+ name: "ApprovalRequired"+ });+ }- const grantId = matchingGrant.id;+ grantId = matchingGrant.id;+ matchedGrantAttrs = matchingGrant.attributes as TCodeSigningGrantAttributes | null;+ }let signatureBuffer: Buffer;@@ -506,10 +501,9 @@ export const signerServiceFactory = ({tx);- const grantAttrs = matchingGrant.attributes as TCodeSigningGrantAttributes | null;- if (grantAttrs?.maxSignings) {+ if (grantId && matchedGrantAttrs?.maxSignings) {const newCount = await signingOperationDAL.countByGrantId(grantId, tx);- if (newCount >= grantAttrs.maxSignings) {+ if (newCount >= matchedGrantAttrs.maxSignings) {await approvalRequestGrantsDAL.updateById(grantId, { status: ApprovalRequestGrantStatus.Expired }, tx);}}diff --git a/backend/src/services/signer/signer-types.ts b/backend/src/services/signer/signer-types.tsindex b66034ec7a..fdcf707133 100644--- a/backend/src/services/signer/signer-types.ts+++ b/backend/src/services/signer/signer-types.ts@@ -9,7 +9,7 @@ export type TCreateSignerDTO = {name: string;description?: string;certificateId: string;- approvalPolicyId: string;+ approvalPolicyId?: string;} & TProjectPermission;export type TUpdateSignerDTO = {@@ -18,7 +18,7 @@ export type TUpdateSignerDTO = {description?: string | null;status?: SignerStatus;certificateId?: string;- approvalPolicyId?: string;+ approvalPolicyId?: string | null;} & TActorPermission;export type TDeleteSignerDTO = {diff --git a/backend/src/services/signer/signing-operation-dal.ts b/backend/src/services/signer/signing-operation-dal.tsindex 64fc0eda65..8ca12b9ce9 100644--- a/backend/src/services/signer/signing-operation-dal.ts+++ b/backend/src/services/signer/signing-operation-dal.ts@@ -11,7 +11,7 @@ import { SigningOperationStatus } from "./signer-enums";export type TSigningOperationDALFactory = ReturnType<typeof signingOperationDALFactory>;export const signingOperationDALFactory = (db: TDbClient) => {- const orm = ormify(db, TableName.SigningOperations);+ const orm = ormify(db, TableName.PkiSigningOperations);const findBySignerId = async (signerId: string,@@ -27,25 +27,25 @@ export const signingOperationDALFactory = (db: TDbClient) => {tx?: Knex) => {try {- let query = (tx || db.replicaNode())(TableName.SigningOperations)- .where(`${TableName.SigningOperations}.signerId`, signerId)+ let query = (tx || db.replicaNode())(TableName.PkiSigningOperations)+ .where(`${TableName.PkiSigningOperations}.signerId`, signerId).leftJoin(TableName.Users, (qb) => {void qb- .on(`${TableName.SigningOperations}.actorId`, `${TableName.Users}.id`)- .andOn(`${TableName.SigningOperations}.actorType`, db.raw("?", [ActorType.USER]));+ .on(`${TableName.PkiSigningOperations}.actorId`, `${TableName.Users}.id`)+ .andOn(`${TableName.PkiSigningOperations}.actorType`, db.raw("?", [ActorType.USER]));}).leftJoin(TableName.Identity, (qb) => {void qb- .on(`${TableName.SigningOperations}.actorId`, `${TableName.Identity}.id`)- .andOn(`${TableName.SigningOperations}.actorType`, db.raw("?", [ActorType.IDENTITY]));+ .on(`${TableName.PkiSigningOperations}.actorId`, `${TableName.Identity}.id`)+ .andOn(`${TableName.PkiSigningOperations}.actorType`, db.raw("?", [ActorType.IDENTITY]));}).leftJoin(TableName.Membership, (qb) => {void qb.on(`${TableName.Membership}.actorUserId`, `${TableName.Users}.id`)- .andOn(`${TableName.Membership}.scopeProjectId`, `${TableName.SigningOperations}.projectId`)+ .andOn(`${TableName.Membership}.scopeProjectId`, `${TableName.PkiSigningOperations}.projectId`).andOn(`${TableName.Membership}.scope`, db.raw("?", [AccessScope.Project]));})- .select(selectAllTableCols(TableName.SigningOperations))+ .select(selectAllTableCols(TableName.PkiSigningOperations)).select(db.ref("email").withSchema(TableName.Users).as("userEmail"),db.ref("username").withSchema(TableName.Users).as("userUsername"),@@ -56,10 +56,13 @@ export const signingOperationDALFactory = (db: TDbClient) => {);if (status) {- query = query.where(`${TableName.SigningOperations}.status`, status);+ query = query.where(`${TableName.PkiSigningOperations}.status`, status);}- const rows = await query.orderBy(`${TableName.SigningOperations}.createdAt`, "desc").offset(offset).limit(limit);+ const rows = await query+ .orderBy(`${TableName.PkiSigningOperations}.createdAt`, "desc")+ .offset(offset)+ .limit(limit);return rows.map((row) => {const { userEmail, userUsername, userFirstName, userLastName, identityName, membershipId, ...op } =@@ -98,7 +101,7 @@ export const signingOperationDALFactory = (db: TDbClient) => {const countBySignerId = async (signerId: string, status?: SigningOperationStatus, tx?: Knex) => {try {- let query = (tx || db.replicaNode())(TableName.SigningOperations).where({ signerId });+ let query = (tx || db.replicaNode())(TableName.PkiSigningOperations).where({ signerId });if (status) {query = query.where({ status });@@ -113,7 +116,7 @@ export const signingOperationDALFactory = (db: TDbClient) => {const countByGrantId = async (approvalGrantId: string, tx?: Knex) => {try {- const [result] = await (tx || db)(TableName.SigningOperations)+ const [result] = await (tx || db)(TableName.PkiSigningOperations).where({ approvalGrantId, status: SigningOperationStatus.Success }).count("* as count");return Number((result as unknown as { count: string | number }).count);diff --git a/docs/docs.json b/docs/docs.jsonindex 02b65e75cb..8e06b1471c 100644--- a/docs/docs.json+++ b/docs/docs.json@@ -690,7 +690,8 @@"pages": ["documentation/platform/pki/concepts/certificate-mgmt","documentation/platform/pki/concepts/certificate-lifecycle",- "documentation/platform/pki/concepts/certificate-components"+ "documentation/platform/pki/concepts/certificate-components",+ "documentation/platform/pki/concepts/code-signing"]},{@@ -750,7 +751,34 @@"documentation/platform/pki/alerting/pagerduty-alerts"]},- "documentation/platform/pki/approvals"+ "documentation/platform/pki/approvals",+ {+ "group": "Code Signing",+ "pages": [+ "documentation/platform/pki/code-signing/overview",+ "documentation/platform/pki/code-signing/signers",+ {+ "group": "Approvals",+ "pages": [+ "documentation/platform/pki/code-signing/approval-policies",+ "documentation/platform/pki/code-signing/approval-requests",+ "documentation/platform/pki/code-signing/grants"+ ]+ },+ "documentation/platform/pki/code-signing/pkcs11-module",+ {+ "group": "Guides",+ "pages": [+ "documentation/platform/pki/code-signing/guides/pkcs11-jarsigner",+ "documentation/platform/pki/code-signing/guides/pkcs11-osslsigncode",+ "documentation/platform/pki/code-signing/guides/pkcs11-apksigner",+ "documentation/platform/pki/code-signing/guides/pkcs11-cosign",+ "documentation/platform/pki/code-signing/guides/pkcs11-openssl",+ "documentation/platform/pki/code-signing/guides/pkcs11-gpg"+ ]+ }+ ]+ }]},{@@ -789,26 +817,6 @@"documentation/platform/pki/ca/aws-pca","documentation/platform/pki/ca/venafi"]- },- {- "group": "Code Signing",- "pages": [- "documentation/platform/pki/code-signing/overview",- "documentation/platform/pki/code-signing/signers",- "documentation/platform/pki/code-signing/approvals",- "documentation/platform/pki/code-signing/pkcs11-module",- {- "group": "Guides",- "pages": [- "documentation/platform/pki/code-signing/guides/pkcs11-jarsigner",- "documentation/platform/pki/code-signing/guides/pkcs11-osslsigncode",- "documentation/platform/pki/code-signing/guides/pkcs11-apksigner",- "documentation/platform/pki/code-signing/guides/pkcs11-cosign",- "documentation/platform/pki/code-signing/guides/pkcs11-openssl",- "documentation/platform/pki/code-signing/guides/pkcs11-gpg"- ]- }- ]}]},diff --git a/docs/documentation/platform/pki/code-signing/approval-policies.mdx b/docs/documentation/platform/pki/code-signing/approval-policies.mdxnew file mode 100644index 0000000000..6eafa7a672--- /dev/null+++ b/docs/documentation/platform/pki/code-signing/approval-policies.mdx@@ -0,0 +1,97 @@+---+title: "Approval Policies"+sidebarTitle: "Approval Policies"+description: "Learn how to configure approval policies for code signing operations."+---++In Infisical, code signing approval workflows add a human review step before signing operations can be performed, helping organizations enforce separation of duties and maintain compliance for software supply chain security.++## When to Use Approval Workflows++Approval workflows are recommended when:++- **Separation of duties is required**: Your organization requires different people to request and authorize code signing.+- **Release signing needs oversight**: Signing production releases, firmware, or customer-facing artifacts requires additional review.+- **Compliance mandates review**: Regulatory frameworks or internal policies require documented approval before signing.+- **Preventing unauthorized signing**: You want to ensure artifacts are only signed after proper validation.++## Approval Modes++Infisical supports three approval modes that control how signing grants are issued:++### Manual++Each approved request grants exactly **one signing operation**. This is the strictest mode. Every artifact signature requires a separate approval.++This mode is recommended for high-security environments where each signing operation must be individually authorized.++### Time Window++Each approved request grants signing access for a **defined time period**. You can sign unlimited times within the window.++This mode is recommended for release cycles where a team needs to sign multiple artifacts during a release window (e.g., a 4-hour release deployment).++<Note>+ - The policy defines a `maxWindowDuration` that constrains how long a window can be (from 1 minute to 30 days).+ - The requester specifies the desired `windowStart` and `windowEnd` within that constraint.+</Note>++### N-Signings++Each approved request grants a **fixed number of signing operations**. Once the quota is exhausted, the grant expires automatically.++This mode is recommended for CI pipelines that need to sign a known number of artifacts per build (e.g., 10 JARs per release).++<Note>+ The policy defines a `maxSignings` that caps the number of signings a requester can ask for.+</Note>++## Creating an Approval Policy++An approval policy defines the workflow that must be completed before signing access is granted for a specific signer.++Key features of approval policies include:++- **Approval mode selection**: Choose between Manual, Time Window, or N-Signings mode.+- **Multi-step workflows**: Configure sequential approval steps where each step must be completed before the next begins.+- **Flexible approvers**: Assign individual users or groups as eligible approvers for each step.+- **Required approval count**: Specify how many approvals are needed per step (e.g., require 2 out of 5 eligible approvers).+- **Request expiration**: Set a maximum time-to-live (TTL) for pending requests.++To create an approval policy, head to your Certificate Management Project > **Code Signing > Approvals > Policies** and press **Create Policy**.++<Steps>+ <Step title="Configuring the policy">+ Configure the basic policy settings:++ - **Policy Name**: A descriptive name for the policy such as `release-signing-approval`.+ - **Approval Mode**: The mode that fits your workflow:+ - **Manual**: One approval = one signature.+ - **Time Window**: Approval grants access for a time period. Configure the **Max. Window Duration** (e.g., `4h`, `1d`).+ - **N-Signings**: Approval grants a fixed quota. Configure the **Max. Signings** count.+ - **Max. Request TTL**: The maximum time a request can remain pending before it expires (optional).+ - **Bypass approval for machine identities**: When enabled, machine identities can sign without requiring approval.++ + </Step>+ <Step title="Configuring the approval sequence">+ Configure the approval steps. Each step defines who can approve and how many approvals are required:++ - **Step Name**: An optional name for the step such as `Security Team Review`.+ - **Approvers**: The individual users or groups who are eligible to approve this step.+ - **Required Approvals**: The number of approvals needed to complete this step.++ You can add multiple steps to create a sequential approval workflow. For example:+ 1. **Team Lead Review**: Requires 1 approval from the team leads group+ 2. **Security Review**: Requires 2 approvals from the security team++ Each step must be completed in order before the signing grant is issued.++ + </Step>+ <Step title="Reviewing and creating the policy">+ Review your policy configuration and press **Create** to save the policy.++ + </Step>+</Steps>diff --git a/docs/documentation/platform/pki/code-signing/approval-requests.mdx b/docs/documentation/platform/pki/code-signing/approval-requests.mdxnew file mode 100644index 0000000000..c8089b960f--- /dev/null+++ b/docs/documentation/platform/pki/code-signing/approval-requests.mdx@@ -0,0 +1,76 @@+---+title: "Approval Requests"+sidebarTitle: "Approval Requests"+description: "Learn how to request, approve, and reject signing access through approval workflows."+---++## Requesting Signing Access++When a user or machine identity needs to sign artifacts, they must first request signing access through the approval workflow.++Head to your Certificate Management Project > **Code Signing > Approvals > Requests** and press **Request Signing Access**.++++<Steps>+ <Step title="Selecting a signer and configuring parameters">+ Select the signer you want to use. The form will automatically load the approval mode associated with that signer's policy.++ Depending on the approval mode, provide the required parameters:++ - **Manual**: No additional parameters needed.+ - **Time Window**: Specify the **Window Start** and **Window End** for when you need signing access.+ - **N-Signings**: Specify the **Number of Signings** you need.+ - **Justification**: Optionally provide a reason for the request (e.g., "Release v2.4.0 signing").++ + </Step>+ <Step title="Submitting the request">+ Press **Submit** to create the request. Eligible approvers will be notified.+ </Step>+</Steps>++## Viewing Requests++Head to **Code Signing > Approvals > Requests** to view all approval requests. You can filter requests by status:++- **Open**: Requests currently pending approval+- **Approved**: Requests that have been approved and grants issued+- **Rejected**: Requests that were rejected by an approver+- **Cancelled**: Requests cancelled by the requester+- **Expired**: Requests that exceeded their maximum TTL++## Approving a Request++<Steps>+ <Step title="Opening the request">+ Press on a pending request to view its details.++ + </Step>+ <Step title="Reviewing the request details">+ Review the signing access request information including:+ - Requester name+ - Signer name and certificate+ - Approval mode and parameters (time window, signing count, etc.)+ - Justification+ </Step>+ <Step title="Approve or add comments">+ If you are an eligible approver for the current step, press **Approve** to approve the request.+ </Step>+</Steps>++Once all required approvals for all steps are obtained, a signing grant is automatically issued and the requester can begin signing.++## Rejecting a Request++<Steps>+ <Step title="Opening the request">+ Press on a pending request to view its details.+ </Step>+ <Step title="Rejecting with reason">+ If you are an eligible approver for the current step, press **Reject** to reject the request. Optionally add a comment explaining the rejection.+ </Step>+</Steps>++When a request is rejected, no signing grant is issued.diff --git a/docs/documentation/platform/pki/code-signing/approvals.mdx b/docs/documentation/platform/pki/code-signing/approvals.mdxdeleted file mode 100644index ef25769895..0000000000--- a/docs/documentation/platform/pki/code-signing/approvals.mdx+++ /dev/null@@ -1,216 +0,0 @@-----title: "Approval Policies & Grants"-sidebarTitle: "Approvals"-description: "Learn how to configure approval workflows for code signing operations."------In Infisical, code signing approval workflows add a human review step before signing operations can be performed, helping organizations enforce separation of duties and maintain compliance for software supply chain security.--## When to Use Approval Workflows--Approval workflows are recommended when:--- **Separation of duties is required**: Your organization requires different people to request and authorize code signing.-- **Release signing needs oversight**: Signing production releases, firmware, or customer-facing artifacts requires additional review.-- **Compliance mandates review**: Regulatory frameworks or internal policies require documented approval before signing.-- **Preventing unauthorized signing**: You want to ensure artifacts are only signed after proper validation.--## Approval Modes--Infisical supports three approval modes that control how signing grants are issued:--### Manual--Each approved request grants exactly **one signing operation**. This is the strictest mode. Every artifact signature requires a separate approval.--This mode is recommended for high-security environments where each signing operation must be individually authorized.--### Time Window--Each approved request grants signing access for a **defined time period**. You can sign unlimited times within the window.--This mode is recommended for release cycles where a team needs to sign multiple artifacts during a release window (e.g., a 4-hour release deployment).--<Note>- - The policy defines a `maxWindowDuration` that constrains how long a window can be (from 1 minute to 30 days).- - The requester specifies the desired `windowStart` and `windowEnd` within that constraint.-</Note>--### N-Signings--Each approved request grants a **fixed number of signing operations**. Once the quota is exhausted, the grant expires automatically.--This mode is recommended for CI pipelines that need to sign a known number of artifacts per build (e.g., 10 JARs per release).--<Note>- The policy defines a `maxSignings` that caps the number of signings a requester can ask for.-</Note>--## Approval Policies--An approval policy defines the workflow that must be completed before signing access is granted for a specific signer. Every [signer](/documentation/platform/pki/code-signing/signers) must be linked to an approval policy.--Key features of approval policies include:--- **Approval mode selection**: Choose between Manual, Time Window, or N-Signings mode.-- **Multi-step workflows**: Configure sequential approval steps where each step must be completed before the next begins.-- **Flexible approvers**: Assign individual users or groups as eligible approvers for each step.-- **Required approval count**: Specify how many approvals are needed per step (e.g., require 2 out of 5 eligible approvers).-- **Request expiration**: Set a maximum time-to-live (TTL) for pending requests.--### Guide to Creating an Approval Policy--To create an approval policy, head to your Certificate Management Project > **Code Signing > Approvals > Policies** and press **Create Policy**.--<Steps>- <Step title="Configuring the policy">- Configure the basic policy settings:-- - **Policy Name**: A descriptive name for the policy such as `release-signing-approval`.- - **Approval Mode**: The mode that fits your workflow:- - **Manual**: One approval = one signature.- - **Time Window**: Approval grants access for a time period. Configure the **Max. Window Duration** (e.g., `4h`, `1d`).- - **N-Signings**: Approval grants a fixed quota. Configure the **Max. Signings** count.- - **Max. Request TTL**: The maximum time a request can remain pending before it expires (optional).- - **Bypass approval for machine identities**: When enabled, machine identities can sign without requiring approval.-- - </Step>- <Step title="Configuring the approval sequence">- Configure the approval steps. Each step defines who can approve and how many approvals are required:-- - **Step Name**: An optional name for the step such as `Security Team Review`.- - **Approvers**: The individual users or groups who are eligible to approve this step.- - **Required Approvals**: The number of approvals needed to complete this step.-- You can add multiple steps to create a sequential approval workflow. For example:- 1. **Team Lead Review**: Requires 1 approval from the team leads group- 2. **Security Review**: Requires 2 approvals from the security team-- Each step must be completed in order before the signing grant is issued.-- - </Step>- <Step title="Reviewing and creating the policy">- Review your policy configuration and press **Create** to save the policy.-- - </Step>-</Steps>--## Requesting Signing Access--When a user or machine identity needs to sign artifacts, they must first request signing access through the approval workflow.--### Guide to Requesting Access--Head to your Certificate Management Project > **Code Signing > Approvals > Requests** and press **Request Signing Access**.----<Steps>- <Step title="Selecting a signer and configuring parameters">- Select the signer you want to use. The form will automatically load the approval mode associated with that signer's policy.-- Depending on the approval mode, provide the required parameters:-- - **Manual**: No additional parameters needed.- - **Time Window**: Specify the **Window Start** and **Window End** for when you need signing access.- - **N-Signings**: Specify the **Number of Signings** you need.- - **Justification**: Optionally provide a reason for the request (e.g., "Release v2.4.0 signing").-- - </Step>- <Step title="Submitting the request">- Press **Submit** to create the request. Eligible approvers will be notified.- </Step>-</Steps>--## Approval Requests--When a signing access request is submitted, an approval request is created. Approvers can then review and approve or reject the request.--### Viewing Requests--Head to **Code Signing > Approvals > Requests** to view all approval requests. You can filter requests by status:--- **Open**: Requests currently pending approval-- **Approved**: Requests that have been approved and grants issued-- **Rejected**: Requests that were rejected by an approver-- **Cancelled**: Requests cancelled by the requester-- **Expired**: Requests that exceeded their maximum TTL--### Approving a Request--<Steps>- <Step title="Opening the request">- Press on a pending request to view its details.-- - </Step>- <Step title="Reviewing the request details">- Review the signing access request information including:- - Requester name- - Signer name and certificate- - Approval mode and parameters (time window, signing count, etc.)- - Justification- </Step>- <Step title="Approve or add comments">- If you are an eligible approver for the current step, press **Approve** to approve the request.- </Step>-</Steps>--Once all required approvals for all steps are obtained, a signing grant is automatically issued and the requester can begin signing.--### Rejecting a Request--<Steps>- <Step title="Opening the request">- Press on a pending request to view its details.- </Step>- <Step title="Rejecting with reason">- If you are an eligible approver for the current step, press **Reject** to reject the request. Optionally add a comment explaining the rejection.- </Step>-</Steps>--When a request is rejected, no signing grant is issued.--## Grants--A grant is the authorization that allows a user or machine identity to perform signing operations with a specific signer. Grants are automatically created when an approval request is fully approved.--### Viewing Grants--Head to **Code Signing > Approvals > Grants** to view all grants. You can filter by status:--- **Active**: Grants that are currently valid and can be used for signing.-- **Expired**: Grants that have expired (time window ended, signing quota exhausted, or TTL reached).-- **Revoked**: Grants that were manually revoked by an administrator.----### Revoking a Grant--Administrators can revoke an active grant at any time. To revoke a grant, press the **Revoke** action on the grant row and optionally provide a reason.--Once revoked, the grant can no longer be used for signing operations. The user must request a new grant through the approval workflow.--## FAQ--<AccordionGroup>- <Accordion title="I approved a request but the grant wasn't issued">- If the approval policy has multiple steps, your approval may have completed only one step. The grant is issued only after all approval steps are completed. Check the request details to see which step is currently pending.- </Accordion>- <Accordion title="My grant expired before I finished signing">- Depending on the approval mode:- - **Time Window**: Your window end time has passed. Request a new grant with a longer window.- - **N-Signings**: You used all your allotted signings. Request a new grant with a higher count.- - **Manual**: Manual grants are single-use. Request a new grant for each signing operation.- </Accordion>- <Accordion title="Can I extend an active grant?">- Grants cannot be extended. You need to create a new approval request for additional signing access.- </Accordion>- <Accordion title="What happens to in-flight signing operations when a grant is revoked?">- If a signing operation is already being processed when the grant is revoked, the operation will complete. Subsequent signing attempts with the revoked grant will be denied.- </Accordion>-</AccordionGroup>diff --git a/docs/documentation/platform/pki/code-signing/grants.mdx b/docs/documentation/platform/pki/code-signing/grants.mdxnew file mode 100644index 0000000000..9b62ee9879--- /dev/null+++ b/docs/documentation/platform/pki/code-signing/grants.mdx@@ -0,0 +1,43 @@+---+title: "Grants"+sidebarTitle: "Grants"+description: "Learn how to view and manage signing grants."+---++A grant is the authorization that allows a user or machine identity to perform signing operations with a specific signer. Grants are automatically created when an [approval request](/documentation/platform/pki/code-signing/approval-requests) is fully approved.++## Viewing Grants++Head to **Code Signing > Approvals > Grants** to view all grants. You can filter by status:++- **Active**: Grants that are currently valid and can be used for signing.+- **Expired**: Grants that have expired (time window ended, signing quota exhausted, or TTL reached).+- **Revoked**: Grants that were manually revoked by an administrator.++++## Revoking a Grant++Administrators can revoke an active grant at any time. To revoke a grant, press the **Revoke** action on the grant row and optionally provide a reason.++Once revoked, the grant can no longer be used for signing operations. The user must request a new grant through the approval workflow.++## FAQ++<AccordionGroup>+ <Accordion title="I approved a request but the grant wasn't issued">+ If the approval policy has multiple steps, your approval may have completed only one step. The grant is issued only after all approval steps are completed. Check the request details to see which step is currently pending.+ </Accordion>+ <Accordion title="My grant expired before I finished signing">+ Depending on the approval mode:+ - **Time Window**: Your window end time has passed. Request a new grant with a longer window.+ - **N-Signings**: You used all your allotted signings. Request a new grant with a higher count.+ - **Manual**: Manual grants are single-use. Request a new grant for each signing operation.+ </Accordion>+ <Accordion title="Can I extend an active grant?">+ Grants cannot be extended. You need to create a new approval request for additional signing access.+ </Accordion>+ <Accordion title="What happens to in-flight signing operations when a grant is revoked?">+ If a signing operation is already being processed when the grant is revoked, the operation will complete. Subsequent signing attempts with the revoked grant will be denied.+ </Accordion>+</AccordionGroup>diff --git a/docs/documentation/platform/pki/code-signing/guides/pkcs11-apksigner.mdx b/docs/documentation/platform/pki/code-signing/guides/pkcs11-apksigner.mdxindex 9cfedd76f3..03942516bf 100644--- a/docs/documentation/platform/pki/code-signing/guides/pkcs11-apksigner.mdx+++ b/docs/documentation/platform/pki/code-signing/guides/pkcs11-apksigner.mdx@@ -9,7 +9,7 @@ In the following steps, we explore how to sign Android APK and Android App Bundl## Prerequisites- An Infisical project with a [signer](/documentation/platform/pki/code-signing/signers) configured-- An active [signing grant](/documentation/platform/pki/code-signing/approvals) for the signer+- An active [signing grant](/documentation/platform/pki/code-signing/grants) for the signer- A [machine identity](/documentation/platform/identities/machine-identities) with Universal Auth and `Sign` permission on the signer- The Infisical PKCS#11 module [installed and configured](/documentation/platform/pki/code-signing/pkcs11-module)- Android SDK Build Tools 30.0.0 or later (includes `apksigner`)diff --git a/docs/documentation/platform/pki/code-signing/guides/pkcs11-cosign.mdx b/docs/documentation/platform/pki/code-signing/guides/pkcs11-cosign.mdxindex c74c34d6ad..914f17d8b0 100644--- a/docs/documentation/platform/pki/code-signing/guides/pkcs11-cosign.mdx+++ b/docs/documentation/platform/pki/code-signing/guides/pkcs11-cosign.mdx@@ -9,7 +9,7 @@ In the following steps, we explore how to sign OCI container images using `cosig## Prerequisites- An Infisical project with a [signer](/documentation/platform/pki/code-signing/signers) configured-- An active [signing grant](/documentation/platform/pki/code-signing/approvals) for the signer+- An active [signing grant](/documentation/platform/pki/code-signing/grants) for the signer- A [machine identity](/documentation/platform/identities/machine-identities) with Universal Auth and `Sign` permission on the signer- The Infisical PKCS#11 module [installed and configured](/documentation/platform/pki/code-signing/pkcs11-module)- `cosign` v2.0 or later, **built with PKCS#11 support** (see below)diff --git a/docs/documentation/platform/pki/code-signing/guides/pkcs11-gpg.mdx b/docs/documentation/platform/pki/code-signing/guides/pkcs11-gpg.mdxindex 3ce587e4b7..85ee4f73fa 100644--- a/docs/documentation/platform/pki/code-signing/guides/pkcs11-gpg.mdx+++ b/docs/documentation/platform/pki/code-signing/guides/pkcs11-gpg.mdx@@ -9,7 +9,7 @@ In the following steps, we explore how to use GnuPG with the Infisical PKCS#11 m## Prerequisites- An Infisical project with a [signer](/documentation/platform/pki/code-signing/signers) configured (RSA keys recommended for GPG compatibility)-- An active [signing grant](/documentation/platform/pki/code-signing/approvals) for the signer+- An active [signing grant](/documentation/platform/pki/code-signing/grants) for the signer- A [machine identity](/documentation/platform/identities/machine-identities) with Universal Auth and `Sign` permission on the signer- The Infisical PKCS#11 module [installed and configured](/documentation/platform/pki/code-signing/pkcs11-module)- GnuPG 2.2 or laterdiff --git a/docs/documentation/platform/pki/code-signing/guides/pkcs11-jarsigner.mdx b/docs/documentation/platform/pki/code-signing/guides/pkcs11-jarsigner.mdxindex fa25f2ef3a..752150d43c 100644--- a/docs/documentation/platform/pki/code-signing/guides/pkcs11-jarsigner.mdx+++ b/docs/documentation/platform/pki/code-signing/guides/pkcs11-jarsigner.mdx@@ -9,7 +9,7 @@ In the following steps, we explore how to sign Java JAR files using `jarsigner`## Prerequisites- An Infisical project with a [signer](/documentation/platform/pki/code-signing/signers) configured-- An active [signing grant](/documentation/platform/pki/code-signing/approvals) for the signer+- An active [signing grant](/documentation/platform/pki/code-signing/grants) for the signer- A [machine identity](/documentation/platform/identities/machine-identities) with Universal Auth and `Sign` permission on the signer- The Infisical PKCS#11 module [installed and configured](/documentation/platform/pki/code-signing/pkcs11-module)- Java JDK 9 or later (for the `-addprovider` flag)diff --git a/docs/documentation/platform/pki/code-signing/guides/pkcs11-openssl.mdx b/docs/documentation/platform/pki/code-signing/guides/pkcs11-openssl.mdxindex 77a11d4f56..4d4f74b0db 100644--- a/docs/documentation/platform/pki/code-signing/guides/pkcs11-openssl.mdx+++ b/docs/documentation/platform/pki/code-signing/guides/pkcs11-openssl.mdx@@ -9,7 +9,7 @@ In the following steps, we explore how to use OpenSSL with the Infisical PKCS#11## Prerequisites- An Infisical project with a [signer](/documentation/platform/pki/code-signing/signers) configured-- An active [signing grant](/documentation/platform/pki/code-signing/approvals) for the signer+- An active [signing grant](/documentation/platform/pki/code-signing/grants) for the signer- A [machine identity](/documentation/platform/identities/machine-identities) with Universal Auth and `Sign` permission on the signer- The Infisical PKCS#11 module [installed and configured](/documentation/platform/pki/code-signing/pkcs11-module)- OpenSSL 1.1.1 or laterdiff --git a/docs/documentation/platform/pki/code-signing/guides/pkcs11-osslsigncode.mdx b/docs/documentation/platform/pki/code-signing/guides/pkcs11-osslsigncode.mdxindex cfe39f6494..3fc084cc15 100644--- a/docs/documentation/platform/pki/code-signing/guides/pkcs11-osslsigncode.mdx+++ b/docs/documentation/platform/pki/code-signing/guides/pkcs11-osslsigncode.mdx@@ -9,7 +9,7 @@ In the following steps, we explore how to sign Windows Authenticode artifacts us## Prerequisites- An Infisical project with a [signer](/documentation/platform/pki/code-signing/signers) configured-- An active [signing grant](/documentation/platform/pki/code-signing/approvals) for the signer+- An active [signing grant](/documentation/platform/pki/code-signing/grants) for the signer- A [machine identity](/documentation/platform/identities/machine-identities) with Universal Auth and `Sign` permission on the signer- The Infisical PKCS#11 module [installed and configured](/documentation/platform/pki/code-signing/pkcs11-module)- `osslsigncode` 2.5 or later (includes native PKCS#11 support)diff --git a/docs/documentation/platform/pki/code-signing/overview.mdx b/docs/documentation/platform/pki/code-signing/overview.mdxindex 1d2c161744..1bfc7b7d1b 100644--- a/docs/documentation/platform/pki/code-signing/overview.mdx+++ b/docs/documentation/platform/pki/code-signing/overview.mdx@@ -14,27 +14,22 @@ In Infisical, Code Signing lets you digitally sign software artifacts (JARs, binsequenceDiagramparticipant Tool as Signing Toolparticipant PKCS as PKCS#11 Module- participant API as Infisical API- participant KMS as Key Storage+ participant Infisical as InfisicalTool->>PKCS: Sign data- PKCS->>API: POST /signers/{id}/sign- API->>API: Validate grant & policy- API->>KMS: Retrieve private key- KMS-->>API: Private key- API->>API: Compute signature- API-->>PKCS: Signature bytes+ PKCS->>Infisical: POST /signers/{id}/sign+ Infisical->>Infisical: Validate grant, sign data+ Infisical-->>PKCS: SignaturePKCS-->>Tool: Signature```</div>1. A **Signer** is created and bound to a certificate with the `codeSigning` extended key usage.-2. An **Approval Policy** governs who can use the signer and under what conditions.-3. Users or machine identities **request signing access** through the approval workflow.-4. Once approved, the caller receives a **grant** that authorizes signing operations.-5. The signing tool (e.g., jarsigner) calls the Infisical API, either directly or through the [PKCS#11 module](/documentation/platform/pki/code-signing/pkcs11-module), and the signature is computed server-side.-6. Every signing operation is recorded as an immutable **audit entry** on the signer.+2. Optionally, an **Approval Policy** is attached to govern who can use the signer and under what conditions. Without a policy, authorized users and identities can sign immediately.+3. When a policy is configured, users or machine identities **request signing access** through the approval workflow. Once approved, the caller receives a **grant** that authorizes signing operations.+4. The signing tool (e.g., jarsigner) calls the Infisical API, either directly or through the [PKCS#11 module](/documentation/platform/pki/code-signing/pkcs11-module), and the signature is computed server-side.+5. Every signing operation is recorded as an immutable **audit entry** on the signer.## Core Concepts@@ -44,7 +39,7 @@ A [signer](/documentation/platform/pki/code-signing/signers) is a named code-sig### Approval Policies-[Approval policies](/documentation/platform/pki/code-signing/approvals) define the rules that must be satisfied before signing can occur. Infisical supports three approval modes:+[Approval policies](/documentation/platform/pki/code-signing/approval-policies) optionally define the rules that must be satisfied before signing can occur. When a signer has an approval policy, Infisical supports three approval modes:- **Manual**: Each approval grants exactly one signing operation.- **Time Window**: Approval grants signing access for a defined time period.@@ -64,7 +59,7 @@ The Infisical [PKCS#11 module](/documentation/platform/pki/code-signing/pkcs11-m<Card title="Create a Signer" href="/documentation/platform/pki/code-signing/signers">Set up a code-signing identity and bind it to a certificate.</Card>- <Card title="Configure Approvals" href="/documentation/platform/pki/code-signing/approvals">+ <Card title="Configure Approvals" href="/documentation/platform/pki/code-signing/approval-policies">Define approval policies to control who can sign and when.</Card></CardGroup>diff --git a/docs/documentation/platform/pki/code-signing/signers.mdx b/docs/documentation/platform/pki/code-signing/signers.mdxindex b099dad365..b735e93c1c 100644--- a/docs/documentation/platform/pki/code-signing/signers.mdx+++ b/docs/documentation/platform/pki/code-signing/signers.mdx@@ -11,7 +11,7 @@ Private keys never leave the Infisical server. When a signing operation is reque## Key Characteristics- **Bound to a certificate**: Every signer must be linked to a certificate that has the `codeSigning` EKU.-- **Linked to an approval policy**: Every signer must be associated with an [approval policy](/documentation/platform/pki/code-signing/approvals) that governs who can sign and under what conditions.+- **Optional approval policy**: A signer can optionally be associated with an [approval policy](/documentation/platform/pki/code-signing/approval-policies) that governs who can sign and under what conditions. Without a policy, signing is allowed without approval.- **Supports RSA and ECDSA**: Signers support RSA (2048, 3072, 4096-bit) and ECDSA (P-256, P-384, P-521) key types depending on the certificate.- **Tracks signing history**: Every signing operation is recorded with actor, algorithm, data hash, and grant information.@@ -19,14 +19,14 @@ Private keys never leave the Infisical server. When a signing operation is reque<Steps><Step title="Issuing a code-signing certificate">- Before creating a signer, you need a certificate with the `codeSigning` extended key usage. You can issue one from your Certificate Authority (CA) by specifying `codeSigning` in the extended key usage field.+ Before creating a signer, you need a certificate with the `codeSigning` extended key usage. Follow the [guide to issuing certificates](/documentation/platform/pki/certificates/certificates#guide-to-issuing-certificates) and specify `codeSigning` in the extended key usage field.<Note>Only certificates with the `codeSigning` extended key usage will be available when creating a signer. If you don't see your certificate, verify that it was issued with the correct EKU.</Note></Step>- <Step title="Creating an approval policy">- Every signer requires an approval policy. If you haven't created one yet, head to **Code Signing > Approvals > Policies** and press **Create Policy**. See [Approval Policies](/documentation/platform/pki/code-signing/approvals) for details.+ <Step title="(Optional) Creating an approval policy">+ If you want to require approval before signing, head to **Code Signing > Approvals > Policies** and press **Create Policy**. See [Approval Policies](/documentation/platform/pki/code-signing/approval-policies) for details. Without a policy, any authorized user or identity can sign immediately.</Step><Step title="Creating the signer">Head to your Certificate Management Project > **Code Signing > Signers** and press **Create Signer**.@@ -38,41 +38,12 @@ Private keys never leave the Infisical server. When a signing operation is reque- **Name**: A slug-friendly name for the signer such as `release-signer`.- **Description**: An optional description of the signer's purpose.- **Certificate**: The code-signing certificate to bind to this signer.- - **Approval Policy**: The approval policy that governs signing access for this signer.+ - **Approval Policy** (optional): The approval policy that governs signing access for this signer. If omitted, signing is allowed without approval.Press **Create** to save the signer.</Step></Steps>-## Managing Signers--### Viewing Signer Details--Press on any signer in the table to view its detail page, which includes:--- **Overview**: Signer name, status, linked certificate details (serial number, algorithm, validity dates), and the associated approval policy.-- **Signing Operations**: A paginated audit log of all signing operations performed with this signer, including status, algorithm, actor, and timestamp.----### Signing Operations Log--The signer detail page includes a complete audit trail of all signing activity, including successful signatures, denied requests, and errors. Each entry shows the timestamp, algorithm, data hash, and the actor that performed the operation.--### Enabling and Disabling Signers--Signers can be toggled between **Active** and **Disabled** states. A disabled signer will reject all signing requests until re-enabled. To toggle the status, use the status switch on the signer detail page or the signer table.----### Deleting a Signer--To delete a signer, press the delete action on the signer table row. Deleting a signer does not delete the underlying certificate or its signing operation history.--<Warning>- Deleting a signer is irreversible. Any active grants for the signer will no longer be usable.-</Warning>-## Supported Signing AlgorithmsThe available signing algorithms depend on the certificate's key type:diff --git a/docs/documentation/platform/pki/concepts/code-signing.mdx b/docs/documentation/platform/pki/concepts/code-signing.mdxnew file mode 100644index 0000000000..d7bc0b0047--- /dev/null+++ b/docs/documentation/platform/pki/concepts/code-signing.mdx@@ -0,0 +1,30 @@+---+title: "Code Signing"+description: "Learn what code signing is and how it helps ensure software integrity and trust."+---++## What is Code Signing?++Code signing is the process of applying a digital signature to software artifacts — executables, libraries, firmware, container images, or packages — using a cryptographic key pair bound to a certificate. The signature lets consumers verify that the artifact was produced by a trusted publisher and has not been tampered with since it was signed.++When a user or system validates a signed artifact, it checks that the signature matches the artifact's contents and that the signing certificate chains back to a trusted Certificate Authority (CA). If either check fails, the artifact is flagged as untrusted.++## Why Does Code Signing Matter?++Without code signing, there is no cryptographic proof that a piece of software is authentic. Attackers can modify binaries, inject malware into packages, or impersonate legitimate publishers. Code signing addresses these risks by providing:++- **Integrity**: Any modification to a signed artifact after signing invalidates the signature, making tampering detectable.+- **Authenticity**: The signature ties the artifact to the identity in the signing certificate, proving who produced it.+- **Non-repudiation**: The signer cannot deny having signed the artifact, since only they control the private key.+- **Supply chain security**: Package managers, operating systems, and container runtimes use signatures to gate installation and execution, blocking unsigned or tampered artifacts.++## How Infisical Handles Code Signing++Infisical provides a managed code signing workflow built on top of its PKI infrastructure:++1. **[Signers](/documentation/platform/pki/code-signing/signers)** are identities bound to a certificate with the `codeSigning` extended key usage. Private keys never leave Infisical; signing operations happen server-side.+2. **[Approval policies](/documentation/platform/pki/code-signing/approval-policies)** optionally add a human review step before signing is allowed, enforcing separation of duties.+3. **[Grants](/documentation/platform/pki/code-signing/grants)** are time-limited or count-limited authorizations issued after approval, controlling exactly when and how many times a user can sign.+4. **[PKCS#11 module](/documentation/platform/pki/code-signing/pkcs11-module)** lets standard signing tools (jarsigner, osslsigncode, cosign, etc.) use Infisical signers without code changes.++Every signing operation, whether it succeeds, fails, or is denied, is recorded as an immutable audit trail.diff --git a/frontend/src/const/routes.ts b/frontend/src/const/routes.tsindex c09fa42737..8adf441905 100644--- a/frontend/src/const/routes.ts+++ b/frontend/src/const/routes.ts@@ -335,6 +335,10 @@ export const ROUTE_PATHS = Object.freeze({CertificateDetailsByIDPage: setRoute("/organizations/$orgId/projects/cert-manager/$projectId/certificates/$certificateId","/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId/_cert-manager-layout/certificates/$certificateId"+ ),+ SignerDetailByIDPage: setRoute(+ "/organizations/$orgId/projects/cert-manager/$projectId/code-signing/$signerId",+ "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId/_cert-manager-layout/code-signing/$signerId")},Ssh: {diff --git a/frontend/src/hooks/api/approvalPolicies/index.tsx b/frontend/src/hooks/api/approvalPolicies/index.tsxindex bdacd66307..926d421dec 100644--- a/frontend/src/hooks/api/approvalPolicies/index.tsx+++ b/frontend/src/hooks/api/approvalPolicies/index.tsx@@ -10,7 +10,6 @@ export {ApprovalPolicyType,ApproverType,type CertRequestPolicyConditions,- CodeSigningApprovalMode,type CodeSigningPolicyConstraints,type PamAccessPolicyConditions,type PamAccessPolicyConstraints,diff --git a/frontend/src/hooks/api/approvalPolicies/types.ts b/frontend/src/hooks/api/approvalPolicies/types.tsindex 11a256c979..5de960c275 100644--- a/frontend/src/hooks/api/approvalPolicies/types.ts+++ b/frontend/src/hooks/api/approvalPolicies/types.ts@@ -1,7 +1,7 @@export enum ApprovalPolicyType {PamAccess = "pam-access",CertRequest = "cert-request",- CertManagerCodeSigning = "cert-manager-code-signing"+ CertCodeSigning = "cert-code-signing"}export enum ApproverType {@@ -37,16 +37,9 @@ export type CertRequestPolicyConditions = {export type CertRequestPolicyConstraints = Record<string, never>;-export enum CodeSigningApprovalMode {- Manual = "manual",- TimeWindow = "time-window",- NSignings = "n-signings"-}-export type CodeSigningPolicyConditions = Record<string, never>[];export type CodeSigningPolicyConstraints = {- approvalMode: CodeSigningApprovalMode;maxWindowDuration?: string;maxSignings?: number;};diff --git a/frontend/src/hooks/api/approvalRequests/types.ts b/frontend/src/hooks/api/approvalRequests/types.tsindex fd351c4035..fc0b19e49b 100644--- a/frontend/src/hooks/api/approvalRequests/types.ts+++ b/frontend/src/hooks/api/approvalRequests/types.ts@@ -1,4 +1,4 @@-import { ApprovalPolicyType, ApproverType, CodeSigningApprovalMode } from "../approvalPolicies";+import { ApprovalPolicyType, ApproverType } from "../approvalPolicies";export enum ApprovalRequestStatus {Pending = "pending",@@ -86,7 +86,6 @@ export type CodeSigningRequestData = {signerId: string;approvalPolicyId: string;signerName: string;- approvalMode: CodeSigningApprovalMode;justification?: string;requestedWindowStart?: string;requestedWindowEnd?: string;diff --git a/frontend/src/hooks/api/signers/types.ts b/frontend/src/hooks/api/signers/types.tsindex 9b7427804e..5ffdd415f9 100644--- a/frontend/src/hooks/api/signers/types.ts+++ b/frontend/src/hooks/api/signers/types.ts@@ -38,7 +38,7 @@ export type TSigner = {description?: string | null;status: SignerStatus;certificateId: string;- approvalPolicyId: string;+ approvalPolicyId?: string | null;lastSignedAt?: string | null;createdAt: string;updatedAt: string;@@ -91,7 +91,7 @@ export type TCreateSignerDTO = {name: string;description?: string;certificateId: string;- approvalPolicyId: string;+ approvalPolicyId?: string;};export type TUpdateSignerDTO = {@@ -100,7 +100,7 @@ export type TUpdateSignerDTO = {description?: string | null;status?: SignerStatus;certificateId?: string;- approvalPolicyId?: string;+ approvalPolicyId?: string | null;};export type TDeleteSignerDTO = {diff --git a/frontend/src/pages/cert-manager/ApprovalRequestDetailPage/ApprovalRequestDetailPage.tsx b/frontend/src/pages/cert-manager/ApprovalRequestDetailPage/ApprovalRequestDetailPage.tsxindex 5d907881e9..26d68634b2 100644--- a/frontend/src/pages/cert-manager/ApprovalRequestDetailPage/ApprovalRequestDetailPage.tsx+++ b/frontend/src/pages/cert-manager/ApprovalRequestDetailPage/ApprovalRequestDetailPage.tsx@@ -10,7 +10,7 @@ import { Button, ConfirmActionModal, ContentLoader, EmptyState } from "@app/compimport { Badge } from "@app/components/v3";import { useOrganization, useProject, useUser } from "@app/context";import { usePopUp } from "@app/hooks";-import { ApprovalPolicyType, CodeSigningApprovalMode } from "@app/hooks/api/approvalPolicies";+import { ApprovalPolicyType } from "@app/hooks/api/approvalPolicies";import {approvalRequestQuery,ApprovalRequestStatus,@@ -28,10 +28,13 @@ import {const ROUTE_ID ="/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId/_cert-manager-layout/approval-requests/$approvalRequestId" as const;-const APPROVAL_MODE_LABELS: Record<CodeSigningApprovalMode, string> = {- [CodeSigningApprovalMode.Manual]: "One time use",- [CodeSigningApprovalMode.TimeWindow]: "Time Window",- [CodeSigningApprovalMode.NSignings]: "Count-Limited"+const deriveApprovalModeLabel = (requestData: CodeSigningRequestData): string => {+ const hasTime = Boolean(requestData.requestedWindowStart);+ const hasCount = Boolean(requestData.requestedSignings);+ if (hasTime && hasCount) return "Combined";+ if (hasTime) return "Time-based";+ if (hasCount) return "Count-based";+ return "Manual";};const CodeSigningDetailsSection = ({ requestData }: { requestData: CodeSigningRequestData }) => {@@ -45,9 +48,7 @@ const CodeSigningDetailsSection = ({ requestData }: { requestData: CodeSigningRe</div><div><span className="text-xs text-mineshaft-400">Approval Mode</span>- <p className="text-sm text-mineshaft-100">- {APPROVAL_MODE_LABELS[requestData.approvalMode]}- </p>+ <p className="text-sm text-mineshaft-100">{deriveApprovalModeLabel(requestData)}</p></div>{requestData.requestedWindowStart && requestData.requestedWindowEnd && (<>@@ -87,7 +88,7 @@ const PageContent = () => {const { handlePopUpOpen, handlePopUpToggle, popUp } = usePopUp(["cancelRequest"]);const resolvedPolicyType = policyType || ApprovalPolicyType.CertRequest;- const isCodeSigning = resolvedPolicyType === ApprovalPolicyType.CertManagerCodeSigning;+ const isCodeSigning = resolvedPolicyType === ApprovalPolicyType.CertCodeSigning;const { data: request, isPending } = useQuery(approvalRequestQuery.getById({diff --git a/frontend/src/pages/cert-manager/ApprovalsPage/components/CodeSigningGrantsTab/CodeSigningGrantsTab.tsx b/frontend/src/pages/cert-manager/ApprovalsPage/components/CodeSigningGrantsTab/CodeSigningGrantsTab.tsxindex 63bdcb7321..25cec3fb24 100644--- a/frontend/src/pages/cert-manager/ApprovalsPage/components/CodeSigningGrantsTab/CodeSigningGrantsTab.tsx+++ b/frontend/src/pages/cert-manager/ApprovalsPage/components/CodeSigningGrantsTab/CodeSigningGrantsTab.tsx@@ -97,7 +97,7 @@ export const CodeSigningGrantsTab = () => {const { data: grants = [], isPending: isGrantsLoading } = useQuery(approvalGrantQuery.list({- policyType: ApprovalPolicyType.CertManagerCodeSigning,+ policyType: ApprovalPolicyType.CertCodeSigning,projectId}));@@ -181,7 +181,7 @@ export const CodeSigningGrantsTab = () => {try {await revokeGrant({- policyType: ApprovalPolicyType.CertManagerCodeSigning,+ policyType: ApprovalPolicyType.CertCodeSigning,grantId: grantToRevoke,revocationReason: data.revocationReason});@@ -387,7 +387,7 @@ export const CodeSigningGrantsTab = () => {approvalRequestId: grant.requestId}}search={{- policyType: ApprovalPolicyType.CertManagerCodeSigning+ policyType: ApprovalPolicyType.CertCodeSigning}}><DropdownMenuItem icon={<FontAwesomeIcon icon={faInfo} />}>diff --git a/frontend/src/pages/cert-manager/ApprovalsPage/components/CodeSigningPolicyTab/CodeSigningPolicyTab.tsx b/frontend/src/pages/cert-manager/ApprovalsPage/components/CodeSigningPolicyTab/CodeSigningPolicyTab.tsxindex 2d2c57a3dd..e42b08897c 100644--- a/frontend/src/pages/cert-manager/ApprovalsPage/components/CodeSigningPolicyTab/CodeSigningPolicyTab.tsx+++ b/frontend/src/pages/cert-manager/ApprovalsPage/components/CodeSigningPolicyTab/CodeSigningPolicyTab.tsx@@ -37,7 +37,7 @@ export const CodeSigningPolicyTab = () => {if (!policyId) return;await deleteApprovalPolicy({- policyType: ApprovalPolicyType.CertManagerCodeSigning,+ policyType: ApprovalPolicyType.CertCodeSigning,policyId});createNotification({@@ -52,10 +52,10 @@ export const CodeSigningPolicyTab = () => {<div className="mb-4 flex items-center"><div className="flex-1"><div className="flex items-center gap-x-2">- <p className="text-xl font-medium text-mineshaft-100">Code Signing Approval Policies</p>+ <p className="text-xl font-medium text-mineshaft-100">Approval Policies</p></div><p className="text-sm text-bunker-300">- Define policies that require approval before code signing operations+ Define policies that require approval before signing operations</p></div>diff --git a/frontend/src/pages/cert-manager/ApprovalsPage/components/CodeSigningPolicyTab/components/CodeSigningPoliciesTable.tsx b/frontend/src/pages/cert-manager/ApprovalsPage/components/CodeSigningPolicyTab/components/CodeSigningPoliciesTable.tsxindex 58a0e95c6f..3e5cf56d62 100644--- a/frontend/src/pages/cert-manager/ApprovalsPage/components/CodeSigningPolicyTab/components/CodeSigningPoliciesTable.tsx+++ b/frontend/src/pages/cert-manager/ApprovalsPage/components/CodeSigningPolicyTab/components/CodeSigningPoliciesTable.tsx@@ -38,17 +38,10 @@ import {import { UsePopUpState } from "@app/hooks/usePopUp";type CodeSigningConstraints = {- approvalMode: string;maxWindowDuration?: string;maxSignings?: number;};-const APPROVAL_MODE_CONFIG: Record<string, { label: string; icon: typeof faClock }> = {- manual: { label: "Manual", icon: faHandPointer },- "time-window": { label: "Time Window", icon: faClock },- "n-signings": { label: "Count-Limited", icon: faHashtag }-};-type Props = {handlePopUpOpen: (popUpName: keyof UsePopUpState<["policy", "deletePolicy"]>,@@ -62,7 +55,7 @@ export const CodeSigningPoliciesTable = ({ handlePopUpOpen }: Props) => {const { data: policies = [], isPending: isPoliciesLoading } = useQuery(approvalPolicyQuery.list({- policyType: ApprovalPolicyType.CertManagerCodeSigning,+ policyType: ApprovalPolicyType.CertCodeSigning,projectId}));@@ -75,8 +68,12 @@ export const CodeSigningPoliciesTable = ({ handlePopUpOpen }: Props) => {const getApprovalModeConfig = (policy: TApprovalPolicy) => {const constraints = policy.constraints?.constraints as CodeSigningConstraints | undefined;- const mode = constraints?.approvalMode ?? "manual";- return APPROVAL_MODE_CONFIG[mode] ?? { label: mode, icon: faHandPointer };+ const hasTime = Boolean(constraints?.maxWindowDuration);+ const hasCount = Boolean(constraints?.maxSignings);+ if (hasTime && hasCount) return { label: "Combined", icon: faClock };+ if (hasTime) return { label: "Time-based", icon: faClock };+ if (hasCount) return { label: "Count-based", icon: faHashtag };+ return { label: "Manual", icon: faHandPointer };};return (@@ -157,7 +154,7 @@ export const CodeSigningPoliciesTable = ({ handlePopUpOpen }: Props) => {</TBody></Table>{!isPoliciesLoading && !sortedPolicies.length && (- <EmptyState title="No code signing approval policies found" icon={faFileCircleQuestion} />+ <EmptyState title="No approval policies found" icon={faFileCircleQuestion} />)}</TableContainer>);diff --git a/frontend/src/pages/cert-manager/ApprovalsPage/components/CodeSigningPolicyTab/components/CodeSigningPolicyModal.tsx b/frontend/src/pages/cert-manager/ApprovalsPage/components/CodeSigningPolicyTab/components/CodeSigningPolicyModal.tsxindex 7947b4c175..bc0e4c97ce 100644--- a/frontend/src/pages/cert-manager/ApprovalsPage/components/CodeSigningPolicyTab/components/CodeSigningPolicyModal.tsx+++ b/frontend/src/pages/cert-manager/ApprovalsPage/components/CodeSigningPolicyTab/components/CodeSigningPolicyModal.tsx@@ -9,7 +9,6 @@ import { Button, Modal, ModalContent } from "@app/components/v2";import { useProject } from "@app/context";import {ApprovalPolicyType,- CodeSigningApprovalMode,TApprovalPolicy,useCreateApprovalPolicy,useUpdateApprovalPolicy@@ -26,7 +25,6 @@ type Props = {};type CodeSigningConstraints = {- approvalMode: CodeSigningApprovalMode;maxWindowDuration?: string;maxSignings?: number;};@@ -56,7 +54,8 @@ export const CodeSigningPolicyModal = ({ popUp, handlePopUpToggle }: Props) => {name: "",maxRequestTtl: null,constraints: {- approvalMode: CodeSigningApprovalMode.Manual+ maxWindowDuration: undefined,+ maxSignings: undefined},bypassForMachineIdentities: false,steps: [@@ -82,7 +81,6 @@ export const CodeSigningPolicyModal = ({ popUp, handlePopUpToggle }: Props) => {name: policyData.policy.name,maxRequestTtl: policyData.policy.maxRequestTtl,constraints: {- approvalMode: constraints.approvalMode || CodeSigningApprovalMode.Manual,maxWindowDuration: constraints.maxWindowDuration,maxSignings: constraints.maxSignings},@@ -97,7 +95,8 @@ export const CodeSigningPolicyModal = ({ popUp, handlePopUpToggle }: Props) => {name: "",maxRequestTtl: null,constraints: {- approvalMode: CodeSigningApprovalMode.Manual+ maxWindowDuration: undefined,+ maxSignings: undefined},bypassForMachineIdentities: false,steps: [@@ -118,7 +117,7 @@ export const CodeSigningPolicyModal = ({ popUp, handlePopUpToggle }: Props) => {if (policyData?.policyId) {await updatePolicy({- policyType: ApprovalPolicyType.CertManagerCodeSigning,+ policyType: ApprovalPolicyType.CertCodeSigning,policyId: policyData.policyId,...data});@@ -128,7 +127,7 @@ export const CodeSigningPolicyModal = ({ popUp, handlePopUpToggle }: Props) => {});} else {await createPolicy({- policyType: ApprovalPolicyType.CertManagerCodeSigning,+ policyType: ApprovalPolicyType.CertCodeSigning,projectId: currentProject.id,conditions: [],...datadiff --git a/frontend/src/pages/cert-manager/ApprovalsPage/components/CodeSigningPolicyTab/components/CodeSigningPolicySchema.tsx b/frontend/src/pages/cert-manager/ApprovalsPage/components/CodeSigningPolicyTab/components/CodeSigningPolicySchema.tsxindex 3c5d78cb51..18c71b3a25 100644--- a/frontend/src/pages/cert-manager/ApprovalsPage/components/CodeSigningPolicyTab/components/CodeSigningPolicySchema.tsx+++ b/frontend/src/pages/cert-manager/ApprovalsPage/components/CodeSigningPolicyTab/components/CodeSigningPolicySchema.tsx@@ -2,9 +2,6 @@ import ms from "ms";import { z } from "zod";import { ApprovalStepsSchema } from "@app/components/approvals";-import { CodeSigningApprovalMode } from "@app/hooks/api/approvalPolicies";--export { CodeSigningApprovalMode };const DurationSchema = (min = 60,@@ -28,7 +25,6 @@ export const CodeSigningPolicyFormSchema = z.object({"Duration must be between 1 day and 30 days").nullish(),constraints: z.object({- approvalMode: z.nativeEnum(CodeSigningApprovalMode),maxWindowDuration: DurationSchema().optional(),maxSignings: z.coerce.number().int().positive().optional()}),diff --git a/frontend/src/pages/cert-manager/ApprovalsPage/components/CodeSigningPolicyTab/components/CodeSigningPolicySteps/CodeSigningPolicyDetailsStep.tsx b/frontend/src/pages/cert-manager/ApprovalsPage/components/CodeSigningPolicyTab/components/CodeSigningPolicySteps/CodeSigningPolicyDetailsStep.tsxindex 7408ba0cda..0efddaeaa3 100644--- a/frontend/src/pages/cert-manager/ApprovalsPage/components/CodeSigningPolicyTab/components/CodeSigningPolicySteps/CodeSigningPolicyDetailsStep.tsx+++ b/frontend/src/pages/cert-manager/ApprovalsPage/components/CodeSigningPolicyTab/components/CodeSigningPolicySteps/CodeSigningPolicyDetailsStep.tsx@@ -1,20 +1,12 @@import { Controller, useFormContext } from "react-hook-form";import { TtlFormLabel } from "@app/components/features";-import { Checkbox, FormControl, Input, Select, SelectItem } from "@app/components/v2";+import { Checkbox, FormControl, Input } from "@app/components/v2";-import { CodeSigningApprovalMode, TCodeSigningPolicyForm } from "../CodeSigningPolicySchema";--const APPROVAL_MODE_LABELS: Record<CodeSigningApprovalMode, string> = {- [CodeSigningApprovalMode.Manual]: "One time use",- [CodeSigningApprovalMode.TimeWindow]: "Time Window",- [CodeSigningApprovalMode.NSignings]: "N Signings"-};+import { TCodeSigningPolicyForm } from "../CodeSigningPolicySchema";export const CodeSigningPolicyDetailsStep = () => {- const { control, watch } = useFormContext<TCodeSigningPolicyForm>();-- const approvalMode = watch("constraints.approvalMode");+ const { control } = useFormContext<TCodeSigningPolicyForm>();return (<div className="flex flex-col gap-4">@@ -65,82 +57,56 @@ export const CodeSigningPolicyDetailsStep = () => {<Controllercontrol={control}- name="constraints.approvalMode"+ name="constraints.maxWindowDuration"render={({ field, fieldState: { error } }) => (<FormControl- isRequired- label="Approval Mode"+ label="Max Window Duration"isError={Boolean(error)}errorText={error?.message}- helperText="How approved requests are consumed"+ helperText="Maximum signing window duration (e.g., 1h, 1d). Leave empty for single-use approval.">- <Select value={field.value} onValueChange={field.onChange} className="w-full">- {Object.values(CodeSigningApprovalMode).map((mode) => (- <SelectItem key={mode} value={mode}>- {APPROVAL_MODE_LABELS[mode]}- </SelectItem>- ))}- </Select>+ <Input+ {...field}+ value={field.value || ""}+ placeholder="e.g., 1h"+ onChange={(e) => {+ if (!e.target.value || e.target.value === "") {+ field.onChange(undefined);+ return;+ }+ field.onChange(e.target.value);+ }}+ /></FormControl>)}/>- {approvalMode === CodeSigningApprovalMode.TimeWindow && (- <Controller- control={control}- name="constraints.maxWindowDuration"- render={({ field, fieldState: { error } }) => (- <FormControl- label="Max Window Duration"- isError={Boolean(error)}- errorText={error?.message}- helperText="Maximum signing window duration (e.g., 1h, 1d)"- >- <Input- {...field}- value={field.value || ""}- placeholder="e.g., 1h"- onChange={(e) => {- if (!e.target.value || e.target.value === "") {- field.onChange(undefined);- return;- }- field.onChange(e.target.value);- }}- />- </FormControl>- )}- />- )}-- {approvalMode === CodeSigningApprovalMode.NSignings && (- <Controller- control={control}- name="constraints.maxSignings"- render={({ field, fieldState: { error } }) => (- <FormControl- label="Max Signings"- isError={Boolean(error)}- errorText={error?.message}- helperText="Maximum number of signings per approved request"- >- <Input- {...field}- type="number"- value={field.value ?? ""}- placeholder="e.g., 10"- onChange={(e) => {- if (!e.target.value || e.target.value === "") {- field.onChange(undefined);- return;- }- field.onChange(Number(e.target.value));- }}- />- </FormControl>- )}- />- )}+ <Controller+ control={control}+ name="constraints.maxSignings"+ render={({ field, fieldState: { error } }) => (+ <FormControl+ label="Max Signings"+ isError={Boolean(error)}+ errorText={error?.message}+ helperText="Maximum number of signings per approved request. Leave empty for unlimited within the time window."+ >+ <Input+ {...field}+ type="number"+ value={field.value ?? ""}+ placeholder="e.g., 10"+ onChange={(e) => {+ if (!e.target.value || e.target.value === "") {+ field.onChange(undefined);+ return;+ }+ field.onChange(Number(e.target.value));+ }}+ />+ </FormControl>+ )}+ /><Controllercontrol={control}diff --git a/frontend/src/pages/cert-manager/ApprovalsPage/components/CodeSigningPolicyTab/components/CodeSigningPolicySteps/CodeSigningPolicyReviewStep.tsx b/frontend/src/pages/cert-manager/ApprovalsPage/components/CodeSigningPolicyTab/components/CodeSigningPolicySteps/CodeSigningPolicyReviewStep.tsxindex d79c67ee70..5fb9dda6fc 100644--- a/frontend/src/pages/cert-manager/ApprovalsPage/components/CodeSigningPolicyTab/components/CodeSigningPolicySteps/CodeSigningPolicyReviewStep.tsx+++ b/frontend/src/pages/cert-manager/ApprovalsPage/components/CodeSigningPolicyTab/components/CodeSigningPolicySteps/CodeSigningPolicyReviewStep.tsx@@ -7,18 +7,21 @@ import { getMemberLabel } from "@app/helpers/members";import { useGetWorkspaceUsers, useListWorkspaceGroups } from "@app/hooks/api";import { ApproverType } from "@app/hooks/api/approvalPolicies";-import { CodeSigningApprovalMode, TCodeSigningPolicyForm } from "../CodeSigningPolicySchema";+import { TCodeSigningPolicyForm } from "../CodeSigningPolicySchema";-const APPROVAL_MODE_LABELS: Record<CodeSigningApprovalMode, string> = {- [CodeSigningApprovalMode.Manual]: "One time use",- [CodeSigningApprovalMode.TimeWindow]: "Time Window",- [CodeSigningApprovalMode.NSignings]: "N Signings"+const deriveApprovalModeLabel = (constraints: TCodeSigningPolicyForm["constraints"]): string => {+ const hasTime = Boolean(constraints.maxWindowDuration);+ const hasCount = Boolean(constraints.maxSignings);+ if (hasTime && hasCount) return "Combined";+ if (hasTime) return "Time-based";+ if (hasCount) return "Count-based";+ return "Manual (single-use)";};const ReviewField = ({ label, value }: { label: string; value: string | number }) => (- <div className="flex gap-x-8">- <span className="min-w-[140px] text-sm text-mineshaft-400">{label}</span>- <span className="text-sm text-mineshaft-200">{value}</span>+ <div className="flex items-baseline gap-x-4">+ <span className="w-[180px] shrink-0 text-sm text-mineshaft-400">{label}</span>+ <span className="text-sm font-medium text-mineshaft-200">{value}</span></div>);@@ -56,18 +59,13 @@ export const CodeSigningPolicyReviewStep = () => {<div className="grid grid-cols-2 gap-2"><ReviewField label="Policy Name" value={name || "Not set"} /><ReviewField label="Max. Request TTL" value={maxRequestTtl || "Not set"} />- <ReviewField- label="Approval Mode"- value={APPROVAL_MODE_LABELS[constraints.approvalMode] || "Not set"}- />- {constraints.approvalMode === CodeSigningApprovalMode.TimeWindow &&- constraints.maxWindowDuration && (- <ReviewField label="Max Window Duration" value={constraints.maxWindowDuration} />- )}- {constraints.approvalMode === CodeSigningApprovalMode.NSignings &&- constraints.maxSignings && (- <ReviewField label="Max Signings" value={constraints.maxSignings} />- )}+ <ReviewField label="Approval Mode" value={deriveApprovalModeLabel(constraints)} />+ {constraints.maxWindowDuration && (+ <ReviewField label="Max Window Duration" value={constraints.maxWindowDuration} />+ )}+ {constraints.maxSignings && (+ <ReviewField label="Max Signings" value={constraints.maxSignings} />+ )}<ReviewFieldlabel="Machine Identity Bypass"value={bypassForMachineIdentities ? "Enabled" : "Disabled"}diff --git a/frontend/src/pages/cert-manager/ApprovalsPage/components/CodeSigningRequestsTab/CodeSigningRequestsTab.tsx b/frontend/src/pages/cert-manager/ApprovalsPage/components/CodeSigningRequestsTab/CodeSigningRequestsTab.tsxindex ee62e712ac..d33658b04a 100644--- a/frontend/src/pages/cert-manager/ApprovalsPage/components/CodeSigningRequestsTab/CodeSigningRequestsTab.tsx+++ b/frontend/src/pages/cert-manager/ApprovalsPage/components/CodeSigningRequestsTab/CodeSigningRequestsTab.tsx@@ -105,7 +105,7 @@ export const CodeSigningRequestsTab = () => {const { data: requests = [], isPending: isRequestsLoading } = useQuery(approvalRequestQuery.list({- policyType: ApprovalPolicyType.CertManagerCodeSigning,+ policyType: ApprovalPolicyType.CertCodeSigning,projectId}));@@ -145,11 +145,9 @@ export const CodeSigningRequestsTab = () => {<div className="mb-4 flex items-start justify-between"><div><div className="flex items-center gap-x-2">- <p className="text-xl font-medium text-mineshaft-100">Code Signing Approval Requests</p>+ <p className="text-xl font-medium text-mineshaft-100">Approval Requests</p></div>- <p className="text-sm text-bunker-300">- Review and manage code signing approval requests- </p>+ <p className="text-sm text-bunker-300">Review and manage approval requests</p></div><Button colorSchema="secondary" size="sm" onClick={() => setIsRequestModalOpen(true)}>Request Signing Access@@ -259,7 +257,7 @@ export const CodeSigningRequestsTab = () => {value={search}onChange={(e) => setSearch(e.target.value)}leftIcon={<FontAwesomeIcon icon={faMagnifyingGlass} />}- placeholder="Search code signing requests..."+ placeholder="Search requests..."/></div><TableContainer>@@ -278,10 +276,7 @@ export const CodeSigningRequestsTab = () => {{!isRequestsLoading && paginatedRequests.length === 0 && (<Tr><Td colSpan={5}>- <EmptyState- title="No code signing approval requests found"- icon={faFileCircleQuestion}- />+ <EmptyState title="No approval requests found" icon={faFileCircleQuestion} /></Td></Tr>)}@@ -301,7 +296,7 @@ export const CodeSigningRequestsTab = () => {approvalRequestId: request.id},search: {- policyType: ApprovalPolicyType.CertManagerCodeSigning+ policyType: ApprovalPolicyType.CertCodeSigning}})}diff --git a/frontend/src/pages/cert-manager/ApprovalsPage/components/CodeSigningRequestsTab/RequestSigningAccessModal.tsx b/frontend/src/pages/cert-manager/ApprovalsPage/components/CodeSigningRequestsTab/RequestSigningAccessModal.tsxindex 114e3fac70..d1ce0c2867 100644--- a/frontend/src/pages/cert-manager/ApprovalsPage/components/CodeSigningRequestsTab/RequestSigningAccessModal.tsx+++ b/frontend/src/pages/cert-manager/ApprovalsPage/components/CodeSigningRequestsTab/RequestSigningAccessModal.tsx@@ -20,7 +20,6 @@ import { useProject } from "@app/context";import {approvalPolicyQuery,ApprovalPolicyType,- CodeSigningApprovalMode,TApprovalPolicy} from "@app/hooks/api/approvalPolicies";import { useCreateApprovalRequest } from "@app/hooks/api/approvalRequests/mutations";@@ -92,12 +91,15 @@ const Content = ({ onOpenChange }: Props) => {const { data: policies = [] } = useQuery(approvalPolicyQuery.list({- policyType: ApprovalPolicyType.CertManagerCodeSigning,+ policyType: ApprovalPolicyType.CertCodeSigning,projectId}));- const signers = signersData?.signers ?? [];+ const signers = useMemo(+ () => (signersData?.signers ?? []).filter((s) => s.approvalPolicyId),+ [signersData?.signers]+ );const policyMap = useMemo(() => {const map = new Map<string, TApprovalPolicy>();@@ -136,61 +138,62 @@ const Content = ({ onOpenChange }: Props) => {);const selectedPolicy = useMemo(- () => (selectedSigner ? policyMap.get(selectedSigner.approvalPolicyId) : undefined),+ () =>+ selectedSigner?.approvalPolicyId ? policyMap.get(selectedSigner.approvalPolicyId) : undefined,[selectedSigner, policyMap]);- const approvalMode = useMemo(() => {- if (!selectedPolicy) return undefined;+ const { hasTimeConstraint, hasCountConstraint } = useMemo(() => {+ if (!selectedPolicy) return { hasTimeConstraint: false, hasCountConstraint: false };const constraints = selectedPolicy.constraints?.constraints as- | { approvalMode?: CodeSigningApprovalMode }+ | { maxWindowDuration?: string; maxSignings?: number }| undefined;- return constraints?.approvalMode ?? CodeSigningApprovalMode.Manual;+ return {+ hasTimeConstraint: Boolean(constraints?.maxWindowDuration),+ hasCountConstraint: Boolean(constraints?.maxSignings)+ };}, [selectedPolicy]);useEffect(() => {- if (approvalMode === CodeSigningApprovalMode.TimeWindow) {- setValue("requestedSignings", undefined);+ if (hasTimeConstraint) {setValue("windowStart", getDefaultWindowStart());setValue("windowEnd", getDefaultWindowEnd());- } else if (approvalMode === CodeSigningApprovalMode.NSignings) {+ } else {setValue("windowStart", undefined);setValue("windowEnd", undefined);+ }++ if (hasCountConstraint) {+ setValue("requestedSignings", 5);} else {setValue("requestedSignings", undefined);- setValue("windowStart", undefined);- setValue("windowEnd", undefined);}+trigger();- }, [approvalMode, setValue, trigger]);+ }, [hasTimeConstraint, hasCountConstraint, setValue, trigger]);const onSubmit = async (formData: FormData) => {- if (!selectedSigner || !selectedPolicy || !approvalMode) return;+ if (!selectedSigner || !selectedPolicy) return;let requestedWindowStart: string | undefined;let requestedWindowEnd: string | undefined;- if (- approvalMode === CodeSigningApprovalMode.TimeWindow &&- formData.windowStart &&- formData.windowEnd- ) {+ if (hasTimeConstraint && formData.windowStart && formData.windowEnd) {requestedWindowStart = new Date(formData.windowStart).toISOString();requestedWindowEnd = new Date(formData.windowEnd).toISOString();}await createApprovalRequest({- policyType: ApprovalPolicyType.CertManagerCodeSigning,+ policyType: ApprovalPolicyType.CertCodeSigning,projectId,justification: formData.justification || null,requestData: {signerId: selectedSigner.id,- approvalPolicyId: selectedSigner.approvalPolicyId,+ approvalPolicyId: selectedSigner.approvalPolicyId!,signerName: selectedSigner.name,- approvalMode,...(requestedWindowStart && { requestedWindowStart }),...(requestedWindowEnd && { requestedWindowEnd }),- ...(approvalMode === CodeSigningApprovalMode.NSignings &&+ ...(hasCountConstraint &&formData.requestedSignings != null && { requestedSignings: formData.requestedSignings })}});@@ -231,8 +234,7 @@ const Content = ({ onOpenChange }: Props) => {</FormControl>)}/>- {/* Mode-specific fields are shown below based on the policy's approval mode */}- {approvalMode === CodeSigningApprovalMode.TimeWindow && (+ {hasTimeConstraint && (<div className="grid grid-cols-2 gap-4"><Controllername="windowStart"@@ -262,7 +264,7 @@ const Content = ({ onOpenChange }: Props) => {/></div>)}- {approvalMode === CodeSigningApprovalMode.NSignings && (+ {hasCountConstraint && (<Controllername="requestedSignings"control={control}diff --git a/frontend/src/pages/cert-manager/CodeSigningPage/CodeSigningPage.tsx b/frontend/src/pages/cert-manager/CodeSigningPage/CodeSigningPage.tsxindex a1a58d2e91..81029c7443 100644--- a/frontend/src/pages/cert-manager/CodeSigningPage/CodeSigningPage.tsx+++ b/frontend/src/pages/cert-manager/CodeSigningPage/CodeSigningPage.tsx@@ -39,7 +39,7 @@ export const CodeSigningPage = () => {<PageHeaderscope={ProjectType.CertificateManager}title="Code Signing"- description="Manage code signing identities and control who can sign artifacts."+ description="Manage signers and control who can sign artifacts."/><Tabsdiff --git a/frontend/src/pages/cert-manager/CodeSigningPage/components/CreateSignerModal.tsx b/frontend/src/pages/cert-manager/CodeSigningPage/components/CreateSignerModal.tsxindex ebe317361e..657c577832 100644--- a/frontend/src/pages/cert-manager/CodeSigningPage/components/CreateSignerModal.tsx+++ b/frontend/src/pages/cert-manager/CodeSigningPage/components/CreateSignerModal.tsx@@ -12,12 +12,14 @@ import {Modal,ModalContent,Select,+ SelectClear,SelectItem,TextArea} from "@app/components/v2";import { approvalPolicyQuery, ApprovalPolicyType } from "@app/hooks/api/approvalPolicies";import { useListWorkspaceCertificates } from "@app/hooks/api/projects";import { useCreateSigner } from "@app/hooks/api/signers";+import { slugSchema } from "@app/lib/schemas";type Props = {isOpen: boolean;@@ -26,15 +28,10 @@ type Props = {};const formSchema = z.object({- name: z- .string()- .trim()- .min(1, "Name is required")- .max(64)- .regex(/^[a-z0-9-]+$/, "Name must contain only lowercase letters, numbers, and hyphens"),+ name: slugSchema({ min: 1, max: 64, field: "Name" }),description: z.string().trim().max(256).optional(),certificateId: z.string().uuid("Certificate is required"),- approvalPolicyId: z.string().uuid("Approval policy is required")+ approvalPolicyId: z.string().uuid().optional().or(z.literal(""))});type FormData = z.infer<typeof formSchema>;@@ -57,7 +54,7 @@ export const CreateSignerModal = ({ isOpen, onOpenChange, projectId }: Props) =>const { data: policies = [], isPending: isPoliciesLoading } = useQuery(approvalPolicyQuery.list({- policyType: ApprovalPolicyType.CertManagerCodeSigning,+ policyType: ApprovalPolicyType.CertCodeSigning,projectId}));@@ -97,7 +94,10 @@ export const CreateSignerModal = ({ isOpen, onOpenChange, projectId }: Props) =>const onSubmit = async (data: FormData) => {await createSigner.mutateAsync({projectId,- ...data+ name: data.name,+ description: data.description,+ certificateId: data.certificateId,+ ...(data.approvalPolicyId ? { approvalPolicyId: data.approvalPolicyId } : {})});handleOpenChange(false);};@@ -143,7 +143,7 @@ export const CreateSignerModal = ({ isOpen, onOpenChange, projectId }: Props) =>field.onChange(option?.value ?? "");}}placeholder="Search by common name or SAN..."- noOptionsMessage={() => "No certificates with codeSigning EKU found"}+ noOptionsMessage={() => "No code signing certificates found"}maxMenuHeight={200}/></FormControl>@@ -157,15 +157,18 @@ export const CreateSignerModal = ({ isOpen, onOpenChange, projectId }: Props) =>label="Approval Policy"isError={Boolean(error)}errorText={error?.message}- helperText="Must be a code signing approval policy"+ helperText="Optional. Without a policy, signing is allowed without approval."><Selectvalue={field.value}onValueChange={field.onChange}className="w-full"isLoading={isPoliciesLoading}- placeholder="Select an approval policy..."+ placeholder="None (no approval required)">+ <SelectClear selectValue={field.value ?? ""} onClear={() => field.onChange("")}>+ None (no approval required)+ </SelectClear>{policies.map((policy) => (<SelectItem key={policy.id} value={policy.id}>{policy.name}diff --git a/frontend/src/pages/cert-manager/CodeSigningPage/components/SignersTable.tsx b/frontend/src/pages/cert-manager/CodeSigningPage/components/SignersTable.tsxindex 06e4683c05..9eb5ee7f8d 100644--- a/frontend/src/pages/cert-manager/CodeSigningPage/components/SignersTable.tsx+++ b/frontend/src/pages/cert-manager/CodeSigningPage/components/SignersTable.tsx@@ -6,6 +6,7 @@ import {CheckCircleIcon,ClipboardCopyIcon,MoreHorizontalIcon,+ PencilIcon,PlusIcon,SearchIcon} from "lucide-react";@@ -50,12 +51,15 @@ import {getSignerStatusBadgeVariant,SignerStatus,signerStatusLabels,+ TSigner,useDeleteSigner,useListSigners,useUpdateSigner} from "@app/hooks/api/signers";import { useDebounce } from "@app/hooks/useDebounce";+import { EditSignerModal } from "../../SignerDetailPage/components/EditSignerModal";+type Props = {projectId: string;onCreateSigner: () => void;@@ -71,6 +75,7 @@ export const SignersTable = ({ projectId, onCreateSigner }: Props) => {const [search, setSearch] = useState("");const [debouncedSearch] = useDebounce(search, 300);const [deleteSignerId, setDeleteSignerId] = useState<string | null>(null);+ const [editSigner, setEditSigner] = useState<TSigner | null>(null);const { data, isLoading } = useListSigners({projectId,@@ -100,7 +105,7 @@ export const SignersTable = ({ projectId, onCreateSigner }: Props) => {<DocumentationLinkBadge href="https://infisical.com/docs/documentation/platform/pki/code-signing" /></UnstableCardTitle><UnstableCardDescription>- Manage code signing identities and control who can sign artifacts.+ Manage signers and control who can sign artifacts.</UnstableCardDescription><UnstableCardAction><ProjectPermissionCan@@ -199,6 +204,20 @@ export const SignersTable = ({ projectId, onCreateSigner }: Props) => {<ClipboardCopyIcon />Copy ID</UnstableDropdownMenuItem>+ <ProjectPermissionCan+ I={ProjectPermissionCodeSigningActions.Edit}+ a={ProjectPermissionSub.CodeSigners}+ >+ {(isAllowed) => (+ <UnstableDropdownMenuItem+ isDisabled={!isAllowed}+ onClick={() => setEditSigner(signer)}+ >+ <PencilIcon />+ Edit Signer+ </UnstableDropdownMenuItem>+ )}+ </ProjectPermissionCan><ProjectPermissionCanI={ProjectPermissionCodeSigningActions.Edit}a={ProjectPermissionSub.CodeSigners}@@ -278,6 +297,16 @@ export const SignersTable = ({ projectId, onCreateSigner }: Props) => {}}onDeleteApproved={handleDeleteConfirm}/>+ {editSigner && (+ <EditSignerModal+ isOpen={Boolean(editSigner)}+ onOpenChange={(open) => {+ if (!open) setEditSigner(null);+ }}+ signer={editSigner}+ projectId={projectId}+ />+ )}</>);};diff --git a/frontend/src/pages/cert-manager/SignerDetailPage/SignerDetailPage.tsx b/frontend/src/pages/cert-manager/SignerDetailPage/SignerDetailPage.tsxindex 31064e9a96..03fa20d159 100644--- a/frontend/src/pages/cert-manager/SignerDetailPage/SignerDetailPage.tsx+++ b/frontend/src/pages/cert-manager/SignerDetailPage/SignerDetailPage.tsx@@ -1,3 +1,4 @@+import { useState } from "react";import { Helmet } from "react-helmet";import { useTranslation } from "react-i18next";import { Link, useParams } from "@tanstack/react-router";@@ -5,6 +6,7 @@ import { ChevronLeftIcon } from "lucide-react";import { EmptyState, PageHeader } from "@app/components/v2";import { Badge, UnstablePageLoader } from "@app/components/v3";+import { ROUTE_PATHS } from "@app/const/routes";import { useOrganization, useProject } from "@app/context";import { ProjectType } from "@app/hooks/api/projects/types";import {@@ -13,6 +15,7 @@ import {useGetSigner} from "@app/hooks/api/signers";+import { EditSignerModal } from "./components/EditSignerModal";import { SignerOverviewSection } from "./components/SignerOverviewSection";import { SigningOperationsTable } from "./components/SigningOperationsTable";@@ -20,8 +23,9 @@ export const SignerDetailPage = () => {const { t } = useTranslation();const { currentOrg } = useOrganization();const { currentProject } = useProject();+ const [isEditOpen, setIsEditOpen] = useState(false);const { signerId } = useParams({- from: "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId/_cert-manager-layout/code-signing/$signerId"+ from: ROUTE_PATHS.CertManager.SignerDetailByIDPage.id});const { data: signer, isLoading } = useGetSigner(signerId);@@ -64,13 +68,23 @@ export const SignerDetailPage = () => {/><div className="flex flex-col gap-5 lg:flex-row"><div className="w-full lg:max-w-[24rem]">- <SignerOverviewSection signer={signer} projectId={currentProject.id} />+ <SignerOverviewSection+ signer={signer}+ projectId={currentProject.id}+ onEdit={() => setIsEditOpen(true)}+ /></div><div className="flex flex-1 flex-col gap-5"><SigningOperationsTable signerId={signerId} projectId={currentProject.id} /></div></div></div>+ <EditSignerModal+ isOpen={isEditOpen}+ onOpenChange={setIsEditOpen}+ signer={signer}+ projectId={currentProject.id}+ /></div>);};diff --git a/frontend/src/pages/cert-manager/SignerDetailPage/components/EditSignerModal.tsx b/frontend/src/pages/cert-manager/SignerDetailPage/components/EditSignerModal.tsxnew file mode 100644index 0000000000..32eb2303c0--- /dev/null+++ b/frontend/src/pages/cert-manager/SignerDetailPage/components/EditSignerModal.tsx@@ -0,0 +1,144 @@+import { Controller, useForm } from "react-hook-form";+import { zodResolver } from "@hookform/resolvers/zod";+import { useQuery } from "@tanstack/react-query";+import { z } from "zod";++import {+ Button,+ FormControl,+ Input,+ Modal,+ ModalContent,+ Select,+ SelectClear,+ SelectItem,+ TextArea+} from "@app/components/v2";+import { approvalPolicyQuery, ApprovalPolicyType } from "@app/hooks/api/approvalPolicies";+import { TSigner, useUpdateSigner } from "@app/hooks/api/signers";+import { slugSchema } from "@app/lib/schemas";++type Props = {+ isOpen: boolean;+ onOpenChange: (open: boolean) => void;+ signer: TSigner;+ projectId: string;+};++const formSchema = z.object({+ name: slugSchema({ min: 1, max: 64, field: "Name" }),+ description: z.string().trim().max(256).optional().or(z.literal("")),+ approvalPolicyId: z.string().uuid().optional().or(z.literal(""))+});++type FormData = z.infer<typeof formSchema>;++export const EditSignerModal = ({ isOpen, onOpenChange, signer, projectId }: Props) => {+ const updateSigner = useUpdateSigner();++ const { data: policies = [], isPending: isPoliciesLoading } = useQuery(+ approvalPolicyQuery.list({+ policyType: ApprovalPolicyType.CertCodeSigning,+ projectId+ })+ );++ const {+ control,+ handleSubmit,+ reset,+ formState: { isSubmitting }+ } = useForm<FormData>({+ resolver: zodResolver(formSchema),+ defaultValues: {+ name: signer.name,+ description: signer.description ?? "",+ approvalPolicyId: signer.approvalPolicyId ?? ""+ }+ });++ const handleOpenChange = (open: boolean) => {+ if (!open) {+ reset({+ name: signer.name,+ description: signer.description ?? "",+ approvalPolicyId: signer.approvalPolicyId ?? ""+ });+ }+ onOpenChange(open);+ };++ const onSubmit = async (data: FormData) => {+ await updateSigner.mutateAsync({+ signerId: signer.id,+ name: data.name,+ description: data.description || null,+ approvalPolicyId: data.approvalPolicyId || null+ });+ handleOpenChange(false);+ };++ return (+ <Modal isOpen={isOpen} onOpenChange={handleOpenChange}>+ <ModalContent title="Edit Signer">+ <form onSubmit={handleSubmit(onSubmit)}>+ <Controller+ name="name"+ control={control}+ render={({ field, fieldState: { error } }) => (+ <FormControl label="Name" isError={Boolean(error)} errorText={error?.message}>+ <Input {...field} placeholder="my-code-signer" />+ </FormControl>+ )}+ />+ <Controller+ name="description"+ control={control}+ render={({ field, fieldState: { error } }) => (+ <FormControl label="Description" isError={Boolean(error)} errorText={error?.message}>+ <TextArea {...field} placeholder="Optional description" rows={2} />+ </FormControl>+ )}+ />+ <Controller+ name="approvalPolicyId"+ control={control}+ render={({ field, fieldState: { error } }) => (+ <FormControl+ label="Approval Policy"+ isError={Boolean(error)}+ errorText={error?.message}+ helperText="Optional. Without a policy, signing is allowed without approval."+ >+ <Select+ value={field.value}+ onValueChange={field.onChange}+ className="w-full"+ isLoading={isPoliciesLoading}+ placeholder="None (no approval required)"+ >+ <SelectClear selectValue={field.value ?? ""} onClear={() => field.onChange("")}>+ None (no approval required)+ </SelectClear>+ {policies.map((policy) => (+ <SelectItem key={policy.id} value={policy.id}>+ {policy.name}+ </SelectItem>+ ))}+ </Select>+ </FormControl>+ )}+ />+ <div className="mt-4 flex justify-end gap-2">+ <Button variant="outline_bg" onClick={() => handleOpenChange(false)}>+ Cancel+ </Button>+ <Button type="submit" isLoading={isSubmitting}>+ Save+ </Button>+ </div>+ </form>+ </ModalContent>+ </Modal>+ );+};diff --git a/frontend/src/pages/cert-manager/SignerDetailPage/components/SignerOverviewSection.tsx b/frontend/src/pages/cert-manager/SignerDetailPage/components/SignerOverviewSection.tsxindex 8ebea4256d..4c2789d88f 100644--- a/frontend/src/pages/cert-manager/SignerDetailPage/components/SignerOverviewSection.tsx+++ b/frontend/src/pages/cert-manager/SignerDetailPage/components/SignerOverviewSection.tsx@@ -1,7 +1,8 @@import { Link } from "@tanstack/react-router";import { format } from "date-fns";-import { CheckIcon, ClipboardListIcon, ExternalLinkIcon } from "lucide-react";+import { CheckIcon, ClipboardListIcon, ExternalLinkIcon, PencilIcon } from "lucide-react";+import { ProjectPermissionCan } from "@app/components/permissions";import { Tooltip } from "@app/components/v2";import {Badge,@@ -11,13 +12,18 @@ import {DetailLabel,DetailValue,UnstableCard,+ UnstableCardAction,UnstableCardContent,UnstableCardDescription,UnstableCardHeader,UnstableCardTitle,UnstableIconButton} from "@app/components/v3";-import { useOrganization } from "@app/context";+import {+ ProjectPermissionCodeSigningActions,+ ProjectPermissionSub,+ useOrganization+} from "@app/context";import { useTimedReset } from "@app/hooks";import {getSignerStatusBadgeVariant,@@ -29,6 +35,7 @@ import {type Props = {signer: TSigner;projectId: string;+ onEdit?: () => void;};const ALGORITHM_LABELS: Record<string, string> = {@@ -39,7 +46,7 @@ const ALGORITHM_LABELS: Record<string, string> = {ed448: "Ed448"};-export const SignerOverviewSection = ({ signer, projectId }: Props) => {+export const SignerOverviewSection = ({ signer, projectId, onEdit }: Props) => {const { currentOrg } = useOrganization();const { data: publicKeyData } = useGetSignerPublicKey(signer.id);// eslint-disable-next-line @typescript-eslint/naming-convention,@typescript-eslint/no-unused-vars@@ -57,6 +64,25 @@ export const SignerOverviewSection = ({ signer, projectId }: Props) => {<UnstableCardHeader className="border-b"><UnstableCardTitle>Signing Identity</UnstableCardTitle><UnstableCardDescription>Signer configuration and key details</UnstableCardDescription>+ {onEdit && (+ <UnstableCardAction>+ <ProjectPermissionCan+ I={ProjectPermissionCodeSigningActions.Edit}+ a={ProjectPermissionSub.CodeSigners}+ >+ {(isAllowed) => (+ <UnstableIconButton+ isDisabled={!isAllowed}+ onClick={onEdit}+ size="xs"+ variant="outline"+ >+ <PencilIcon />+ </UnstableIconButton>+ )}+ </ProjectPermissionCan>+ </UnstableCardAction>+ )}</UnstableCardHeader><UnstableCardContent><DetailGroup>@@ -97,7 +123,21 @@ export const SignerOverviewSection = ({ signer, projectId }: Props) => {<Detail><DetailLabel>Approval Policy</DetailLabel><DetailValue>- {signer.approvalPolicyName || <span className="text-muted">—</span>}+ {signer.approvalPolicyId && signer.approvalPolicyName ? (+ <Link+ to="/organizations/$orgId/projects/cert-manager/$projectId/approvals"+ params={{+ orgId: currentOrg.id,+ projectId+ }}+ className="flex items-center gap-1 text-primary hover:underline"+ >+ {signer.approvalPolicyName}+ <ExternalLinkIcon className="h-3 w-3" />+ </Link>+ ) : (+ <span className="text-muted">None</span>+ )}</DetailValue></Detail><Detail>diff --git a/frontend/src/pages/cert-manager/SignerDetailPage/components/SigningOperationsTable.tsx b/frontend/src/pages/cert-manager/SignerDetailPage/components/SigningOperationsTable.tsxindex 816894f4eb..abbe52ac72 100644--- a/frontend/src/pages/cert-manager/SignerDetailPage/components/SigningOperationsTable.tsx+++ b/frontend/src/pages/cert-manager/SignerDetailPage/components/SigningOperationsTable.tsx@@ -140,7 +140,7 @@ export const SigningOperationsTable = ({ signerId, projectId }: Props) => {<UnstableCard><UnstableCardHeader><UnstableCardTitle>Signing History</UnstableCardTitle>- <UnstableCardDescription>Audit trail of signing operations</UnstableCardDescription>+ <UnstableCardDescription>Trail of signing operations</UnstableCardDescription></UnstableCardHeader><UnstableCardContent><UnstableTable>diff --git a/frontend/src/pages/project/RoleDetailsBySlugPage/components/ProjectRoleModifySection.utils.tsx b/frontend/src/pages/project/RoleDetailsBySlugPage/components/ProjectRoleModifySection.utils.tsxindex 09daaf12d2..da0549a13b 100644--- a/frontend/src/pages/project/RoleDetailsBySlugPage/components/ProjectRoleModifySection.utils.tsx+++ b/frontend/src/pages/project/RoleDetailsBySlugPage/components/ProjectRoleModifySection.utils.tsx@@ -2867,8 +2867,8 @@ export const PROJECT_PERMISSION_OBJECT: TProjectPermissionObject = {]},[ProjectPermissionSub.CodeSigners]: {- title: "Code Signing",- description: "Manage code signing identities and operations",+ title: "PKI Code Signing",+ description: "Manage signers and signing operations",actions: [{ label: "Read", value: "read", description: "View code signers and signing operations" },{ label: "Create", value: "create", description: "Create new code signers" },