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
feat(pki): adds automated intermediate CA signing and auto-renewal using AD CS (#5738)
Saif Ur Rahman61a3b4acdd90
diff --git a/backend/src/ee/services/audit-log/audit-log-types.ts b/backend/src/ee/services/audit-log/audit-log-types.tsindex 9944150db2..a8f57fda40 100644--- a/backend/src/ee/services/audit-log/audit-log-types.ts+++ b/backend/src/ee/services/audit-log/audit-log-types.ts@@ -345,6 +345,7 @@ export enum EventType {GET_CA_CRLS = "get-certificate-authority-crls",GENERATE_CA_CERTIFICATE = "generate-ca-certificate",INSTALL_CA_CERT_VENAFI = "install-ca-cert-venafi",+ INSTALL_CA_CERT_ADCS = "install-ca-cert-adcs",CREATE_CA_SIGNING_CONFIG = "create-ca-signing-config",GET_CA_SIGNING_CONFIG = "get-ca-signing-config",UPDATE_CA_SIGNING_CONFIG = "update-ca-signing-config",@@ -2591,6 +2592,14 @@ interface InstallCaCertVenafi {};}+interface InstallCaCertAdcs {+ type: EventType.INSTALL_CA_CERT_ADCS;+ metadata: {+ caId: string;+ dn: string;+ };+}+interface CreateCaSigningConfig {type: EventType.CREATE_CA_SIGNING_CONFIG;metadata: {@@ -5617,6 +5626,7 @@ export type Event =| GetCaCrls| GenerateCaCertificate| InstallCaCertVenafi+ | InstallCaCertAdcs| CreateCaSigningConfig| GetCaSigningConfig| UpdateCaSigningConfigdiff --git a/backend/src/lib/api-docs/constants.ts b/backend/src/lib/api-docs/constants.tsindex b6d0799deb..8e556ff601 100644--- a/backend/src/lib/api-docs/constants.ts+++ b/backend/src/lib/api-docs/constants.ts@@ -2108,6 +2108,9 @@ export const CERTIFICATE_AUTHORITIES = {INSTALL_CERT_VENAFI: {caId: "The ID of the CA to install the certificate for via Venafi."},+ INSTALL_CERT_ADCS: {+ caId: "The ID of the CA to install the certificate for via Azure AD CS."+ },CREATE_SIGNING_CONFIG: {caId: "The ID of the CA to create a signing configuration for."},diff --git a/backend/src/queue/queue-service.ts b/backend/src/queue/queue-service.tsindex 7d1e6b74d9..cc6c6ca41b 100644--- a/backend/src/queue/queue-service.ts+++ b/backend/src/queue/queue-service.ts@@ -183,6 +183,7 @@ export enum QueueJobs {PamDiscoveryScheduledScan = "pam-discovery-scheduled-scan",CaDailyAutoRenewal = "ca-daily-auto-renewal",CaVenafiInstall = "ca-venafi-install-job",+ CaAdcsInstall = "ca-adcs-install-job",CertificateCleanup = "certificate-cleanup-job"}@@ -547,6 +548,10 @@ export type TQueueJobTypes = {| {name: QueueJobs.CaVenafiInstall;payload: { caId: string; maxPathLength?: number };+ }+ | {+ name: QueueJobs.CaAdcsInstall;+ payload: { caId: string; maxPathLength?: number };};[QueueName.CertificateCleanup]: {name: QueueJobs.CertificateCleanup;diff --git a/backend/src/server/routes/v1/app-connection-routers/azure-adcs-connection-router.ts b/backend/src/server/routes/v1/app-connection-routers/azure-adcs-connection-router.tsindex cd4d4d1fde..13eca62ae8 100644--- a/backend/src/server/routes/v1/app-connection-routers/azure-adcs-connection-router.ts+++ b/backend/src/server/routes/v1/app-connection-routers/azure-adcs-connection-router.ts@@ -1,9 +1,14 @@+import z from "zod";++import { readLimit } from "@app/server/config/rateLimiter";+import { verifyAuth } from "@app/server/plugins/auth/verify-auth";import { AppConnection } from "@app/services/app-connection/app-connection-enums";import {CreateAzureADCSConnectionSchema,SanitizedAzureADCSConnectionSchema,UpdateAzureADCSConnectionSchema} from "@app/services/app-connection/azure-adcs";+import { AuthMode } from "@app/services/auth/auth-type";import { registerAppConnectionEndpoints } from "./app-connection-endpoints";@@ -15,4 +20,30 @@ export const registerAzureADCSConnectionRouter = async (server: FastifyZodProvidcreateSchema: CreateAzureADCSConnectionSchema,updateSchema: UpdateAzureADCSConnectionSchema});++ server.route({+ method: "GET",+ url: `/:connectionId/adcs-templates`,+ config: {+ rateLimit: readLimit+ },+ schema: {+ operationId: "listAdcsTemplates",+ params: z.object({+ connectionId: z.string().uuid()+ }),+ response: {+ 200: z.object({+ templates: z.string().array()+ })+ }+ },+ onRequest: verifyAuth([AuthMode.JWT, AuthMode.IDENTITY_ACCESS_TOKEN]),+ handler: async (req) => {+ const { connectionId } = req.params;++ const templates = await server.services.appConnection.azureAdcs.listTemplates(connectionId, req.permission);+ return { templates };+ }+ });};diff --git a/backend/src/server/routes/v1/certificate-authority-routers/internal-certificate-authority-router.ts b/backend/src/server/routes/v1/certificate-authority-routers/internal-certificate-authority-router.tsindex b933ed993d..397034eed1 100644--- a/backend/src/server/routes/v1/certificate-authority-routers/internal-certificate-authority-router.ts+++ b/backend/src/server/routes/v1/certificate-authority-routers/internal-certificate-authority-router.ts@@ -7,6 +7,11 @@ import { readLimit, writeLimit } from "@app/server/config/rateLimiter";import { verifyAuth } from "@app/server/plugins/auth/verify-auth";import { AuthMode } from "@app/services/auth/auth-type";import { CaSigningConfigType } from "@app/services/certificate-authority/ca-signing-config/ca-signing-config-enums";+import {+ AzureAdCsDestinationConfigSchema,+ DestinationConfigSchema,+ VenafiDestinationConfigSchema+} from "@app/services/certificate-authority/ca-signing-config/ca-signing-config-types";import { CaRenewalType, CaType } from "@app/services/certificate-authority/certificate-authority-enums";import { validateCaDateField } from "@app/services/certificate-authority/certificate-authority-validators";import {@@ -671,6 +676,60 @@ export const registerInternalCertificateAuthorityRouter = async (server: Fastify}});+ server.route({+ method: "POST",+ url: "/:caId/install-certificate-adcs",+ config: {+ rateLimit: writeLimit+ },+ onRequest: verifyAuth([AuthMode.JWT, AuthMode.IDENTITY_ACCESS_TOKEN]),+ schema: {+ hide: false,+ operationId: "installCaCertificateAdcs",+ tags: [ApiDocsTags.PkiCertificateAuthorities],+ description: "Install a CA certificate via Azure AD CS",+ params: z.object({+ caId: z.string().trim().describe(CERTIFICATE_AUTHORITIES.INSTALL_CERT_ADCS.caId)+ }),+ body: z.object({+ maxPathLength: z.number().min(-1).default(-1)+ }),+ response: {+ 202: z.object({+ message: z.string(),+ caId: z.string()+ })+ }+ },+ handler: async (req, reply) => {+ const { ca } = await server.services.caSigningConfig.installCertificateAzureAdCs({+ caId: req.params.caId,+ maxPathLength: req.body.maxPathLength,+ actor: req.permission.type,+ actorId: req.permission.id,+ actorAuthMethod: req.permission.authMethod,+ actorOrgId: req.permission.orgId+ });++ await server.services.auditLog.createAuditLog({+ ...req.auditLogInfo,+ projectId: ca.projectId,+ event: {+ type: EventType.INSTALL_CA_CERT_ADCS,+ metadata: {+ caId: ca.id,+ dn: ca.dn+ }+ }+ });++ return reply.status(202).send({+ message: "Certificate installation queued",+ caId: req.params.caId+ });+ }+ });+server.route({method: "POST",url: "/:caId/signing-config",@@ -686,18 +745,25 @@ export const registerInternalCertificateAuthorityRouter = async (server: Fastifyparams: z.object({caId: z.string().trim().describe(CERTIFICATE_AUTHORITIES.CREATE_SIGNING_CONFIG.caId)}),- body: z.object({- type: z.nativeEnum(CaSigningConfigType),- parentCaId: z.string().uuid().optional(),- appConnectionId: z.string().uuid().optional(),- destinationConfig: z- .object({- applicationId: z.string().uuid(),- issuingTemplateId: z.string().uuid(),- validityPeriod: z.number().int().min(1).optional()- })- .optional()- }),+ body: z.discriminatedUnion("type", [+ z.object({+ type: z.literal(CaSigningConfigType.Internal),+ parentCaId: z.string().uuid().optional()+ }),+ z.object({+ type: z.literal(CaSigningConfigType.Manual)+ }),+ z.object({+ type: z.literal(CaSigningConfigType.Venafi),+ appConnectionId: z.string().uuid(),+ destinationConfig: VenafiDestinationConfigSchema+ }),+ z.object({+ type: z.literal(CaSigningConfigType.AzureAdCs),+ appConnectionId: z.string().uuid(),+ destinationConfig: AzureAdCsDestinationConfigSchema+ })+ ]),response: {200: CaSigningConfigsSchema}@@ -791,13 +857,7 @@ export const registerInternalCertificateAuthorityRouter = async (server: Fastifybody: z.object({parentCaId: z.string().uuid().optional(),appConnectionId: z.string().uuid().optional(),- destinationConfig: z- .object({- applicationId: z.string().uuid(),- issuingTemplateId: z.string().uuid(),- validityPeriod: z.number().int().min(1).optional()- })- .optional()+ destinationConfig: DestinationConfigSchema.optional()}),response: {200: CaSigningConfigsSchema@@ -806,7 +866,9 @@ export const registerInternalCertificateAuthorityRouter = async (server: Fastifyhandler: async (req) => {const { config, ca } = await server.services.caSigningConfig.updateSigningConfig({caId: req.params.caId,- ...req.body,+ parentCaId: req.body.parentCaId,+ appConnectionId: req.body.appConnectionId,+ destinationConfig: req.body.destinationConfig,actor: req.permission.type,actorId: req.permission.id,actorAuthMethod: req.permission.authMethod,diff --git a/backend/src/services/app-connection/app-connection-service.ts b/backend/src/services/app-connection/app-connection-service.tsindex 929539b012..e95feda29c 100644--- a/backend/src/services/app-connection/app-connection-service.ts+++ b/backend/src/services/app-connection/app-connection-service.ts@@ -58,6 +58,7 @@ import { auth0ConnectionService } from "./auth0/auth0-connection-service";import { ValidateAwsConnectionCredentialsSchema } from "./aws";import { awsConnectionService } from "./aws/aws-connection-service";import { ValidateAzureADCSConnectionCredentialsSchema } from "./azure-adcs/azure-adcs-connection-schemas";+import { azureAdcsConnectionService } from "./azure-adcs/azure-adcs-connection-service";import { ValidateAzureAppConfigurationConnectionCredentialsSchema } from "./azure-app-configuration";import { ValidateAzureClientSecretsConnectionCredentialsSchema } from "./azure-client-secrets";import { azureClientSecretsConnectionService } from "./azure-client-secrets/azure-client-secrets-service";@@ -1066,6 +1067,7 @@ export const appConnectionServiceFactory = ({gitlab: gitlabConnectionService(connectAppConnectionById, appConnectionDAL, kmsService),cloudflare: cloudflareConnectionService(connectAppConnectionById),venafi: venafiConnectionService(connectAppConnectionById),+ azureAdcs: azureAdcsConnectionService(connectAppConnectionById),dnsMadeEasy: dnsMadeEasyConnectionService(connectAppConnectionById),azureDns: azureDnsConnectionService(connectAppConnectionById),zabbix: zabbixConnectionService(connectAppConnectionById),diff --git a/backend/src/services/app-connection/azure-adcs/azure-adcs-connection-fns.ts b/backend/src/services/app-connection/azure-adcs/azure-adcs-connection-fns.tsindex 5e86f67402..3aaf9fb6e9 100644--- a/backend/src/services/app-connection/azure-adcs/azure-adcs-connection-fns.ts+++ b/backend/src/services/app-connection/azure-adcs/azure-adcs-connection-fns.ts@@ -1,6 +1,7 @@/* eslint-disable no-case-declarations, @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-var-requires, no-await-in-loop, no-continue */import { NtlmClient } from "axios-ntlm";import https from "https";+import RE2 from "re2";import { BadRequestError, NotFoundError } from "@app/lib/errors";import { blockLocalAndPrivateIpAddresses } from "@app/lib/validator/validate-url";@@ -129,7 +130,7 @@ const axiosNtlmRequest = async (config: AxiosNtlmConfig): Promise<AxiosNtlmRespoconst axiosConfig = {httpsAgent: config.httpsAgent,- timeout: 30000+ timeout: 60000};const client = NtlmClient(credentials, axiosConfig);@@ -438,6 +439,28 @@ export const validateAzureADCSConnectionCredentials = async (appConnection: TAzu}};+// Pattern to extract <option value="..."> from ADCS certrqxt.asp template selection page+const RE_OPTION_VALUE = new RE2('<option\\s+value="([^"]+)"', "gi");++export const listAdcsTemplates = async (client: ReturnType<typeof createNtlmClient>): Promise<string[]> => {+ const response = await client.get("/certsrv/certrqxt.asp");+ const html: string = response.data;++ const templates = new Set<string>();+ let match = RE_OPTION_VALUE.exec(html);+ while (match) {+ const optionValue = match[1];+ // Template name is the second semicolon-delimited field+ const parts = optionValue.split(";");+ if (parts.length >= 2 && parts[1]) {+ templates.add(parts[1]);+ }+ match = RE_OPTION_VALUE.exec(html);+ }++ return [...templates];+};+export const getAzureADCSConnectionListItem = () => ({name: "Azure ADCS" as const,app: AppConnection.AzureADCS as const,diff --git a/backend/src/services/app-connection/azure-adcs/azure-adcs-connection-service.ts b/backend/src/services/app-connection/azure-adcs/azure-adcs-connection-service.tsnew file mode 100644index 0000000000..192bd277c4--- /dev/null+++ b/backend/src/services/app-connection/azure-adcs/azure-adcs-connection-service.ts@@ -0,0 +1,30 @@+import { OrgServiceActor } from "@app/lib/types";++import { AppConnection } from "../app-connection-enums";+import { createAdcsHttpClient, listAdcsTemplates } from "./azure-adcs-connection-fns";+import { TAzureADCSConnection } from "./azure-adcs-connection-types";++type TGetAppConnectionFunc = (+ app: AppConnection,+ connectionId: string,+ actor: OrgServiceActor+) => Promise<TAzureADCSConnection>;++export const azureAdcsConnectionService = (getAppConnection: TGetAppConnectionFunc) => {+ const listTemplates = async (connectionId: string, actor: OrgServiceActor) => {+ const appConnection = await getAppConnection(AppConnection.AzureADCS, connectionId, actor);+ const { credentials } = appConnection;+ const client = createAdcsHttpClient(+ credentials.username,+ credentials.password,+ credentials.adcsUrl,+ credentials.sslRejectUnauthorized ?? true,+ credentials.sslCertificate+ );+ return listAdcsTemplates(client);+ };++ return {+ listTemplates+ };+};diff --git a/backend/src/services/app-connection/azure-adcs/index.ts b/backend/src/services/app-connection/azure-adcs/index.tsindex 3cefd9090b..589a54ac5e 100644--- a/backend/src/services/app-connection/azure-adcs/index.ts+++ b/backend/src/services/app-connection/azure-adcs/index.ts@@ -1,4 +1,5 @@export * from "./azure-adcs-connection-enums";export * from "./azure-adcs-connection-fns";export * from "./azure-adcs-connection-schemas";+export * from "./azure-adcs-connection-service";export * from "./azure-adcs-connection-types";diff --git a/backend/src/services/certificate-authority/ca-auto-renewal-queue.ts b/backend/src/services/certificate-authority/ca-auto-renewal-queue.tsindex 95a683451b..b4c8e41708 100644--- a/backend/src/services/certificate-authority/ca-auto-renewal-queue.ts+++ b/backend/src/services/certificate-authority/ca-auto-renewal-queue.ts@@ -7,11 +7,16 @@ import { JOB_SCHEDULER_PREFIX, QueueJobs, QueueName, TQueueServiceFactory } fromimport { TAppConnectionDALFactory } from "../app-connection/app-connection-dal";import { decryptAppConnectionCredentials } from "../app-connection/app-connection-fns";+import { getAzureADCSConnectionCredentials } from "../app-connection/azure-adcs/azure-adcs-connection-fns";import { TVenafiConnection } from "../app-connection/venafi/venafi-connection-types";import { TKmsServiceFactory } from "../kms/kms-service";+import { submitCsrToAdcs } from "./ca-signing-config/adcs-signing-fns";import { TCaSigningConfigDALFactory } from "./ca-signing-config/ca-signing-config-dal";import { CaSigningConfigType } from "./ca-signing-config/ca-signing-config-enums";-import { VenafiDestinationConfigSchema } from "./ca-signing-config/ca-signing-config-types";+import {+ AzureAdCsDestinationConfigSchema,+ VenafiDestinationConfigSchema+} from "./ca-signing-config/ca-signing-config-types";import {downloadVenafiCertificate,pollVenafiCertificateIssuance,@@ -187,6 +192,73 @@ export const caAutoRenewalQueueFactory = ({});};+ const processAdcsCertificateIssuance = async ({+ caId,+ internalCaId,+ maxPathLength+ }: {+ caId: string;+ internalCaId: string;+ maxPathLength?: number;+ }) => {+ const signingConfig = await caSigningConfigDAL.findByCaId(internalCaId);+ if (!signingConfig) {+ throw new Error("No signing config found");+ }++ if (signingConfig.type !== CaSigningConfigType.AzureAdCs) {+ throw new Error(`Signing config type '${signingConfig.type}' is not Azure AD CS`);+ }++ if (!signingConfig.appConnectionId) {+ throw new Error("Azure AD CS signing config is missing app connection");+ }++ const parseResult = AzureAdCsDestinationConfigSchema.safeParse(signingConfig.destinationConfig);+ if (!parseResult.success) {+ throw new Error("Azure AD CS signing config has invalid or missing destination configuration");+ }+ const destinationConfig = parseResult.data;++ const { csr } = await internalCertificateAuthorityService.getCaCsr({+ isInternal: true,+ caId,+ ...(maxPathLength !== undefined && { maxPathLength })+ });++ const credentials = await getAzureADCSConnectionCredentials(+ signingConfig.appConnectionId,+ appConnectionDAL,+ kmsService+ );++ const { certificate, certificateChain } = await submitCsrToAdcs({+ credentials: {+ username: credentials.username,+ password: credentials.password,+ sslRejectUnauthorized: credentials.sslRejectUnauthorized,+ sslCertificate: credentials.sslCertificate+ },+ adcsUrl: credentials.adcsUrl,+ csr,+ template: destinationConfig.template,+ validityPeriod: destinationConfig.validityPeriod+ });++ await internalCertificateAuthorityService.importCertToCa({+ isInternal: true,+ caId,+ certificate,+ certificateChain+ });++ await internalCertificateAuthorityDAL.updateById(internalCaId, {+ lastRenewalStatus: CaRenewalStatus.SUCCESS,+ lastRenewalMessage: null,+ lastRenewalAt: new Date()+ });+ };+queueService.start(QueueName.CaAutoRenewal, async (job) => {if (job.name === QueueJobs.CaVenafiInstall) {const { caId, maxPathLength } = job.data as { caId: string; maxPathLength?: number };@@ -220,6 +292,38 @@ export const caAutoRenewalQueueFactory = ({return;}+ if (job.name === QueueJobs.CaAdcsInstall) {+ const { caId, maxPathLength } = job.data as { caId: string; maxPathLength?: number };++ logger.info({ caId }, `${QueueJobs.CaAdcsInstall}: processing ADCS install`);++ const internalCa = await internalCertificateAuthorityDAL.findOne({ caId });+ if (!internalCa) {+ logger.error({ caId }, `${QueueJobs.CaAdcsInstall}: internal CA not found`);+ return;+ }++ try {+ await processAdcsCertificateIssuance({+ caId,+ internalCaId: internalCa.id,+ maxPathLength+ });++ logger.info({ caId }, `${QueueJobs.CaAdcsInstall}: successfully installed certificate via ADCS`);+ } catch (error) {+ const errorMessage = error instanceof Error ? error.message : "Unknown error";+ logger.error(error, `${QueueJobs.CaAdcsInstall}: CA ${caId} ADCS install failed`);++ await internalCertificateAuthorityDAL.updateById(internalCa.id, {+ lastRenewalStatus: CaRenewalStatus.FAILED,+ lastRenewalMessage: errorMessage.substring(0, MAX_RENEWAL_MESSAGE_LENGTH)+ });+ }++ return;+ }+if (job.name !== QueueJobs.CaDailyAutoRenewal) return;logger.info(`${QueueJobs.CaDailyAutoRenewal}: queue task started`);@@ -297,6 +401,11 @@ export const caAutoRenewalQueueFactory = ({caId: internalCa.caId,internalCaId: internalCa.id});+ } else if (signingConfig.type === CaSigningConfigType.AzureAdCs) {+ await processAdcsCertificateIssuance({+ caId: internalCa.caId,+ internalCaId: internalCa.id+ });}}@@ -359,9 +468,36 @@ export const caAutoRenewalQueueFactory = ({);};+ const queueAdcsInstall = async (caId: string, maxPathLength?: number) => {+ const internalCa = await internalCertificateAuthorityDAL.findOne({ caId });+ if (!internalCa) {+ throw new NotFoundError({ message: `Internal CA with caId ${caId} not found` });+ }++ if (internalCa.lastRenewalStatus === CaRenewalStatus.PENDING) {+ throw new BadRequestError({ message: "A certificate installation is already in progress for this CA" });+ }++ await internalCertificateAuthorityDAL.updateById(internalCa.id, {+ lastRenewalStatus: CaRenewalStatus.PENDING,+ lastRenewalMessage: null+ });++ await queueService.queue(+ QueueName.CaAutoRenewal,+ QueueJobs.CaAdcsInstall,+ { caId, maxPathLength },+ {+ jobId: `adcs-install-${caId}-${Date.now()}`,+ removeOnComplete: true,+ removeOnFail: true+ }+ );+ };+queueService.listen(QueueName.CaAutoRenewal, "failed", (_, err) => {logger.error(err, `${QueueName.CaAutoRenewal}: job failed`);});- return { startDailyAutoRenewalJob, queueVenafiInstall };+ return { startDailyAutoRenewalJob, queueVenafiInstall, queueAdcsInstall };};diff --git a/backend/src/services/certificate-authority/ca-signing-config/adcs-signing-fns.ts b/backend/src/services/certificate-authority/ca-signing-config/adcs-signing-fns.tsnew file mode 100644index 0000000000..f118df46d0--- /dev/null+++ b/backend/src/services/certificate-authority/ca-signing-config/adcs-signing-fns.ts@@ -0,0 +1,249 @@+/* eslint-disable no-continue, no-await-in-loop */+import * as x509 from "@peculiar/x509";+import RE2 from "re2";++import { BadRequestError } from "@app/lib/errors";+import { logger } from "@app/lib/logger";+import { createAdcsHttpClient } from "@app/services/app-connection/azure-adcs/azure-adcs-connection-fns";++const POLL_INTERVAL_MS = 5000;+const MAX_POLL_ATTEMPTS = 120;++// Pre-compiled regex patterns+const RE_NON_BASE64 = new RE2("[^A-Za-z0-9+/=\\s]", "g");+const RE_WHITESPACE = new RE2("\\s", "g");+const RE_BASE64_WRAP = new RE2("(.{64})", "g");+const RE_CSR_BEGIN = new RE2("-----BEGIN CERTIFICATE REQUEST-----", "g");+const RE_CSR_END = new RE2("-----END CERTIFICATE REQUEST-----", "g");+const RE_CSR_NEWLINES = new RE2("\\r?\\n", "g");+const RE_PEM_CERT = new RE2("-----BEGIN CERTIFICATE-----[\\s\\S]*?-----END CERTIFICATE-----");+const RE_ESCAPED_CRLF = new RE2("\\\\r\\\\n", "g");+const RE_ESCAPED_CR = new RE2("\\\\r", "g");+const RE_CRLF = new RE2("[\\r\\n]", "g");+// Error detail extraction patterns for ADCS error pages+const RE_DISPOSITION_INLINE = new RE2('disposition\\s+message\\s+is\\s+"([^"]+)"', "i");+const RE_RESULT_FIELD = new RE2("<b>Result:</b>[^<]*(?:<[^>]*>)*\\s*([^<]+)", "i");+const RE_COM_ERROR = new RE2("<b>COM Error Info:</b>[^<]*(?:<[^>]*>)*\\s*([^<]+)", "i");+const RE_DISPOSITION_DD = new RE2("<b>Disposition message:</b>[^<]*(?:<[^>]*>)*\\s*([^<]+)", "i");+const RE_SUGGESTED_CAUSE = new RE2("<b>Suggested Cause:</b>[^<]*(?:<[^>]*>)*\\s*([^<]+)", "i");++const ADCS_ERROR_PATTERNS = [+ RE_DISPOSITION_INLINE,+ RE_DISPOSITION_DD,+ RE_RESULT_FIELD,+ RE_COM_ERROR,+ RE_SUGGESTED_CAUSE+];++const extractAdcsErrorDetail = (html: string): string => {+ for (const re of ADCS_ERROR_PATTERNS) {+ const match = html.match(re);+ const val = match?.[1]?.trim();+ if (val && !val.startsWith("(")) {+ return val;+ }+ }+ return "";+};++const REQUEST_ID_PATTERNS = [+ new RE2("reqid[=:](\\d+)", "i"),+ new RE2("request\\s+id[:\\s]+(\\d+)", "i"),+ new RE2("certificate\\s+request\\s+(\\d+)", "i"),+ new RE2("\\breqid=(\\d+)\\b", "i"),+ new RE2("requestid[:\\s]*(\\d+)", "i")+];++/**+ * Fetch the issuing CA certificate from ADCS web enrollment.+ * Uses the /certsrv/certnew.cer endpoint which returns an X.509 certificate,+ * NOT the .p7b endpoint which returns a PKCS#7 container that cannot be+ * parsed as individual X.509 certs.+ */+const fetchAdcsCaChain = async (adcsClient: ReturnType<typeof createAdcsHttpClient>): Promise<string> => {+ const caCertResponse = await adcsClient.get("/certsrv/certnew.cer?ReqID=CACert&Renewal=0&Enc=b64", {+ Accept: "application/pkix-cert,application/x-x509-ca-cert,*/*"+ });++ const caCertData: string = caCertResponse.data;++ // Already PEM-formatted+ if (caCertData.includes("-----BEGIN CERTIFICATE-----")) {+ const pemCert = caCertData.trim();+ // Validate it's actually parseable as X.509 (throws on invalid input)+ // eslint-disable-next-line no-new+ new x509.X509Certificate(pemCert);+ return pemCert;+ }++ // Raw base64 — convert to PEM+ let cleanData = caCertData.trim();+ cleanData = cleanData.replace(RE_NON_BASE64, "").replace(RE_WHITESPACE, "");++ if (cleanData.length < 100) {+ throw new BadRequestError({ message: "Failed to retrieve CA certificate from ADCS: response too short" });+ }++ const formatted = cleanData.replace(RE_BASE64_WRAP, "$1\n").trim();+ const pemCert = `-----BEGIN CERTIFICATE-----\n${formatted}\n-----END CERTIFICATE-----`;++ // Validate it's actually parseable as X.509 (throws on invalid input)+ // eslint-disable-next-line no-new+ new x509.X509Certificate(pemCert);++ return pemCert;+};++export const submitCsrToAdcs = async (params: {+ credentials: { username: string; password: string; sslRejectUnauthorized?: boolean; sslCertificate?: string };+ adcsUrl: string;+ csr: string;+ template: string;+ validityPeriod?: number;+}): Promise<{ certificate: string; certificateChain: string }> => {+ const { credentials, adcsUrl, csr, template, validityPeriod } = params;++ const adcsClient = createAdcsHttpClient(+ credentials.username,+ credentials.password,+ adcsUrl,+ credentials.sslRejectUnauthorized ?? true,+ credentials.sslCertificate+ );++ // Clean CSR by removing headers and newlines for ADCS submission+ const cleanCsr = csr.replace(RE_CSR_BEGIN, "").replace(RE_CSR_END, "").replace(RE_CSR_NEWLINES, "");++ // Build certificate attributes+ const sanitizedTemplate = RE_CRLF.replace(template.trim(), "");+ const certAttribParts: string[] = [`CertificateTemplate:${sanitizedTemplate}`];++ if (validityPeriod) {+ const ttlMs = validityPeriod * 86400000;+ const expirationDate = new Date(Date.now() + ttlMs);+ const rfc2616Date = expirationDate.toUTCString();+ certAttribParts.push(`ExpirationDate:${rfc2616Date}`);+ }++ const certAttrib = `${certAttribParts.join("\r\n")}\r\n`;++ const formData = new URLSearchParams({+ Mode: "newreq",+ CertRequest: cleanCsr,+ CertAttrib: certAttrib,+ FriendlyType: "Saved-Request Certificate",+ TargetStoreFlags: "0",+ SaveCert: "yes"+ });++ const response = await adcsClient.post("/certsrv/certfnsh.asp", formData.toString());+ const responseText = response.data;++ // Parse request ID+ let requestId: string | undefined;+ let status: "issued" | "pending" | "denied" = "pending";+ let certificate = "";++ for (const regex of REQUEST_ID_PATTERNS) {+ const match = responseText.match(regex);+ if (match) {+ [, requestId] = match;+ break;+ }+ }++ // Check for immediate certificate issuance+ const certMatch = responseText.match(RE_PEM_CERT);+ if (certMatch) {+ certificate = certMatch[0].replace(RE_ESCAPED_CRLF, "\n").replace(RE_ESCAPED_CR, "\n").trim();+ status = "issued";+ }++ // Check disposition message (only if we didn't already extract a certificate)+ if (!certificate) {+ if (responseText.includes("taken under submission") || responseText.includes("pending")) {+ status = "pending";+ } else if (responseText.includes("denied") || responseText.includes("rejected")) {+ status = "denied";+ } else if (responseText.includes("issued")) {+ status = "issued";+ }+ }++ if (status === "denied") {+ const detail = extractAdcsErrorDetail(responseText);+ throw new BadRequestError({+ message: detail ? `Certificate request was denied by ADCS: ${detail}` : "Certificate request was denied by ADCS"+ });+ }++ if (status === "issued" && certificate) {+ const certificateChain = await fetchAdcsCaChain(adcsClient);+ return { certificate, certificateChain };+ }++ // If pending, poll for the certificate+ if (!requestId) {+ const detail = extractAdcsErrorDetail(responseText);+ throw new BadRequestError({+ message: detail+ ? `Certificate request failed: ${detail}`+ : "Certificate request failed: could not parse request ID or certificate from ADCS response"+ });+ }++ logger.info({ requestId }, "ADCS certificate request pending, polling for completion");++ for (let attempt = 0; attempt < MAX_POLL_ATTEMPTS; attempt += 1) {+ await new Promise((resolve) => {+ setTimeout(resolve, POLL_INTERVAL_MS);+ });++ try {+ const certResponse = await adcsClient.get(`/certsrv/certnew.cer?ReqID=${requestId}&Enc=b64`, {+ Accept: "application/pkix-cert,application/x-x509-ca-cert,application/octet-stream,*/*"+ });++ const certData = certResponse.data;++ // Still pending+ if (certData.includes("<html>") || certData.includes("taken under submission") || certData.includes("pending")) {+ continue;+ }++ // Certificate in PEM format+ if (certData.includes("-----BEGIN CERTIFICATE-----")) {+ const polledCert = certData.trim();+ const certificateChain = await fetchAdcsCaChain(adcsClient);+ return { certificate: polledCert, certificateChain };+ }++ // Handle base64-encoded certificate data+ let cleanCertData = certData.trim();+ cleanCertData = cleanCertData.replace(RE_NON_BASE64, "").replace(RE_WHITESPACE, "");++ if (cleanCertData.length < 100) {+ continue;+ }++ const formattedCert = cleanCertData.replace(RE_BASE64_WRAP, "$1\n").trim();+ const pemCert = `-----BEGIN CERTIFICATE-----\n${formattedCert}\n-----END CERTIFICATE-----`;++ // Validate the PEM (throws on invalid input)+ // eslint-disable-next-line no-new+ new x509.X509Certificate(pemCert);+ const certificateChain = await fetchAdcsCaChain(adcsClient);+ return { certificate: pemCert, certificateChain };+ } catch (error) {+ if (error instanceof BadRequestError) {+ throw error;+ }+ // Continue polling on transient errors+ logger.warn({ requestId, attempt, error }, "ADCS poll attempt failed, retrying");+ }+ }++ throw new BadRequestError({+ message: `Certificate request ${requestId} did not complete within the polling timeout`+ });+};diff --git a/backend/src/services/certificate-authority/ca-signing-config/ca-signing-config-enums.ts b/backend/src/services/certificate-authority/ca-signing-config/ca-signing-config-enums.tsindex 1b71e2d70c..ecb7104876 100644--- a/backend/src/services/certificate-authority/ca-signing-config/ca-signing-config-enums.ts+++ b/backend/src/services/certificate-authority/ca-signing-config/ca-signing-config-enums.ts@@ -1,5 +1,6 @@export enum CaSigningConfigType {Internal = "internal",Manual = "manual",- Venafi = "venafi"+ Venafi = "venafi",+ AzureAdCs = "azure-ad-cs"}diff --git a/backend/src/services/certificate-authority/ca-signing-config/ca-signing-config-service.ts b/backend/src/services/certificate-authority/ca-signing-config/ca-signing-config-service.tsindex 75a31c791f..7e8abdd747 100644--- a/backend/src/services/certificate-authority/ca-signing-config/ca-signing-config-service.ts+++ b/backend/src/services/certificate-authority/ca-signing-config/ca-signing-config-service.ts@@ -17,6 +17,8 @@ import { TInternalCertificateAuthorityDALFactory } from "../internal/internal-ceimport { TCaSigningConfigDALFactory } from "./ca-signing-config-dal";import { CaSigningConfigType } from "./ca-signing-config-enums";import {+ AzureAdCsDestinationConfigSchema,+ TAzureAdCsDestinationConfig,TCreateCaSigningConfigDTO,TGetCaSigningConfigDTO,TUpdateCaSigningConfigDTO,@@ -33,7 +35,7 @@ type TCaSigningConfigServiceFactoryDep = {internalCertificateAuthorityDAL: Pick<TInternalCertificateAuthorityDALFactory, "findOne" | "updateById">;permissionService: Pick<TPermissionServiceFactory, "getProjectPermission">;appConnectionDAL: Pick<TAppConnectionDALFactory, "findById">;- caAutoRenewalQueue: Pick<TCaAutoRenewalQueueFactory, "queueVenafiInstall">;+ caAutoRenewalQueue: Pick<TCaAutoRenewalQueueFactory, "queueVenafiInstall" | "queueAdcsInstall">;};export type TCaSigningConfigServiceFactory = ReturnType<typeof caSigningConfigServiceFactory>;@@ -115,9 +117,24 @@ export const caSigningConfigServiceFactory = ({if (!destinationConfig) {throw new BadRequestError({ message: "Destination config is required for Venafi signing" });}+ VenafiDestinationConfigSchema.parse(destinationConfig);await validateAppConnectionOrg(appConnectionId, actorOrgId);}+ // Azure AD CS requires appConnectionId and destinationConfig+ if (type === CaSigningConfigType.AzureAdCs) {+ if (!appConnectionId) {+ throw new BadRequestError({ message: "App connection ID is required for Azure AD CS signing" });+ }+ if (!destinationConfig) {+ throw new BadRequestError({ message: "Destination config is required for Azure AD CS signing" });+ }+ AzureAdCsDestinationConfigSchema.parse(destinationConfig);+ await validateAppConnectionOrg(appConnectionId, actorOrgId);+ }++ const isExternalCa = type === CaSigningConfigType.Venafi || type === CaSigningConfigType.AzureAdCs;+const config = await caSigningConfigDAL.transaction(async (tx) => {if (existing) {await caSigningConfigDAL.deleteById(existing.id, tx);@@ -128,8 +145,8 @@ export const caSigningConfigServiceFactory = ({caId: internalCa.id,type,parentCaId: type === CaSigningConfigType.Internal ? parentCaId : undefined,- appConnectionId: type === CaSigningConfigType.Venafi ? appConnectionId : undefined,- destinationConfig: type === CaSigningConfigType.Venafi ? destinationConfig : undefined+ appConnectionId: isExternalCa ? appConnectionId : undefined,+ destinationConfig: isExternalCa ? destinationConfig : undefined},tx);@@ -222,7 +239,7 @@ export const caSigningConfigServiceFactory = ({const updateData: {parentCaId?: string | null;appConnectionId?: string;- destinationConfig?: TVenafiDestinationConfig;+ destinationConfig?: TVenafiDestinationConfig | TAzureAdCsDestinationConfig;lastExternalCertificateId?: string;} = {};@@ -235,10 +252,24 @@ export const caSigningConfigServiceFactory = ({await validateAppConnectionOrg(appConnectionId, actorOrgId);updateData.appConnectionId = appConnectionId;}- if (destinationConfig !== undefined) updateData.destinationConfig = destinationConfig;+ if (destinationConfig !== undefined) {+ VenafiDestinationConfigSchema.parse(destinationConfig);+ updateData.destinationConfig = destinationConfig;+ }if (lastExternalCertificateId !== undefined) updateData.lastExternalCertificateId = lastExternalCertificateId;}+ if (existing.type === CaSigningConfigType.AzureAdCs) {+ if (appConnectionId !== undefined) {+ await validateAppConnectionOrg(appConnectionId, actorOrgId);+ updateData.appConnectionId = appConnectionId;+ }+ if (destinationConfig !== undefined) {+ AzureAdCsDestinationConfigSchema.parse(destinationConfig);+ updateData.destinationConfig = destinationConfig;+ }+ }+if (Object.keys(updateData).length === 0) {return { config: existing, ca: { id: ca.id, dn: ca.internalCa?.dn ?? "", projectId: ca.projectId } };}@@ -460,12 +491,70 @@ export const caSigningConfigServiceFactory = ({return { ca: { id: ca.id, dn: ca.internalCa?.dn ?? "", projectId: ca.projectId } };};+ const installCertificateAzureAdCs = async ({+ caId,+ maxPathLength,+ actor,+ actorId,+ actorAuthMethod,+ actorOrgId+ }: {+ caId: string;+ maxPathLength?: number;+ actor: ActorType;+ actorId: string;+ actorAuthMethod: ActorAuthMethod;+ actorOrgId: string;+ }) => {+ const ca = await certificateAuthorityDAL.findByIdWithAssociatedCa(caId);+ if (!ca) throw new NotFoundError({ message: `CA with ID ${caId} not found` });++ const { permission } = await permissionService.getProjectPermission({+ actor,+ actorId,+ projectId: ca.projectId,+ actorAuthMethod,+ actorOrgId,+ actionProjectType: ActionProjectType.CertificateManager+ });++ ForbiddenError.from(permission).throwUnlessCan(+ ProjectPermissionCertificateAuthorityActions.Edit,+ subject(ProjectPermissionSub.CertificateAuthorities, { name: ca.name })+ );++ const internalCa = await internalCertificateAuthorityDAL.findOne({ caId });+ if (!internalCa) throw new NotFoundError({ message: `Internal CA with caId ${caId} not found` });++ const signingConfig = await getSigningConfigByCaId(internalCa.id);++ if (signingConfig.type !== CaSigningConfigType.AzureAdCs) {+ throw new BadRequestError({ message: "CA signing config is not configured for Azure AD CS" });+ }++ if (!signingConfig.appConnectionId) {+ throw new BadRequestError({ message: "Azure AD CS signing config is missing app connection" });+ }++ const parseResult = AzureAdCsDestinationConfigSchema.safeParse(signingConfig.destinationConfig);+ if (!parseResult.success) {+ throw new BadRequestError({+ message: "Azure AD CS signing config has invalid or missing destination configuration"+ });+ }++ await caAutoRenewalQueue.queueAdcsInstall(caId, maxPathLength);++ return { ca: { id: ca.id, dn: ca.internalCa?.dn ?? "", projectId: ca.projectId } };+ };+return {createSigningConfig,getSigningConfig,updateSigningConfig,getAutoRenewalConfig,updateAutoRenewalConfig,- installCertificateVenafi+ installCertificateVenafi,+ installCertificateAzureAdCs};};diff --git a/backend/src/services/certificate-authority/ca-signing-config/ca-signing-config-types.ts b/backend/src/services/certificate-authority/ca-signing-config/ca-signing-config-types.tsindex 3e3ab107ff..7e88514df6 100644--- a/backend/src/services/certificate-authority/ca-signing-config/ca-signing-config-types.ts+++ b/backend/src/services/certificate-authority/ca-signing-config/ca-signing-config-types.ts@@ -1,7 +1,10 @@+import RE2 from "re2";import { z } from "zod";import { CaSigningConfigType } from "./ca-signing-config-enums";+const RE_NO_NEWLINES = new RE2("^[^\\r\\n]+$");+export const VenafiDestinationConfigSchema = z.object({applicationId: z.string().uuid(),issuingTemplateId: z.string().uuid(),@@ -10,19 +13,32 @@ export const VenafiDestinationConfigSchema = z.object({export type TVenafiDestinationConfig = z.infer<typeof VenafiDestinationConfigSchema>;+export const AzureAdCsDestinationConfigSchema = z.object({+ template: z+ .string()+ .min(1)+ .refine((v) => RE_NO_NEWLINES.test(v), "Template name must not contain newline characters"),+ validityPeriod: z.number().int().positive().optional()+});++export type TAzureAdCsDestinationConfig = z.infer<typeof AzureAdCsDestinationConfigSchema>;++// Union of all external CA destination config schemas — extend here when adding new providers+export const DestinationConfigSchema = VenafiDestinationConfigSchema.or(AzureAdCsDestinationConfigSchema);+export type TCreateCaSigningConfigDTO = {caId: string;type: CaSigningConfigType;parentCaId?: string;appConnectionId?: string;- destinationConfig?: TVenafiDestinationConfig;+ destinationConfig?: TVenafiDestinationConfig | TAzureAdCsDestinationConfig;};export type TUpdateCaSigningConfigDTO = {caId: string;parentCaId?: string;appConnectionId?: string;- destinationConfig?: TVenafiDestinationConfig;+ destinationConfig?: TVenafiDestinationConfig | TAzureAdCsDestinationConfig;lastExternalCertificateId?: string;};diff --git a/docs/api-reference/endpoints/certificate-authorities/internal/install-cert-adcs.mdx b/docs/api-reference/endpoints/certificate-authorities/internal/install-cert-adcs.mdxnew file mode 100644index 0000000000..e71054a61e--- /dev/null+++ b/docs/api-reference/endpoints/certificate-authorities/internal/install-cert-adcs.mdx@@ -0,0 +1,4 @@+---+title: "Install ADCS Certificate"+openapi: "POST /api/v1/cert-manager/ca/internal/{caId}/install-certificate-adcs"+---\ No newline at end of filediff --git a/docs/docs.json b/docs/docs.jsonindex 5bae58d6e1..3190b6ad7d 100644--- a/docs/docs.json+++ b/docs/docs.json@@ -2891,7 +2891,8 @@"pages": ["api-reference/endpoints/certificate-authorities/internal/sign-intermediate","api-reference/endpoints/certificate-authorities/internal/import-cert",- "api-reference/endpoints/certificate-authorities/internal/install-cert-venafi"+ "api-reference/endpoints/certificate-authorities/internal/install-cert-venafi",+ "api-reference/endpoints/certificate-authorities/internal/install-cert-adcs"]},{diff --git a/docs/documentation/platform/pki/ca/azure-adcs.mdx b/docs/documentation/platform/pki/ca/azure-adcs.mdxindex 3bcb4b9122..9490cfcab8 100644--- a/docs/documentation/platform/pki/ca/azure-adcs.mdx+++ b/docs/documentation/platform/pki/ca/azure-adcs.mdx@@ -18,155 +18,314 @@ Before setting up ADCS integration, ensure you have:- For self-hosted instances, whitelist your Infisical server's IP address- Azure ADCS app connection configured (see [Azure ADCS Connection](/integrations/app-connections/azure-adcs))-## Complete Workflow: From Setup to Certificate Issuance--This section walks you through the complete end-to-end process of setting up Azure ADCS integration and issuing your first certificate.--<Steps>- <Step title="Navigate to External Certificate Authorities">- In your Infisical project, go to your **Certificate Project** →- **Certificate Authority** to access the external CAs page. - </Step>--<Step title="Create New Azure ADCS Certificate Service CA">- Click **Create CA** and configure: - **Type**: Choose **Active Directory- Certificate Services (AD CS)** - **Name**: Friendly name for this CA (e.g.,- "Production ADCS CA") - **App Connection**: Choose your ADCS connection from- the dropdown -</Step>--<Step title="Certificate Authority Created">- Once created, your Azure ADCS Certificate Authority will appear in the list- and be ready for use. -</Step>--<Step title="Navigate to Subscribers">- Go to **Subscribers** to access the subscribers page. -</Step>--<Step title="Create New Subscriber">- Click **Add Subscriber** and configure: - **Name**: Unique subscriber name- (e.g., "web-server-certs") - **Certificate Authority**: Select your ADCS CA -- **Common Name**: Certificate CN (e.g., "api.example.com") - **Certificate- Template**: Select from dynamically loaded ADCS templates - **Subject- Alternative Names**: DNS names, IP addresses, or email addresses - **TTL**:- Certificate validity period (e.g., "1y" for 1 year) - **Additional Subject- Fields**: Organization, OU, locality, state, country, email (if required by- template) -</Step>--<Step title="Subscriber Created">- Your subscriber is now created and ready to issue certificates. -</Step>--<Step title="Issue New Certificate">- Click into your subscriber and click **Order Certificate** to generate a new- certificate using your ADCS template. -</Step>--<Step title="Certificate Created">- Your certificate has been successfully issued by the ADCS server and is ready- for use. -</Step>-- <Step title="View Certificate Details">- Navigate to **Certificates** to view detailed information about all issued- certificates, including expiration dates, serial numbers, and certificate- chains. - </Step>-</Steps>--## Certificate Templates--Infisical automatically retrieves available certificate templates from your ADCS server, ensuring you can only select templates that are properly configured and accessible. The system dynamically discovers templates during the certificate authority setup and certificate issuance process.--### Common Template Types--ADCS templates you might see include:--- **Web Server**: For SSL/TLS certificates with server authentication-- **Computer**: For machine authentication certificates-- **User**: For client authentication certificates-- **Basic EFS**: For Encrypting File System certificates-- **EFS Recovery Agent**: For EFS data recovery-- **Administrator**: For administrative certificates-- **Subordinate Certification Authority**: For issuing CA certificates--### Template Requirements--Ensure your ADCS templates are configured with:--- **Enroll permissions** for your connection account-- **Auto-enroll permissions** if using automated workflows-- **Subject name requirements** matching your certificate requests-- **Key usage extensions** appropriate for your use case--<Info>- **Dynamic Template Discovery**: Infisical queries your ADCS server in- real-time to populate available templates. Only templates you have permission- to use will be displayed during certificate issuance.-</Info>--## Certificate Issuance Limitations--### Immediate Issuance Only--<Warning>- **Manual Approval Not Supported**: Infisical currently supports only- **immediate certificate issuance**. Certificates that require manual approval- or are held by ADCS policies cannot be issued through Infisical yet.-</Warning>--For successful certificate issuance, ensure your ADCS templates and policies are configured to:--- **Auto-approve** certificate requests without manual intervention-- **Not require** administrator approval for the templates you plan to use-- **Allow** the connection account to request and receive certificates immediately--### What Happens with Manual Approval--If a certificate request requires manual approval:--1. The request will be submitted to ADCS successfully-2. Infisical will attempt to retrieve the certificate with exponential backoff (up to 5 retries over ~1 minute)-3. If the certificate is not approved within this timeframe, the request will **fail**-4. **No background polling**: Currently, Infisical does not check for certificates that might be approved hours or days later--<Info>- **Future Enhancement**: Background polling for delayed certificate approvals- is planned for future releases.-</Info>--### Certificate Revocation--<Warning>- Certificate revocation is **not supported** by the Azure ADCS connector due to- security and complexity considerations.-</Warning>--## Advanced Configuration--### Custom Validity Periods--Enable custom certificate validity periods on your ADCS server:--```cmd-# Run on ADCS server as Administrator-certutil -setreg policy\EditFlags +EDITF_ATTRIBUTEENDDATE-net stop certsvc-net start certsvc-```--This allows Infisical to control certificate expiration dates directly.+Infisical supports two ways to use AD CS: as an **External CA** for direct certificate issuance, or to **sign internal intermediate CAs** so you can build an Infisical-managed CA hierarchy backed by your AD CS server. With the intermediate CA approach, Infisical handles CSR submission and signing automatically — no manual steps needed during installation or renewal.++<Tabs>+ <Tab title="External CA">+ This section walks you through the complete end-to-end process of setting up Azure ADCS integration and issuing your first certificate.++ <Steps>+ <Step title="Navigate to External Certificate Authorities">+ In your Infisical project, go to your **Certificate Project** →+ **Certificate Authority** to access the external CAs page. + </Step>++ <Step title="Create New Azure ADCS Certificate Service CA">+ Click **Create CA** and configure: - **Type**: Choose **Active Directory+ Certificate Services (AD CS)** - **Name**: Friendly name for this CA (e.g.,+ "Production ADCS CA") - **App Connection**: Choose your ADCS connection from+ the dropdown + </Step>++ <Step title="Certificate Authority Created">+ Once created, your Azure ADCS Certificate Authority will appear in the list+ and be ready for use. + </Step>++ <Step title="Navigate to Subscribers">+ Go to **Subscribers** to access the subscribers page. + </Step>++ <Step title="Create New Subscriber">+ Click **Add Subscriber** and configure: - **Name**: Unique subscriber name+ (e.g., "web-server-certs") - **Certificate Authority**: Select your ADCS CA -+ **Common Name**: Certificate CN (e.g., "api.example.com") - **Certificate+ Template**: Select from dynamically loaded ADCS templates - **Subject+ Alternative Names**: DNS names, IP addresses, or email addresses - **TTL**:+ Certificate validity period (e.g., "1y" for 1 year) - **Additional Subject+ Fields**: Organization, OU, locality, state, country, email (if required by+ template) + </Step>++ <Step title="Subscriber Created">+ Your subscriber is now created and ready to issue certificates. + </Step>++ <Step title="Issue New Certificate">+ Click into your subscriber and click **Order Certificate** to generate a new+ certificate using your ADCS template. + </Step>++ <Step title="Certificate Created">+ Your certificate has been successfully issued by the ADCS server and is ready+ for use. + </Step>++ <Step title="View Certificate Details">+ Navigate to **Certificates** to view detailed information about all issued+ certificates, including expiration dates, serial numbers, and certificate+ chains. + </Step>+ </Steps>++ ## Certificate Templates++ Infisical automatically retrieves available certificate templates from your ADCS server, ensuring you can only select templates that are properly configured and accessible. The system dynamically discovers templates during the certificate authority setup and certificate issuance process.++ ### Common Template Types++ ADCS templates you might see include:++ - **Web Server**: For SSL/TLS certificates with server authentication+ - **Computer**: For machine authentication certificates+ - **User**: For client authentication certificates+ - **Basic EFS**: For Encrypting File System certificates+ - **EFS Recovery Agent**: For EFS data recovery+ - **Administrator**: For administrative certificates+ - **Subordinate Certification Authority**: For issuing CA certificates++ ### Template Requirements++ Ensure your ADCS templates are configured with:++ - **Enroll permissions** for your connection account+ - **Auto-enroll permissions** if using automated workflows+ - **Subject name requirements** matching your certificate requests+ - **Key usage extensions** appropriate for your use case++ <Info>+ **Dynamic Template Discovery**: Infisical queries your ADCS server in+ real-time to populate available templates. Only templates you have permission+ to use will be displayed during certificate issuance.+ </Info>++ ## Certificate Issuance Limitations++ ### Immediate Issuance Only++ <Warning>+ **Manual Approval Not Supported**: Infisical currently supports only+ **immediate certificate issuance**. Certificates that require manual approval+ or are held by ADCS policies cannot be issued through Infisical yet.+ </Warning>++ For successful certificate issuance, ensure your ADCS templates and policies are configured to:++ - **Auto-approve** certificate requests without manual intervention+ - **Not require** administrator approval for the templates you plan to use+ - **Allow** the connection account to request and receive certificates immediately++ ### What Happens with Manual Approval++ If a certificate request requires manual approval:++ 1. The request will be submitted to ADCS successfully+ 2. Infisical will attempt to retrieve the certificate with exponential backoff (up to 5 retries over ~1 minute)+ 3. If the certificate is not approved within this timeframe, the request will **fail**+ 4. **No background polling**: Currently, Infisical does not check for certificates that might be approved hours or days later++ <Info>+ **Future Enhancement**: Background polling for delayed certificate approvals+ is planned for future releases.+ </Info>++ ### Certificate Revocation++ <Warning>+ Certificate revocation is **not supported** by the Azure ADCS connector due to+ security and complexity considerations.+ </Warning>++ ## Advanced Configuration++ ### Custom Validity Periods++ Enable custom certificate validity periods on your ADCS server:++ ```cmd+ # Run on ADCS server as Administrator+ certutil -setreg policy\EditFlags +EDITF_ATTRIBUTEENDDATE+ net stop certsvc+ net start certsvc+ ```++ This allows Infisical to control certificate expiration dates directly.+ </Tab>+ <Tab title="Signing Internal Intermediate CAs">+ In addition to using AD CS as an external CA for direct certificate issuance, you can use AD CS to **sign internal intermediate CAs** in Infisical. This lets you create an Infisical-managed CA hierarchy where the intermediate CA's certificate is issued by your AD CS server, with support for auto-renewal.++ ## How It Works++ 1. Infisical generates a CSR for the intermediate CA.+ 2. The CSR is submitted to AD CS via Web Enrollment using the configured certificate template.+ 3. AD CS signs the certificate.+ 4. Infisical fetches the issuing CA's certificate to build the chain.+ 5. The signed certificate and chain are imported into the intermediate CA.++ <Warning>+ The certificate template must be configured to allow "Supply in the request" for subject information,+ so that the CSR's subject fields are honored.+ </Warning>++ ## Installing an Intermediate CA Certificate via AD CS++ <Tabs>+ <Tab title="Infisical UI">+ <Steps>+ <Step title="Create an Intermediate CA">+ Go to **Certificate Authorities** > **Internal Certificate Authorities** and press **Create CA**.+ Set the type to **Intermediate** and fill out the CA details.+ </Step>+ <Step title="Open the Install Certificate Modal">+ Press **Install CA Certificate** on the intermediate CA. Select **External CA (Automated)** and press **Choose Integration**.+ + </Step>+ <Step title="Select Azure AD CS">+ Choose **Azure AD CS** as the integration provider.+ + </Step>+ <Step title="Configure Signing Details">+ + - **Azure AD CS Connection**: Select your AD CS Connection.+ - **Certificate Template**: The AD CS template name (e.g., `SubCA`).+ - **Validity Period**: Optional TTL (e.g., `365`). Requires `EDITF_ATTRIBUTEENDDATE` on the AD CS server.+ - **Path Length**: Max intermediate CAs below this one (`-1` for no limit, `0` to prevent chaining).+ </Step>+ <Step title="Install">+ Press **Install**. The request is queued and processed asynchronously.+ </Step>+ </Steps>+ </Tab>+ <Tab title="API">+ <Steps>+ <Step title="Create a Signing Configuration">+ ```bash Request+ curl --location --request POST 'https://app.infisical.com/api/v1/cert-manager/ca/internal/<ca-id>/signing-config' \+ --header 'Authorization: Bearer <access-token>' \+ --header 'Content-Type: application/json' \+ --data-raw '{+ "type": "azure-ad-cs",+ "appConnectionId": "<adcs-connection-id>",+ "destinationConfig": {+ "template": "SubCA",+ "validityPeriod": 365+ }+ }'+ ```+ </Step>+ <Step title="Install the Certificate">+ ```bash Request+ curl --location --request POST 'https://app.infisical.com/api/v1/cert-manager/ca/internal/<ca-id>/install-certificate-adcs' \+ --header 'Authorization: Bearer <access-token>' \+ --header 'Content-Type: application/json' \+ --data-raw '{+ "maxPathLength": -1+ }'+ ```++ Returns HTTP 202. Poll the CA details endpoint to check when the certificate has been installed.+ </Step>+ </Steps>+ </Tab>+ </Tabs>++ ## Auto-Renewal++ Infisical supports automatic renewal of intermediate CA certificates signed by AD CS. When enabled, Infisical will automatically submit a new CSR to AD CS and import the renewed certificate before the current one expires.++ <Tabs>+ <Tab title="Infisical UI">+ Navigate to the CA details page of your AD CS-signed intermediate CA. Click the **edit** (pencil) icon in the Details section to open the renewal settings.++ ++ Toggle **Auto-Renewal** on and set the **Days Before Expiry** to configure when the renewal should be triggered.++ + </Tab>+ <Tab title="API">+ ### Enable Auto-Renewal++ ```bash Request+ curl --location --request PATCH 'https://app.infisical.com/api/v1/cert-manager/ca/internal/<ca-id>/auto-renewal' \+ --header 'Authorization: Bearer <access-token>' \+ --header 'Content-Type: application/json' \+ --data-raw '{+ "autoRenewalEnabled": true,+ "autoRenewalDaysBeforeExpiry": 7+ }'+ ```++ ### Sample response++ ```json Response+ {+ "autoRenewalEnabled": true,+ "autoRenewalDaysBeforeExpiry": 7,+ "lastRenewalStatus": null,+ "lastRenewalMessage": null,+ "lastRenewalAt": null+ }+ ```++ <Note>+ - `autoRenewalDaysBeforeExpiry` must be less than the certificate's TTL and at most 30 days+ - Auto-renewal is only available for CAs with an external signing configuration (e.g., AD CS)+ - The renewal status can be checked via the GET auto-renewal endpoint+ </Note>+ </Tab>+ </Tabs>++ ## Manual Renewal++ You can also manually trigger a renewal for an AD CS-signed intermediate CA at any time. Each renewal submits a fresh CSR (AD CS has no renewal API).++ <Tabs>+ <Tab title="Infisical UI">+ Navigate to the CA details page and press the **Renew CA** button.++ ++ The renewal modal will confirm that this CA is configured to use Azure AD CS for signing. Press **Renew via AD CS** to submit a new CSR to AD CS and install the renewed certificate.++ + </Tab>+ <Tab title="API">+ To manually renew an AD CS-signed CA, re-trigger the install flow via the API.++ ```bash Request+ curl --location --request POST 'https://app.infisical.com/api/v1/cert-manager/ca/internal/<ca-id>/install-certificate-adcs' \+ --header 'Authorization: Bearer <access-token>' \+ --header 'Content-Type: application/json' \+ --data-raw '{+ "maxPathLength": -1+ }'+ ```++ This re-triggers the install flow — Infisical will submit a fresh CSR to AD CS and import the renewed certificate.+ </Tab>+ </Tabs>+ </Tab>+</Tabs>## Troubleshootingdiff --git a/docs/documentation/platform/pki/ca/external-ca.mdx b/docs/documentation/platform/pki/ca/external-ca.mdxindex dce40b8979..fb228dd97b 100644--- a/docs/documentation/platform/pki/ca/external-ca.mdx+++ b/docs/documentation/platform/pki/ca/external-ca.mdx@@ -37,7 +37,7 @@ The specific steps and requirements vary depending on the External CA type you cInfisical currently supports the following External CA types out of the box:- [ACME CA](/documentation/platform/pki/ca/acme-ca): An ACME-compatible CA that supports the ACME protocol, such as Let's Encrypt, ZeroSSL, Buypass, DigiCert, Sectigo, etc.-- [Azure ADCS](/documentation/platform/pki/ca/azure-adcs): A Microsoft Active Directory Certificate Services (ADCS) that supports the ADCS protocol.+- [Azure ADCS](/documentation/platform/pki/ca/azure-adcs): Issue certificates and automate the signing and renewal of internal intermediate CA certificates through Microsoft Active Directory Certificate Services (ADCS).- [AWS Private CA](/documentation/platform/pki/ca/aws-pca): An AWS Private Certificate Authority (PCA) for cloud-native private certificate management.- [Venafi TLS Protect Cloud](/documentation/platform/pki/ca/venafi): Automate the signing and renewal of internal intermediate CA certificates through Venafi TLS Protect Cloud.diff --git a/docs/documentation/platform/pki/ca/private-ca.mdx b/docs/documentation/platform/pki/ca/private-ca.mdxindex 8ad362e0f1..2c8d77551c 100644--- a/docs/documentation/platform/pki/ca/private-ca.mdx+++ b/docs/documentation/platform/pki/ca/private-ca.mdx@@ -82,7 +82,7 @@ consisting of an (optional) root CA and an intermediate CA.You will be presented with the installation method selector. Choose how the signing certificate for this CA should be issued:- + <Tabs><Tab title="Infisical CA">@@ -121,11 +121,12 @@ consisting of an (optional) root CA and an intermediate CA.You will be prompted to choose a CA integration provider:- + Infisical currently supports the following external CA providers for signing intermediate CAs:- [Venafi TLS Protect Cloud](/documentation/platform/pki/ca/venafi)+ - [Azure AD CS](/documentation/platform/pki/ca/azure-adcs#signing-internal-intermediate-cas-with-ad-cs)<Note>When using an external CA, the certificate issued by the provider **must** correspond to the CSR generated by Infisical.@@ -274,6 +275,7 @@ consisting of an (optional) root CA and an intermediate CA.You can use an external CA provider to automatically sign the intermediate CA certificate via API. See the provider-specific documentation for the full API workflow:- [Venafi TLS Protect Cloud](/documentation/platform/pki/ca/venafi)+ - [Azure AD CS](/documentation/platform/pki/ca/azure-adcs#signing-internal-intermediate-cas-with-ad-cs)<Note>When using an external CA, the certificate issued by the provider **must** correspond to the CSR generated by Infisical.@@ -293,7 +295,7 @@ In the following steps, we explore how to renew a CA certificate.<Note>- If renewing an intermediate CA chained to an **Infisical CA**, Infisical will automate the process of generating a new certificate for you.- - If renewing an intermediate CA signed by an **external CA provider** (e.g., Venafi), you can configure [auto-renewal](/documentation/platform/pki/ca/venafi#auto-renewal) to automate the process.+ - If renewing an intermediate CA signed by an **external CA provider** (e.g., Venafi, Azure AD CS), you can configure auto-renewal to automate the process. See [Venafi auto-renewal](/documentation/platform/pki/ca/venafi#auto-renewal) or [AD CS auto-renewal](/documentation/platform/pki/ca/azure-adcs#auto-renewal-for-ad-cs-signed-cas).- If renewing an intermediate CA chained to an **external parent CA via manual import**, you'll need to generate a new certificate from the external parent CA and manually import it back.</Note>@@ -351,6 +353,6 @@ In the following steps, we explore how to renew a CA certificate.</Accordion><Accordion title="Does Infisical support chaining an Intermediate CA to an external CA?">Yes. You can either manually obtain a CSR and import the signed certificate, or use an integrated external CA provider- like [Venafi TLS Protect Cloud](/documentation/platform/pki/ca/venafi) to automate the signing process.+ like [Venafi TLS Protect Cloud](/documentation/platform/pki/ca/venafi) or [Azure AD CS](/documentation/platform/pki/ca/azure-adcs#signing-internal-intermediate-cas-with-ad-cs) to automate the signing process.</Accordion></AccordionGroup>diff --git a/docs/documentation/platform/pki/ca/venafi.mdx b/docs/documentation/platform/pki/ca/venafi.mdxindex baf0be7213..e66f7e9a0b 100644--- a/docs/documentation/platform/pki/ca/venafi.mdx+++ b/docs/documentation/platform/pki/ca/venafi.mdx@@ -58,12 +58,12 @@ sequenceDiagram<Step title="Open the Install Certificate Modal">Press the **Install Certificate** option on the intermediate CA you just created. Select **External CA (Automated)** and press **Continue**.- + </Step><Step title="Select Venafi TLS Protect Cloud">Choose **Venafi TLS Protect Cloud** as the CA integration provider and press **Continue**.- + </Step><Step title="Configure the Venafi Signing Details">Fill out the following fields:@@ -256,18 +256,18 @@ You can also manually trigger a renewal for a Venafi-signed intermediate CA at a</Tab><Tab title="API">- To manually renew a Venafi-signed CA, make an API request to the [Renew CA](/api-reference/endpoints/certificate-authorities/internal/renew) API endpoint.+ To manually renew a Venafi-signed CA, re-trigger the install flow via the API.```bash Request- curl --location --request POST 'https://app.infisical.com/api/v1/cert-manager/ca/internal/<intermediate-ca-id>/renew' \+ curl --location --request POST 'https://app.infisical.com/api/v1/cert-manager/ca/internal/<intermediate-ca-id>/install-certificate-venafi' \--header 'Authorization: Bearer <access-token>' \--header 'Content-Type: application/json' \--data-raw '{- "type": "existing"+ "maxPathLength": -1}'```- For Venafi-signed CAs, Infisical will automatically submit the CSR to Venafi and import the renewed certificate.+ This re-triggers the install flow — Infisical will submit a fresh CSR to Venafi and import the renewed certificate.</Tab></Tabs>diff --git a/docs/images/platform/pki/ca/ca-adcs-auto-renewal-modal.png b/docs/images/platform/pki/ca/ca-adcs-auto-renewal-modal.pngnew file mode 100644index 0000000000..a9073a067bBinary files /dev/null and b/docs/images/platform/pki/ca/ca-adcs-auto-renewal-modal.png differdiff --git a/docs/images/platform/pki/ca/ca-adcs-auto-renewal-page.png b/docs/images/platform/pki/ca/ca-adcs-auto-renewal-page.pngnew file mode 100644index 0000000000..0bf774ece1Binary files /dev/null and b/docs/images/platform/pki/ca/ca-adcs-auto-renewal-page.png differdiff --git a/docs/images/platform/pki/ca/ca-adcs-renew-modal.png b/docs/images/platform/pki/ca/ca-adcs-renew-modal.pngnew file mode 100644index 0000000000..f2c9560e2cBinary files /dev/null and b/docs/images/platform/pki/ca/ca-adcs-renew-modal.png differdiff --git a/docs/images/platform/pki/ca/ca-adcs-renew-page.png b/docs/images/platform/pki/ca/ca-adcs-renew-page.pngnew file mode 100644index 0000000000..3543de3ea5Binary files /dev/null and b/docs/images/platform/pki/ca/ca-adcs-renew-page.png differdiff --git a/docs/images/platform/pki/ca/ca-install-adcs-external-select.png b/docs/images/platform/pki/ca/ca-install-adcs-external-select.pngnew file mode 100644index 0000000000..0513fc6d57Binary files /dev/null and b/docs/images/platform/pki/ca/ca-install-adcs-external-select.png differdiff --git a/docs/images/platform/pki/ca/ca-install-adcs-select-method.png b/docs/images/platform/pki/ca/ca-install-adcs-select-method.pngnew file mode 100644index 0000000000..114db47fd9Binary files /dev/null and b/docs/images/platform/pki/ca/ca-install-adcs-select-method.png differdiff --git a/docs/images/platform/pki/ca/ca-install-adcs.png b/docs/images/platform/pki/ca/ca-install-adcs.pngnew file mode 100644index 0000000000..35fa5f76baBinary files /dev/null and b/docs/images/platform/pki/ca/ca-install-adcs.png differdiff --git a/docs/images/platform/pki/ca/ca-install-external-select.png b/docs/images/platform/pki/ca/ca-install-venafi-external-select.pngsimilarity index 100%rename from docs/images/platform/pki/ca/ca-install-external-select.pngrename to docs/images/platform/pki/ca/ca-install-venafi-external-select.pngdiff --git a/docs/images/platform/pki/ca/ca-install-select-method.png b/docs/images/platform/pki/ca/ca-install-venafi-select-method.pngsimilarity index 100%rename from docs/images/platform/pki/ca/ca-install-select-method.pngrename to docs/images/platform/pki/ca/ca-install-venafi-select-method.pngdiff --git a/frontend/src/hooks/api/appConnections/azure-adcs/index.ts b/frontend/src/hooks/api/appConnections/azure-adcs/index.tsnew file mode 100644index 0000000000..b69c251208--- /dev/null+++ b/frontend/src/hooks/api/appConnections/azure-adcs/index.ts@@ -0,0 +1 @@+export * from "./queries";diff --git a/frontend/src/hooks/api/appConnections/azure-adcs/queries.tsx b/frontend/src/hooks/api/appConnections/azure-adcs/queries.tsxnew file mode 100644index 0000000000..2b80cb1aa9--- /dev/null+++ b/frontend/src/hooks/api/appConnections/azure-adcs/queries.tsx@@ -0,0 +1,36 @@+import { useQuery, UseQueryOptions } from "@tanstack/react-query";++import { apiRequest } from "@app/config/request";++import { appConnectionKeys } from "../queries";++const azureAdcsConnectionKeys = {+ all: [...appConnectionKeys.all, "azure-adcs"] as const,+ listTemplates: (connectionId: string) =>+ [...azureAdcsConnectionKeys.all, "templates", connectionId] as const+};++export const useAzureAdcsConnectionListTemplates = (+ connectionId: string,+ options?: Omit<+ UseQueryOptions<+ string[],+ unknown,+ string[],+ ReturnType<typeof azureAdcsConnectionKeys.listTemplates>+ >,+ "queryKey" | "queryFn"+ >+) => {+ return useQuery({+ queryKey: azureAdcsConnectionKeys.listTemplates(connectionId),+ queryFn: async () => {+ const { data } = await apiRequest.get<{ templates: string[] }>(+ `/api/v1/app-connections/azure-adcs/${connectionId}/adcs-templates`+ );++ return data.templates;+ },+ ...options+ });+};diff --git a/frontend/src/hooks/api/ca/enums.tsx b/frontend/src/hooks/api/ca/enums.tsxindex 869bfc6fe3..27dca00c04 100644--- a/frontend/src/hooks/api/ca/enums.tsx+++ b/frontend/src/hooks/api/ca/enums.tsx@@ -42,5 +42,6 @@ export enum CaCapability {export enum CaSigningConfigType {INTERNAL = "internal",MANUAL = "manual",- VENAFI = "venafi"+ VENAFI = "venafi",+ AZURE_ADCS = "azure-ad-cs"}diff --git a/frontend/src/hooks/api/ca/index.tsx b/frontend/src/hooks/api/ca/index.tsxindex a2ff2994c4..c09be81f9f 100644--- a/frontend/src/hooks/api/ca/index.tsx+++ b/frontend/src/hooks/api/ca/index.tsx@@ -15,6 +15,7 @@ export {useDeleteCa,useGenerateCaCertificate,useImportCaCertificate,+ useInstallCaCertificateAdcs,useInstallCaCertificateVenafi,useOrderCertificateWithProfile,useRenewCa,diff --git a/frontend/src/hooks/api/ca/mutations.tsx b/frontend/src/hooks/api/ca/mutations.tsxindex ef97c3fe2d..36106bbc8d 100644--- a/frontend/src/hooks/api/ca/mutations.tsx+++ b/frontend/src/hooks/api/ca/mutations.tsx@@ -242,6 +242,34 @@ export const useInstallCaCertificateVenafi = (projectId: string) => {});};+export const useInstallCaCertificateAdcs = (projectId: string) => {+ const queryClient = useQueryClient();+ return useMutation<+ { message: string; caId: string },+ object,+ { caId: string; maxPathLength?: number }+ >({+ mutationFn: async ({ caId, ...body }) => {+ const { data } = await apiRequest.post<{ message: string; caId: string }>(+ `/api/v1/cert-manager/ca/internal/${caId}/install-certificate-adcs`,+ body+ );+ return data;+ },+ onSuccess: (_, { caId }) => {+ queryClient.invalidateQueries({ queryKey: caKeys.getCaAutoRenewal(caId) });+ queryClient.invalidateQueries({ queryKey: caKeys.getCaSigningConfig(caId) });+ queryClient.invalidateQueries({ queryKey: projectKeys.getProjectCas({ projectId }) });+ queryClient.invalidateQueries({ queryKey: caKeys.getCaById(caId) });+ queryClient.invalidateQueries({ queryKey: caKeys.getCaCert(caId) });+ queryClient.invalidateQueries({ queryKey: caKeys.getCaCerts(caId) });+ queryClient.invalidateQueries({+ queryKey: caKeys.listCasByTypeAndProjectId(CaType.INTERNAL, projectId)+ });+ }+ });+};+export const useCreateCaSigningConfig = () => {const queryClient = useQueryClient();return useMutation<@@ -252,11 +280,7 @@ export const useCreateCaSigningConfig = () => {type: string;parentCaId?: string;appConnectionId?: string;- destinationConfig?: {- applicationId: string;- issuingTemplateId: string;- validityPeriod?: number;- };+ destinationConfig?: Record<string, unknown>;}>({mutationFn: async ({ caId, ...body }) => {@@ -281,11 +305,7 @@ export const useUpdateCaSigningConfig = () => {caId: string;parentCaId?: string;appConnectionId?: string;- destinationConfig?: {- applicationId: string;- issuingTemplateId: string;- validityPeriod?: number;- };+ destinationConfig?: Record<string, unknown>;}>({mutationFn: async ({ caId, ...body }) => {diff --git a/frontend/src/hooks/api/ca/queries.tsx b/frontend/src/hooks/api/ca/queries.tsxindex 5a3e1d1ee7..c629f0fb80 100644--- a/frontend/src/hooks/api/ca/queries.tsx+++ b/frontend/src/hooks/api/ca/queries.tsx@@ -210,11 +210,7 @@ export type TCaSigningConfig = {type: CaSigningConfigType;parentCaId: string | null;appConnectionId: string | null;- destinationConfig: {- applicationId: string;- issuingTemplateId: string;- validityPeriod?: number;- } | null;+ destinationConfig: Record<string, unknown> | null;lastExternalCertificateId: string | null;createdAt: string;updatedAt: string;diff --git a/frontend/src/pages/cert-manager/CertAuthDetailsByIDPage/components/CaCertificatesSection/CaCertificatesSection.tsx b/frontend/src/pages/cert-manager/CertAuthDetailsByIDPage/components/CaCertificatesSection/CaCertificatesSection.tsxindex e894689dfe..e82dae5ca0 100644--- a/frontend/src/pages/cert-manager/CertAuthDetailsByIDPage/components/CaCertificatesSection/CaCertificatesSection.tsx+++ b/frontend/src/pages/cert-manager/CertAuthDetailsByIDPage/components/CaCertificatesSection/CaCertificatesSection.tsx@@ -39,6 +39,11 @@ type Props = {) => void;};+const EXTERNAL_CA_TYPES_WITH_RENEWAL = new Set([+ CaSigningConfigType.VENAFI,+ CaSigningConfigType.AZURE_ADCS+]);+export const CaCertificatesSection = ({ caId, caName, handlePopUpOpen }: Props) => {const { data } = useGetCa({caId,@@ -75,7 +80,9 @@ export const CaCertificatesSection = ({ caId, caName, handlePopUpOpen }: Props)if (ca.configuration.type === InternalCaType.INTERMEDIATE &&!ca.configuration.parentCaId &&- signingConfig?.type !== CaSigningConfigType.VENAFI+ !EXTERNAL_CA_TYPES_WITH_RENEWAL.has(+ signingConfig?.type as CaSigningConfigType+ )) {handlePopUpOpen("installCaCert", {caId: ca.id,diff --git a/frontend/src/pages/cert-manager/CertAuthDetailsByIDPage/components/CaRenewalModal.tsx b/frontend/src/pages/cert-manager/CertAuthDetailsByIDPage/components/CaRenewalModal.tsxindex 10da8b503e..85866c5f01 100644--- a/frontend/src/pages/cert-manager/CertAuthDetailsByIDPage/components/CaRenewalModal.tsx+++ b/frontend/src/pages/cert-manager/CertAuthDetailsByIDPage/components/CaRenewalModal.tsx@@ -17,6 +17,7 @@ import {CaRenewalType,CaSigningConfigType,useGetCaSigningConfig,+ useInstallCaCertificateAdcs,useInstallCaCertificateVenafi,useRenewCa} from "@app/hooks/api/ca";@@ -38,6 +39,40 @@ const schema = zexport type FormData = z.infer<typeof schema>;+type ExternalCaRenewalProps = {+ description: string;+ buttonLabel: string;+ onRenew: () => void;+ isRenewing: boolean;+ onCancel: () => void;+};++const ExternalCaRenewal = ({+ description,+ buttonLabel,+ onRenew,+ isRenewing,+ onCancel+}: ExternalCaRenewalProps) => (+ <div>+ <p className="mb-4 text-sm text-mineshaft-300">{description}</p>+ <div className="flex items-center">+ <Button+ className="mr-4"+ size="sm"+ onClick={onRenew}+ isLoading={isRenewing}+ isDisabled={isRenewing}+ >+ {buttonLabel}+ </Button>+ <Button colorSchema="secondary" variant="plain" onClick={onCancel}>+ Cancel+ </Button>+ </div>+ </div>+);+type Props = {popUp: UsePopUpState<["renewCa"]>;handlePopUpToggle: (popUpName: keyof UsePopUpState<["renewCa"]>, state?: boolean) => void;@@ -58,10 +93,14 @@ export const CaRenewalModal = ({ popUp, handlePopUpToggle }: Props) => {});const isVenafi = signingConfig?.type === CaSigningConfigType.VENAFI;+ const isAdcs = signingConfig?.type === CaSigningConfigType.AZURE_ADCS;const { mutateAsync: renewCa } = useRenewCa();const { mutateAsync: installVenafiCert, isPending: isVenafiRenewing } =useInstallCaCertificateVenafi(currentProject.id);+ const { mutateAsync: installAdcsCert, isPending: isAdcsRenewing } = useInstallCaCertificateAdcs(+ currentProject.id+ );const {control,@@ -129,6 +168,30 @@ export const CaRenewalModal = ({ popUp, handlePopUpToggle }: Props) => {}};+ const onAdcsRenew = async () => {+ if (!caId) return;++ try {+ await installAdcsCert({+ caId+ });++ handlePopUpToggle("renewCa", false);++ createNotification({+ text: "Certificate renewal has been queued",+ type: "success"+ });+ } catch (err) {+ createNotification({+ text:+ (err as { response?: { data?: { message?: string } } })?.response?.data?.message ||+ "Failed to renew CA certificate via ADCS",+ type: "error"+ });+ }+ };+return (<ModalisOpen={popUp?.renewCa?.isOpen}@@ -138,31 +201,18 @@ export const CaRenewalModal = ({ popUp, handlePopUpToggle }: Props) => {}}><ModalContent title="Renew CA">- {isVenafi ? (- <div>- <p className="mb-4 text-sm text-mineshaft-300">- This CA is configured to use Venafi TLS Protect Cloud for signing. Clicking renew will- submit a new CSR to Venafi and install the renewed certificate.- </p>- <div className="flex items-center">- <Button- className="mr-4"- size="sm"- onClick={onVenafiRenew}- isLoading={isVenafiRenewing}- isDisabled={isVenafiRenewing}- >- Renew via Venafi- </Button>- <Button- colorSchema="secondary"- variant="plain"- onClick={() => handlePopUpToggle("renewCa", false)}- >- Cancel- </Button>- </div>- </div>+ {isVenafi || isAdcs ? (+ <ExternalCaRenewal+ description={+ isVenafi+ ? "This CA is configured to use Venafi TLS Protect Cloud for signing. Clicking renew will submit a new CSR to Venafi and install the renewed certificate."+ : "This CA is configured to use Azure ADCS for signing. Clicking renew will submit a new CSR to ADCS and install the renewed certificate."+ }+ buttonLabel={isVenafi ? "Renew via Venafi" : "Renew via ADCS"}+ onRenew={isVenafi ? onVenafiRenew : onAdcsRenew}+ isRenewing={isVenafi ? isVenafiRenewing : isAdcsRenewing}+ onCancel={() => handlePopUpToggle("renewCa", false)}+ />) : (<form onSubmit={handleSubmit(onFormSubmit)}><Controllerdiff --git a/frontend/src/pages/cert-manager/CertAuthDetailsByIDPage/components/CaSigningConfigSection.tsx b/frontend/src/pages/cert-manager/CertAuthDetailsByIDPage/components/CaSigningConfigSection.tsxindex fb24c96034..90d7952108 100644--- a/frontend/src/pages/cert-manager/CertAuthDetailsByIDPage/components/CaSigningConfigSection.tsx+++ b/frontend/src/pages/cert-manager/CertAuthDetailsByIDPage/components/CaSigningConfigSection.tsx@@ -47,6 +47,7 @@ import {TAvailableAppConnection,useListAvailableAppConnections} from "@app/hooks/api/appConnections";+import { useAzureAdcsConnectionListTemplates } from "@app/hooks/api/appConnections/azure-adcs";import { AppConnection } from "@app/hooks/api/appConnections/enums";import {TVenafiApplication,@@ -64,7 +65,8 @@ type Props = {const signingTypeLabels: Record<CaSigningConfigType, string> = {[CaSigningConfigType.INTERNAL]: "Internal (Infisical CA)",[CaSigningConfigType.MANUAL]: "Manual",- [CaSigningConfigType.VENAFI]: "Venafi TLS Protect Cloud"+ [CaSigningConfigType.VENAFI]: "Venafi TLS Protect Cloud",+ [CaSigningConfigType.AZURE_ADCS]: "Azure AD CS"};const getSigningTypeBadgeVariant = (type: CaSigningConfigType) => {@@ -86,6 +88,19 @@ const editSchema = z.object({type EditFormData = z.infer<typeof editSchema>;+const adcsEditSchema = z.object({+ appConnectionId: z.string().min(1, "App connection is required"),+ template: z.string().min(1, "Certificate template is required"),+ validityPeriod: z.coerce+ .number()+ .int()+ .min(1, "Must be at least 1 day")+ .optional()+ .or(z.literal(""))+});++type AdcsEditFormData = z.infer<typeof adcsEditSchema>;+export const CaSigningConfigSection = ({ caId }: Props) => {const { currentProject } = useProject();const { popUp, handlePopUpToggle } = usePopUp(["editSigningConfig"] as const);@@ -114,9 +129,9 @@ export const CaSigningConfigSection = ({ caId }: Props) => {resolver: zodResolver(editSchema),values: {appConnectionId: signingConfig?.appConnectionId ?? "",- applicationId: signingConfig?.destinationConfig?.applicationId ?? "",- issuingTemplateId: signingConfig?.destinationConfig?.issuingTemplateId ?? "",- validityPeriod: signingConfig?.destinationConfig?.validityPeriod ?? ""+ applicationId: (signingConfig?.destinationConfig?.applicationId as string) ?? "",+ issuingTemplateId: (signingConfig?.destinationConfig?.issuingTemplateId as string) ?? "",+ validityPeriod: (signingConfig?.destinationConfig?.validityPeriod as number | undefined) ?? ""}});@@ -124,7 +139,9 @@ export const CaSigningConfigSection = ({ caId }: Props) => {const selectedApplicationId = watch("applicationId");const { data: availableVenafiConnections, isPending: isVenafiPending } =- useListAvailableAppConnections(AppConnection.Venafi, currentProject.id);+ useListAvailableAppConnections(AppConnection.Venafi, currentProject.id, {+ enabled: signingConfig?.type === CaSigningConfigType.VENAFI+ });const { data: applications = [], isPending: isApplicationsLoading } =useVenafiConnectionListApplications(selectedConnectionId ?? "", {@@ -140,11 +157,39 @@ export const CaSigningConfigSection = ({ caId }: Props) => {});+ const { data: availableAdcsConnections, isPending: isAdcsConnectionsPending } =+ useListAvailableAppConnections(AppConnection.AzureADCS, currentProject.id, {+ enabled: signingConfig?.type === CaSigningConfigType.AZURE_ADCS+ });++ const {+ control: adcsControl,+ handleSubmit: handleAdcsSubmit,+ reset: adcsReset,+ watch: adcsWatch,+ formState: { isSubmitting: isAdcsSubmitting }+ } = useForm<AdcsEditFormData>({+ resolver: zodResolver(adcsEditSchema),+ values: {+ appConnectionId: signingConfig?.appConnectionId ?? "",+ template: (signingConfig?.destinationConfig?.template as string) ?? "",+ validityPeriod: (signingConfig?.destinationConfig?.validityPeriod as number | undefined) ?? ""+ }+ });++ const selectedAdcsConnectionId = adcsWatch("appConnectionId");++ const { data: adcsTemplates = [], isPending: isAdcsTemplatesLoading } =+ useAzureAdcsConnectionListTemplates(selectedAdcsConnectionId ?? "", {+ enabled: !!selectedAdcsConnectionId && popUp.editSigningConfig.isOpen+ });+if (!ca || ca.status === CaStatus.PENDING_CERTIFICATE || !signingConfig) {return null;}const isVenafi = signingConfig.type === CaSigningConfigType.VENAFI;+ const isAdcs = signingConfig.type === CaSigningConfigType.AZURE_ADCS;const onEditSubmit = async ({appConnectionId,@@ -183,7 +228,7 @@ export const CaSigningConfigSection = ({ caId }: Props) => {<UnstableCardDescription>How this CA's certificate is signed</UnstableCardDescription>- {isVenafi && ca?.name && (+ {(isVenafi || isAdcs) && ca?.name && (<UnstableCardAction><ProjectPermissionCanI={ProjectPermissionCertificateAuthorityActions.Edit}@@ -218,16 +263,39 @@ export const CaSigningConfigSection = ({ caId }: Props) => {<><Detail><DetailLabel>Application ID</DetailLabel>- <DetailValue>{signingConfig.destinationConfig.applicationId}</DetailValue>+ <DetailValue>+ {signingConfig.destinationConfig.applicationId as string}+ </DetailValue></Detail><Detail><DetailLabel>Issuing Template ID</DetailLabel>- <DetailValue>{signingConfig.destinationConfig.issuingTemplateId}</DetailValue>+ <DetailValue>+ {signingConfig.destinationConfig.issuingTemplateId as string}+ </DetailValue></Detail>{signingConfig.destinationConfig.validityPeriod && (<Detail><DetailLabel>Validity Period</DetailLabel>- <DetailValue>{signingConfig.destinationConfig.validityPeriod} days</DetailValue>+ <DetailValue>+ {signingConfig.destinationConfig.validityPeriod as number} days+ </DetailValue>+ </Detail>+ )}+ </>+ )}++ {isAdcs && signingConfig.destinationConfig && (+ <>+ <Detail>+ <DetailLabel>Certificate Template</DetailLabel>+ <DetailValue>{signingConfig.destinationConfig.template as string}</DetailValue>+ </Detail>+ {signingConfig.destinationConfig.validityPeriod && (+ <Detail>+ <DetailLabel>Validity Period</DetailLabel>+ <DetailValue>+ {signingConfig.destinationConfig.validityPeriod as number} days+ </DetailValue></Detail>)}</>@@ -236,6 +304,132 @@ export const CaSigningConfigSection = ({ caId }: Props) => {</UnstableCardContent></UnstableCard>+ {isAdcs && (+ <Modal+ isOpen={popUp.editSigningConfig.isOpen}+ onOpenChange={(isOpen) => {+ handlePopUpToggle("editSigningConfig", isOpen);+ if (!isOpen) adcsReset();+ }}+ >+ <ModalContent title="Edit Signing Configuration" bodyClassName="overflow-visible">+ <form+ onSubmit={handleAdcsSubmit(+ async ({ appConnectionId, template, validityPeriod }: AdcsEditFormData) => {+ try {+ await updateSigningConfig({+ caId,+ appConnectionId,+ destinationConfig: {+ template,+ ...(typeof validityPeriod === "number" && { validityPeriod })+ }+ });+ createNotification({+ text: "Signing configuration updated",+ type: "success"+ });+ handlePopUpToggle("editSigningConfig", false);+ } catch {+ createNotification({+ text: "Failed to update signing configuration",+ type: "error"+ });+ }+ }+ )}+ >+ <Controller+ control={adcsControl}+ name="appConnectionId"+ render={({ field: { onChange, value }, fieldState: { error } }) => (+ <FormControl+ label="Azure AD CS Connection"+ errorText={error?.message}+ isError={Boolean(error)}+ isRequired+ >+ <FilterableSelect+ isLoading={isAdcsConnectionsPending}+ value={(availableAdcsConnections || []).find((conn) => conn.id === value)}+ onChange={(option) => {+ const selected = option as SingleValue<TAvailableAppConnection>;+ onChange(selected?.id ?? "");+ }}+ options={availableAdcsConnections || []}+ placeholder="Select an Azure AD CS connection..."+ getOptionLabel={(option) => option.name}+ getOptionValue={(option) => option.id}+ />+ </FormControl>+ )}+ />+ <Controller+ control={adcsControl}+ name="template"+ render={({ field: { onChange, value }, fieldState: { error } }) => (+ <FormControl+ label="Certificate Template"+ errorText={error?.message}+ isError={Boolean(error)}+ isRequired+ >+ <FilterableSelect+ isLoading={isAdcsTemplatesLoading && !!selectedAdcsConnectionId}+ isDisabled={!selectedAdcsConnectionId}+ value={+ adcsTemplates.find((t) => t === value) ? { label: value, value } : null+ }+ onChange={(option) => {+ const selected = option as SingleValue<{ label: string; value: string }>;+ onChange(selected?.value ?? "");+ }}+ options={adcsTemplates.map((t) => ({ label: t, value: t }))}+ placeholder={+ selectedAdcsConnectionId+ ? "Select a template..."+ : "Select a connection first"+ }+ getOptionLabel={(option) => option.label}+ getOptionValue={(option) => option.value}+ />+ </FormControl>+ )}+ />+ <Controller+ control={adcsControl}+ name="validityPeriod"+ render={({ field, fieldState: { error } }) => (+ <FormControl+ label="Validity Period (Days)"+ errorText={error?.message}+ isError={Boolean(error)}+ helperText="Number of days the certificate should be valid"+ >+ <Input {...field} type="number" placeholder="365" />+ </FormControl>+ )}+ />+ <div className="flex w-full justify-between gap-4 pt-4">+ <ModalClose asChild>+ <ButtonV2 colorSchema="secondary" variant="plain">+ Cancel+ </ButtonV2>+ </ModalClose>+ <ButtonV2+ isLoading={isAdcsSubmitting}+ isDisabled={isAdcsSubmitting}+ type="submit"+ colorSchema="secondary"+ >+ Save+ </ButtonV2>+ </div>+ </form>+ </ModalContent>+ </Modal>+ )}+{isVenafi && (<ModalisOpen={popUp.editSigningConfig.isOpen}diff --git a/frontend/src/pages/cert-manager/CertificateAuthoritiesPage/components/CaInstallCertModal/AdcsCaInstallForm.tsx b/frontend/src/pages/cert-manager/CertificateAuthoritiesPage/components/CaInstallCertModal/AdcsCaInstallForm.tsxnew file mode 100644index 0000000000..c1e965f5a8--- /dev/null+++ b/frontend/src/pages/cert-manager/CertificateAuthoritiesPage/components/CaInstallCertModal/AdcsCaInstallForm.tsx@@ -0,0 +1,235 @@+import { Controller, useForm } from "react-hook-form";+import { SingleValue } from "react-select";+import { zodResolver } from "@hookform/resolvers/zod";+import { z } from "zod";++import { createNotification } from "@app/components/notifications";+import {+ Button,+ FilterableSelect,+ FormControl,+ Input,+ Select,+ SelectItem+} from "@app/components/v2";+import { useProject } from "@app/context";+import {+ CaSigningConfigType,+ useCreateCaSigningConfig,+ useGetCaSigningConfig,+ useInstallCaCertificateAdcs,+ useUpdateCaSigningConfig+} from "@app/hooks/api";+import {+ TAvailableAppConnection,+ useListAvailableAppConnections+} from "@app/hooks/api/appConnections";+import { useAzureAdcsConnectionListTemplates } from "@app/hooks/api/appConnections/azure-adcs";+import { AppConnection } from "@app/hooks/api/appConnections/enums";+import { UsePopUpState } from "@app/hooks/usePopUp";++const schema = z.object({+ appConnectionId: z.string().min(1, "App connection is required"),+ template: z.string().min(1, "Certificate template is required"),+ validityPeriod: z.coerce+ .number()+ .int()+ .min(1, "Must be at least 1 day")+ .optional()+ .or(z.literal("")),+ maxPathLength: z.string()+});++type FormData = z.infer<typeof schema>;++type Props = {+ caId: string;+ handlePopUpToggle: (popUpName: keyof UsePopUpState<["installCaCert"]>, state?: boolean) => void;+};++export const AdcsCaInstallForm = ({ caId, handlePopUpToggle }: Props) => {+ const { currentProject } = useProject();++ const { data: availableAdcsConnections, isPending: isAdcsPending } =+ useListAvailableAppConnections(AppConnection.AzureADCS, currentProject.id);++ const {+ control,+ handleSubmit,+ reset,+ watch,+ formState: { isSubmitting }+ } = useForm<FormData>({+ resolver: zodResolver(schema),+ defaultValues: {+ maxPathLength: "-1"+ }+ });++ const selectedConnectionId = watch("appConnectionId");++ const { data: templates = [], isPending: isTemplatesLoading } =+ useAzureAdcsConnectionListTemplates(selectedConnectionId ?? "", {+ enabled: !!selectedConnectionId+ });++ const { data: existingSigningConfig } = useGetCaSigningConfig(caId, { enabled: !!caId });+ const { mutateAsync: createSigningConfig } = useCreateCaSigningConfig();+ const { mutateAsync: updateSigningConfig } = useUpdateCaSigningConfig();+ const { mutateAsync: installAdcsCert } = useInstallCaCertificateAdcs(currentProject.id);++ const onFormSubmit = async ({+ appConnectionId,+ template,+ validityPeriod,+ maxPathLength+ }: FormData) => {+ if (!caId) return;++ try {+ const destinationConfig = {+ template,+ ...(typeof validityPeriod === "number" && { validityPeriod })+ };++ if (existingSigningConfig?.type === CaSigningConfigType.AZURE_ADCS) {+ await updateSigningConfig({+ caId,+ appConnectionId,+ destinationConfig+ });+ } else {+ await createSigningConfig({+ caId,+ type: CaSigningConfigType.AZURE_ADCS,+ appConnectionId,+ destinationConfig+ });+ }++ await installAdcsCert({+ caId,+ maxPathLength: Number(maxPathLength)+ });++ reset();+ handlePopUpToggle("installCaCert", false);+ createNotification({+ text: "Certificate installation has been queued",+ type: "success"+ });+ } catch (err) {+ createNotification({+ text:+ (err as { response?: { data?: { message?: string } } })?.response?.data?.message ||+ "Failed to install certificate via Azure AD CS",+ type: "error"+ });+ }+ };++ return (+ <form onSubmit={handleSubmit(onFormSubmit)}>+ <Controller+ control={control}+ name="appConnectionId"+ render={({ field: { onChange, value }, fieldState: { error } }) => (+ <FormControl+ label="Azure AD CS Connection"+ errorText={error?.message}+ isError={Boolean(error)}+ isRequired+ >+ <FilterableSelect+ isLoading={isAdcsPending}+ value={(availableAdcsConnections || []).find((conn) => conn.id === value)}+ onChange={(option) => {+ const selected = option as SingleValue<TAvailableAppConnection>;+ onChange(selected?.id ?? "");+ }}+ options={availableAdcsConnections || []}+ placeholder="Select an Azure AD CS connection..."+ getOptionLabel={(option) => option.name}+ getOptionValue={(option) => option.id}+ />+ </FormControl>+ )}+ />+ <Controller+ control={control}+ name="template"+ render={({ field: { onChange, value }, fieldState: { error } }) => (+ <FormControl+ label="Certificate Template"+ errorText={error?.message}+ isError={Boolean(error)}+ isRequired+ >+ <FilterableSelect+ isLoading={isTemplatesLoading && !!selectedConnectionId}+ isDisabled={!selectedConnectionId}+ value={templates.find((t) => t === value) ? { label: value, value } : null}+ onChange={(option) => {+ const selected = option as SingleValue<{ label: string; value: string }>;+ onChange(selected?.value ?? "");+ }}+ options={templates.map((t) => ({ label: t, value: t }))}+ placeholder={+ selectedConnectionId ? "Select a template..." : "Select a connection first"+ }+ getOptionLabel={(option) => option.label}+ getOptionValue={(option) => option.value}+ />+ </FormControl>+ )}+ />+ <Controller+ control={control}+ name="validityPeriod"+ render={({ field, fieldState: { error } }) => (+ <FormControl+ label="Validity Period (Days)"+ errorText={error?.message}+ isError={Boolean(error)}+ helperText="Number of days the certificate should be valid"+ >+ <Input {...field} type="number" placeholder="365" />+ </FormControl>+ )}+ />+ <Controller+ control={control}+ name="maxPathLength"+ render={({ field: { onChange, ...field }, fieldState: { error } }) => (+ <FormControl label="Path Length" errorText={error?.message} isError={Boolean(error)}>+ <Select {...field} onValueChange={onChange} className="w-full">+ {[-1, 0, 1, 2, 3].map((value) => (+ <SelectItem value={String(value)} key={`ca-path-length-${value}`}>+ {String(value)}+ </SelectItem>+ ))}+ </Select>+ </FormControl>+ )}+ />+ <div className="flex items-center">+ <Button+ className="mr-4"+ size="sm"+ type="submit"+ isLoading={isSubmitting}+ isDisabled={isSubmitting}+ >+ Install+ </Button>+ <Button+ colorSchema="secondary"+ variant="plain"+ onClick={() => handlePopUpToggle("installCaCert", false)}+ >+ Cancel+ </Button>+ </div>+ </form>+ );+};diff --git a/frontend/src/pages/cert-manager/CertificateAuthoritiesPage/components/CaInstallCertModal/CaInstallCertModal.tsx b/frontend/src/pages/cert-manager/CertificateAuthoritiesPage/components/CaInstallCertModal/CaInstallCertModal.tsxindex 4362ec8df7..ef54d5db42 100644--- a/frontend/src/pages/cert-manager/CertificateAuthoritiesPage/components/CaInstallCertModal/CaInstallCertModal.tsx+++ b/frontend/src/pages/cert-manager/CertificateAuthoritiesPage/components/CaInstallCertModal/CaInstallCertModal.tsx@@ -11,6 +11,7 @@ import { Modal, ModalContent } from "@app/components/v2";import { Badge, Button } from "@app/components/v3";import { UsePopUpState } from "@app/hooks/usePopUp";+import { AdcsCaInstallForm } from "./AdcsCaInstallForm";import { ExternalCaInstallForm } from "./ExternalCaInstallForm";import { InternalCaInstallForm } from "./InternalCaInstallForm";import { VenafiCaInstallForm } from "./VenafiCaInstallForm";@@ -70,6 +71,12 @@ const INTEGRATIONS: TIntegration[] = [name: "Venafi TLS Protect Cloud",description: "Automated certificate lifecycle management",image: "/images/integrations/Venafi.png"+ },+ {+ id: "azure-adcs",+ name: "Azure AD CS",+ description: "Microsoft Active Directory Certificate Services",+ image: "/images/integrations/Microsoft Azure.png"}];@@ -165,7 +172,13 @@ export const CaInstallCertModal = ({ popUp, handlePopUpToggle }: Props) => {case SigningMethod.Internal:return <InternalCaInstallForm caId={caId} handlePopUpToggle={handlePopUpToggle} />;case SigningMethod.Automated:- return <VenafiCaInstallForm caId={caId} handlePopUpToggle={handlePopUpToggle} />;+ if (selectedIntegration === "azure-adcs") {+ return <AdcsCaInstallForm caId={caId} handlePopUpToggle={handlePopUpToggle} />;+ }+ if (selectedIntegration === "venafi") {+ return <VenafiCaInstallForm caId={caId} handlePopUpToggle={handlePopUpToggle} />;+ }+ return null;case SigningMethod.Manual:return <ExternalCaInstallForm caId={caId} handlePopUpToggle={handlePopUpToggle} />;default:diff --git a/frontend/src/pages/organization/AppConnections/AppConnectionsPage/components/AppConnectionForm/AzureADCSConnectionForm.tsx b/frontend/src/pages/organization/AppConnections/AppConnectionsPage/components/AppConnectionForm/AzureADCSConnectionForm.tsxindex fc2bb214b4..4cd6b3d5d5 100644--- a/frontend/src/pages/organization/AppConnections/AppConnectionsPage/components/AppConnectionForm/AzureADCSConnectionForm.tsx+++ b/frontend/src/pages/organization/AppConnections/AppConnectionsPage/components/AppConnectionForm/AzureADCSConnectionForm.tsx@@ -172,7 +172,7 @@ export const AzureADCSConnectionForm = ({ appConnection, onSubmit }: Props) => {isError={Boolean(error?.message)}label="ADCS URL">- <Input {...field} placeholder="https://your-adcs-server.com/certsrv" />+ <Input {...field} placeholder="https://your-adcs-server.com" /></FormControl>)}/>