Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.
TypeScript acmeagentsai-agentscertificate-managementdevsecopsenvironment-variableskubernetesopen-sourcepampkipostgresprivate-caprivileged-access-managementsecret-managementsecret-managersecretssecrets-managementsecuritysecurity-toolsvault
Address PR comments
Carlos Monastyrski677c345cb791
diff --git a/backend/CLAUDE.md b/backend/CLAUDE.mdindex bf42bba26f..0c3e7a2183 100644--- a/backend/CLAUDE.md+++ b/backend/CLAUDE.md@@ -871,12 +871,14 @@ what an anonymous caller can cost us.them re-caches a pre-revocation `good` for the full validity window, or answers for a CA whose OCSP wasjust switched off. Use `getItemPrimary` and pass a `primaryNode()` as the `tx`.- **Invalidation is a Postgres counter, not a Redis write.** `internal_certificate_authorities.ocspGeneration`- is bumped in the *same transaction* as the write that changes a status: the revoke, the single delete, and- the bulk cleanup delete. Each cached entry records the generation it was signed under and a read rejects a- mismatch, so nothing has to delete a key and a Redis outage cannot leave a revoked certificate reading- `good`. The responder already reads the CA row from the primary every request, so comparing it is free.- A new path that deletes or revokes a certificate must bump it too, or it will serve a stale `good` for up- to an hour. Only single-certID responses are cached; multi-certID requests are answered but never cached.+ is bumped in the *same transaction* as the certificate status write in `revokeCert`, which is the only+ place a certificate becomes revoked. Each cached entry records the generation it was signed under and a+ read rejects a mismatch, so nothing has to delete a key and a Redis outage cannot leave a revoked+ certificate reading `good`. The responder already reads the CA row from the primary every request, so+ comparing it is free. A new path that revokes a certificate must bump it too. Deleting a certificate does+ not, and neither does the expiry cleanup: deletion is not revocation, so a cached `good` for a certificate+ nobody revoked is still true, and bumping would flush every live certificate's cached response on that CA+ for nothing. Only single-certID responses are cached; multi-certID requests are answered but never cached.Do not reintroduce a best-effort invalidation call after the commit: that is exactly the shape that failedreview, because a failure there is unrecoverable and silent.- **Concurrent misses coalesce into one signing.** `inFlightResponses` keys on the cache key plus the@@ -888,8 +890,10 @@ what an anonymous caller can cost us.- **Never take the hash OID out of a CertID without checking `OCSP_HASH_NAME_BY_OID` first.** An OID is anunbounded dotted-decimal string and it keys the per-CA issuer-hash memo, so an unvalidated one isunbounded attacker-controlled heap.-- **Signing is capped three ways and sheds with `tryLater`**: globally, per CA, and in aggregate across- every CA (`OCSP_SIGNING_MAX_TOTAL_IN_FLIGHT`, checked before a per-CA limiter is created or entered). The+- **Signing is capped three ways and sheds with `tryLater`**: globally (4), per CA (2), and in aggregate+ across every CA (`OCSP_SIGNING_MAX_TOTAL_IN_FLIGHT`, checked before a per-CA limiter is created or+ entered). The global cap matches libuv's default threadpool of 4, where `crypto.subtle.sign` runs, so+ OCSP never needs more than the pool that password hashing, KMS decrypts and DNS lookups share. Theper-CA tier stops one tenant's traffic shedding everyone else's, but on its own it multiplies how manyrequests are parked at once, because a caller choosing to spray across many valid CA ids gets a freshqueue per id. The aggregate cap is what bounds that, and it is deliberately far above any single CA'sdiff --git a/backend/src/ee/services/certificate-authority-ocsp/certificate-authority-ocsp-coalescing.test.ts b/backend/src/ee/services/certificate-authority-ocsp/certificate-authority-ocsp-coalescing.test.tsindex 503d705a23..5f047df485 100644--- a/backend/src/ee/services/certificate-authority-ocsp/certificate-authority-ocsp-coalescing.test.ts+++ b/backend/src/ee/services/certificate-authority-ocsp/certificate-authority-ocsp-coalescing.test.ts@@ -87,7 +87,6 @@ const buildHarness = async () => {const service = certificateAuthorityOcspServiceFactory({certificateAuthorityDAL: {- primaryNode: vi.fn(() => undefined),findByIdWithAssociatedCa: vi.fn(async () => ({id: caId,projectId: "project-1",diff --git a/backend/src/ee/services/certificate-authority-ocsp/certificate-authority-ocsp-enums.ts b/backend/src/ee/services/certificate-authority-ocsp/certificate-authority-ocsp-enums.tsindex 1799aaeda2..99467dff63 100644--- a/backend/src/ee/services/certificate-authority-ocsp/certificate-authority-ocsp-enums.ts+++ b/backend/src/ee/services/certificate-authority-ocsp/certificate-authority-ocsp-enums.ts@@ -33,8 +33,8 @@ export const OCSP_MAX_NONCE_BYTES = 32;export const OCSP_RESPONSE_VALIDITY_SECONDS = 60 * 60;export const OCSP_UNKNOWN_RESPONSE_VALIDITY_SECONDS = 60;export const STORED_SERIAL_HEX_LENGTH = 40;-export const OCSP_MAX_CONCURRENT_SIGNATURES = 8;-export const OCSP_MAX_CONCURRENT_SIGNATURES_PER_CA = 4;+export const OCSP_MAX_CONCURRENT_SIGNATURES = 4;+export const OCSP_MAX_CONCURRENT_SIGNATURES_PER_CA = 2;export const OCSP_SIGNING_QUEUE_TIMEOUT_MS = 5_000;export const OCSP_SIGNING_MAX_QUEUE_DEPTH = 64;export const OCSP_MAX_TRACKED_CA_LIMITERS = 256;diff --git a/backend/src/ee/services/certificate-authority-ocsp/certificate-authority-ocsp-service.ts b/backend/src/ee/services/certificate-authority-ocsp/certificate-authority-ocsp-service.tsindex cf90c76ace..08e7ba320b 100644--- a/backend/src/ee/services/certificate-authority-ocsp/certificate-authority-ocsp-service.ts+++ b/backend/src/ee/services/certificate-authority-ocsp/certificate-authority-ocsp-service.ts@@ -51,7 +51,7 @@ import {} from "./certificate-authority-ocsp-types";type TCertificateAuthorityOcspServiceFactoryDep = {- certificateAuthorityDAL: Pick<TCertificateAuthorityDALFactory, "findByIdWithAssociatedCa" | "primaryNode">;+ certificateAuthorityDAL: Pick<TCertificateAuthorityDALFactory, "findByIdWithAssociatedCa">;certificateAuthorityCertDAL: Pick<TCertificateAuthorityCertDALFactory, "findById">;certificateAuthoritySecretDAL: Pick<TCertificateAuthoritySecretDALFactory, "findOne">;certificateDAL: Pick<TCertificateDALFactory, "find" | "primaryNode">;@@ -189,7 +189,7 @@ export const certificateAuthorityOcspServiceFactory = ({const $resolveAuthoritativeCa = async (caId: string, entries: TParsedOcspRequestEntry[]) => {const ca = await certificateAuthorityDAL- .findByIdWithAssociatedCa(caId, certificateAuthorityDAL.primaryNode())+ .findByIdWithAssociatedCa(caId, certificateDAL.primaryNode()).catch((error) => {if (error instanceof NotFoundError) return null;throw error;diff --git a/backend/src/server/config/rateLimiter.ts b/backend/src/server/config/rateLimiter.tsindex ca5ee0f63f..8b27ccfbfd 100644--- a/backend/src/server/config/rateLimiter.ts+++ b/backend/src/server/config/rateLimiter.ts@@ -46,7 +46,7 @@ export const writeLimit: RateLimitOptions = {export const ocspLimit: RateLimitOptions = {timeWindow: 60 * 1000,hook: "preValidation",- max: 6000,+ max: 600,keyGenerator: (req) => req.realIp};diff --git a/backend/src/server/routes/index.ts b/backend/src/server/routes/index.tsindex 298223a989..feae834471 100644--- a/backend/src/server/routes/index.ts+++ b/backend/src/server/routes/index.ts@@ -2947,7 +2947,6 @@ export const registerRoutes = async (certificateCleanupConfigDAL,certificateDAL,certificateRequestDAL,- internalCertificateAuthorityDAL,auditLogService,telemetryService});diff --git a/backend/src/services/certificate-authority/certificate-authority-dal.ts b/backend/src/services/certificate-authority/certificate-authority-dal.tsindex 2fa7631ef4..2230bce918 100644--- a/backend/src/services/certificate-authority/certificate-authority-dal.ts+++ b/backend/src/services/certificate-authority/certificate-authority-dal.ts@@ -413,11 +413,8 @@ export const certificateAuthorityDALFactory = (db: TDbClient) => {}};- const primaryNode = () => db.primaryNode();-return {...caOrm,- primaryNode,findWithAssociatedCa,buildCertificateChain,findByIdWithAssociatedCa,diff --git a/backend/src/services/certificate-cleanup/certificate-cleanup-queue.ts b/backend/src/services/certificate-cleanup/certificate-cleanup-queue.tsindex 42ac6d5e57..7e651415d4 100644--- a/backend/src/services/certificate-cleanup/certificate-cleanup-queue.ts+++ b/backend/src/services/certificate-cleanup/certificate-cleanup-queue.ts@@ -10,7 +10,6 @@ import { QueueJobs } from "@app/queue";import { ActorType } from "@app/services/auth/auth-type";import { TCertificateDALFactory } from "../certificate/certificate-dal";-import { TInternalCertificateAuthorityDALFactory } from "../certificate-authority/internal/internal-certificate-authority-dal";import { TCertificateRequestDALFactory } from "../certificate-request/certificate-request-dal";import { TTelemetryServiceFactory } from "../telemetry/telemetry-service";import { PostHogEventTypes } from "../telemetry/telemetry-types";@@ -23,7 +22,6 @@ type TCertificateCleanupQueueFactoryDep = {certificateCleanupConfigDAL: TCertificateCleanupConfigDALFactory;certificateDAL: Pick<TCertificateDALFactory, "delete">;certificateRequestDAL: Pick<TCertificateRequestDALFactory, "delete">;- internalCertificateAuthorityDAL: Pick<TInternalCertificateAuthorityDALFactory, "update">;auditLogService: Pick<TAuditLogServiceFactory, "createAuditLog">;telemetryService: Pick<TTelemetryServiceFactory, "sendPostHogEvents">;};@@ -36,7 +34,6 @@ export const certificateCleanupQueueFactory = ({certificateCleanupConfigDAL,certificateDAL,certificateRequestDAL,- internalCertificateAuthorityDAL,auditLogService,telemetryService}: TCertificateCleanupQueueFactoryDep) => {@@ -119,18 +116,7 @@ export const certificateCleanupQueueFactory = ({try {const deleted = await certificateCleanupConfigDAL.transaction(async (tx) => {await certificateRequestDAL.delete({ $in: { certificateId: idsToDelete } }, tx);- const removed = await certificateDAL.delete({ $in: { id: idsToDelete } }, tx);-- const caIds = [...new Set(removed.map((cert) => cert.caId).filter(Boolean))] as string[];- if (caIds.length > 0) {- await internalCertificateAuthorityDAL.update(- { $in: { caId: caIds } },- { $incr: { ocspGeneration: 1 } },- tx- );- }-- return removed;+ return certificateDAL.delete({ $in: { id: idsToDelete } }, tx);});deletedCount += deleted.length;diff --git a/backend/src/services/certificate/certificate-service.ts b/backend/src/services/certificate/certificate-service.tsindex c1ea144a51..1d87ee5ed1 100644--- a/backend/src/services/certificate/certificate-service.ts+++ b/backend/src/services/certificate/certificate-service.ts@@ -522,13 +522,7 @@ export const certificateServiceFactory = ({);}- const removed = await certificateDAL.deleteById(cert.id, tx);-- if (cert.caId) {- await internalCertificateAuthorityDAL.update({ caId: cert.caId }, { $incr: { ocspGeneration: 1 } }, tx);- }-- return removed;+ return certificateDAL.deleteById(cert.id, tx);});} catch (err) {const innerError = err instanceof DatabaseError ? (err.error as { code?: string; constraint?: string }) : null;diff --git a/docs/documentation/platform/pki/ca/ocsp.mdx b/docs/documentation/platform/pki/ca/ocsp.mdxindex 05cf9aabaa..541fd2445c 100644--- a/docs/documentation/platform/pki/ca/ocsp.mdx+++ b/docs/documentation/platform/pki/ca/ocsp.mdx@@ -32,25 +32,27 @@ Load balancers, VPN concentrators, and mutual TLS gateways often check OCSP whil## Enable OCSP+On the Enterprise plan, OCSP is on by default for every internal CA you create. You can turn it off while creating the CA, in the **Distribution** step, or at any time afterwards. Enable it yourself for a CA created before you had the plan, or one where it was turned off.+<Tabs><Tab title="Infisical UI"><Steps><Step title="Open the CA">Go to **Certificate Authorities** and select the internal CA.</Step>- <Step title="Edit the OCSP card">- Select the pencil icon on the **OCSP** card.+ <Step title="Edit the Revocation card">+ Select the pencil icon on the **Revocation** card.</Step><Step title="Turn OCSP on">Turn on **Enable OCSP**, then select **Save**.</Step><Step title="Copy the responder URL">- The **OCSP** card now shows the responder URL. Certificates issued from this point carry it.+ The **Revocation** card now shows the responder URL. Certificates issued from this point carry it.</Step></Steps></Tab><Tab title="API">- Set `isOcspEnabled` under `configuration` when you create or update an internal CA.+ Set `isOcspEnabled` under `configuration` when you create or update an internal CA. If you leave it out when creating a CA, it's enabled on the Enterprise plan and disabled otherwise. Leaving it out of an update keeps the current setting.### Enable on an existing CA@@ -105,22 +107,6 @@ certificate.pem: goodNext Update: Sep 21 14:29:42 2026 GMT```-## OCSP stapling--OCSP stapling allows a server to include the OCSP response for its own certificate in the TLS handshake, so clients receive the revocation status without querying the responder themselves.--Stapling is optional and is configured on the server that presents the certificate, not in Infisical. Enabling it reduces handshake latency and keeps connections working during a brief responder outage.--```nginx-ssl_stapling on;-ssl_stapling_verify on;-resolver 1.1.1.1 8.8.8.8 valid=300s;-```--<Note>- Stapling only applies to certificates a server presents. When a server validates a client certificate, such as in mutual TLS, stapling doesn't apply and each check queries the responder directly.-</Note>-## Limitations- Certificates issued before OCSP was enabled don't carry the responder URL.diff --git a/frontend/src/pages/cert-manager/CertAuthDetailsByIDPage/CertAuthDetailsByIDPage.tsx b/frontend/src/pages/cert-manager/CertAuthDetailsByIDPage/CertAuthDetailsByIDPage.tsxindex 01a4668c2b..87f703d393 100644--- a/frontend/src/pages/cert-manager/CertAuthDetailsByIDPage/CertAuthDetailsByIDPage.tsx+++ b/frontend/src/pages/cert-manager/CertAuthDetailsByIDPage/CertAuthDetailsByIDPage.tsx@@ -35,11 +35,10 @@ import {CaCertificatesSection,CaCrlsSection,CaDetailsSection,- CaDistributionPointsSection,CaGenerateRootCertModal,CaIssuerUrlSection,- CaOcspSection,CaRenewalModal,+ CaRevocationSection,CaSigningConfigSection} from "./components";@@ -193,8 +192,7 @@ const Page = () => {/><CaIssuerUrlSection caId={data.id} /><CaCrlsSection caId={data.id} />- <CaDistributionPointsSection caId={data.id} />- <CaOcspSection caId={data.id} />+ <CaRevocationSection caId={data.id} /></div></div></div>diff --git a/frontend/src/pages/cert-manager/CertAuthDetailsByIDPage/components/CaDistributionPointsSection.tsx b/frontend/src/pages/cert-manager/CertAuthDetailsByIDPage/components/CaDistributionPointsSection.tsxdeleted file mode 100644index 3bb0192593..0000000000--- a/frontend/src/pages/cert-manager/CertAuthDetailsByIDPage/components/CaDistributionPointsSection.tsx+++ /dev/null@@ -1,314 +0,0 @@-import { Controller, useFieldArray, useForm } from "react-hook-form";-import { subject } from "@casl/ability";-import { faPlus, faTrash } from "@fortawesome/free-solid-svg-icons";-import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";-import { zodResolver } from "@hookform/resolvers/zod";-import { PencilIcon } from "lucide-react";-import { z } from "zod";--import { UpgradePlanModal } from "@app/components/license/UpgradePlanModal";-import { createNotification } from "@app/components/notifications";-import { ProjectPermissionCan } from "@app/components/permissions";-import {- Button as ButtonV2,- FormControl,- IconButton as IconButtonV2,- Input,- Modal,- ModalClose,- ModalContent,- Switch,- Tooltip-} from "@app/components/v2";-import {- Card,- CardAction,- CardContent,- CardDescription,- CardHeader,- CardTitle,- Detail,- DetailGroup,- DetailLabel,- DetailValue,- IconButton-} from "@app/components/v3";-import {- ProjectPermissionCertificateAuthorityActions,- ProjectPermissionSub,- useSubscription-} from "@app/context";-import {- CaType,- MAX_DISTRIBUTION_POINT_URL_LENGTH,- MAX_INTERNAL_CA_DISTRIBUTION_POINT_URLS,- useGetCa,- useUpdateCa-} from "@app/hooks/api";-import { TInternalCertificateAuthority } from "@app/hooks/api/ca/types";-import { usePopUp } from "@app/hooks/usePopUp";--type Props = {- caId: string;-};--const distributionPointUrlEntrySchema = z.object({- value: z- .string()- .trim()- .max(MAX_DISTRIBUTION_POINT_URL_LENGTH, "URL is too long")- .url("Must be a valid URL")- .refine((url) => /^https?:\/\//i.test(url), { message: "URL must use http:// or https://" })-});--const editSchema = z.object({- crlDistributionPointUrls: z- .array(distributionPointUrlEntrySchema)- .max(- MAX_INTERNAL_CA_DISTRIBUTION_POINT_URLS,- `Up to ${MAX_INTERNAL_CA_DISTRIBUTION_POINT_URLS} URLs are allowed`- )- .superRefine((entries, ctx) => {- const seen = new Set<string>();- entries.forEach((entry, index) => {- const normalized = entry.value.trim().replace(/\/+$/, "").toLowerCase();- if (seen.has(normalized)) {- ctx.addIssue({- code: z.ZodIssueCode.custom,- path: [index, "value"],- message: "Duplicate URL"- });- }- seen.add(normalized);- });- }),- disableManagedCrlDistributionPointUrl: z.boolean().default(false)-});--type EditFormData = z.infer<typeof editSchema>;--export const CaDistributionPointsSection = ({ caId }: Props) => {- const { popUp, handlePopUpToggle } = usePopUp([- "editCrlDistributionPoints",- "upgradePlan"- ] as const);- const { subscription } = useSubscription();-- const { data } = useGetCa({ caId, type: CaType.INTERNAL });- const ca = data as TInternalCertificateAuthority | undefined;-- const { mutateAsync: updateCa } = useUpdateCa();-- const {- control,- handleSubmit,- reset,- formState: { isSubmitting }- } = useForm<EditFormData>({- resolver: zodResolver(editSchema),- values: {- crlDistributionPointUrls: (ca?.configuration.crlDistributionPointUrls ?? []).map((value) => ({- value- })),- disableManagedCrlDistributionPointUrl:- ca?.configuration.disableManagedCrlDistributionPointUrl ?? false- }- });-- const crlUrls = useFieldArray({ control, name: "crlDistributionPointUrls" });-- // Only adding a custom URL is plan-gated; toggling the managed URL and removing existing ones- // stay available, so the restriction belongs on this action rather than on opening the modal.- const handleAddCrlUrl = () => {- if (!subscription.caCrl) {- handlePopUpToggle("upgradePlan", true);- return;- }- crlUrls.append({ value: "" });- };-- if (!ca) return null;-- const mirrorUrls = ca.configuration.crlDistributionPointUrls ?? [];-- const onEditSubmit = async ({- crlDistributionPointUrls,- disableManagedCrlDistributionPointUrl- }: EditFormData) => {- try {- await updateCa({- id: ca.id,- type: CaType.INTERNAL,- configuration: {- crlDistributionPointUrls: crlDistributionPointUrls.map(({ value }) => value),- disableManagedCrlDistributionPointUrl- } as TInternalCertificateAuthority["configuration"]- });- createNotification({- text: "CRL distribution points updated",- type: "success"- });- handlePopUpToggle("editCrlDistributionPoints", false);- } catch {- createNotification({- text: "Failed to update CRL distribution points",- type: "error"- });- }- };-- return (- <>- <Card className="w-full">- <CardHeader className="border-b">- <CardTitle>CRL Distribution Points</CardTitle>- <CardDescription>Backup CRL URLs for issued certificates</CardDescription>- <CardAction>- <ProjectPermissionCan- I={ProjectPermissionCertificateAuthorityActions.Edit}- a={subject(ProjectPermissionSub.CertificateAuthorities, { name: ca.name })}- >- {(isAllowed) => (- <IconButton- variant="outline"- size="xs"- isDisabled={!isAllowed}- onClick={() => handlePopUpToggle("editCrlDistributionPoints", true)}- >- <PencilIcon />- </IconButton>- )}- </ProjectPermissionCan>- </CardAction>- </CardHeader>- <CardContent>- <DetailGroup>- <Detail>- <DetailLabel>Managed CRL URL</DetailLabel>- <DetailValue>- {ca.configuration.disableManagedCrlDistributionPointUrl ? "Disabled" : "Enabled"}- </DetailValue>- </Detail>- <Detail>- <DetailLabel>Mirror URLs</DetailLabel>- <DetailValue>- {mirrorUrls.length === 0 ? (- <span className="text-muted">—</span>- ) : (- <div className="flex flex-col gap-1">- {mirrorUrls.map((url) => (- <span key={url} className="break-all">- {url}- </span>- ))}- </div>- )}- </DetailValue>- </Detail>- </DetailGroup>- </CardContent>- </Card>-- <Modal- isOpen={popUp.editCrlDistributionPoints.isOpen}- onOpenChange={(isOpen) => {- handlePopUpToggle("editCrlDistributionPoints", isOpen);- if (!isOpen) reset();- }}- >- <ModalContent title="Edit CRL Distribution Points">- <form onSubmit={handleSubmit(onEditSubmit)}>- <Controller- control={control}- name="disableManagedCrlDistributionPointUrl"- render={({ field: { value, onChange } }) => (- <FormControl>- <Switch- id="disableManagedCrlDistributionPointUrl"- className="bg-muted/80 shadow-inner data-[state=checked]:bg-success/80"- thumbClassName="bg-surface-raised"- isChecked={value}- onCheckedChange={onChange}- >- Disable managed CRL URL- </Switch>- </FormControl>- )}- />- <FormControl- label="Mirror URLs"- helperText={`Up to ${MAX_INTERNAL_CA_DISTRIBUTION_POINT_URLS} URLs.`}- >- <div className="flex flex-col gap-2">- {crlUrls.fields.map((field, index) => (- <Controller- key={field.id}- control={control}- name={`crlDistributionPointUrls.${index}.value`}- render={({ field: inputField, fieldState: { error } }) => (- <div className="flex items-start gap-2">- <FormControl- isError={Boolean(error)}- errorText={error?.message}- className="mb-0 flex-1"- >- <Input- {...inputField}- placeholder="https://crl.example.com/internal-ca.crl"- />- </FormControl>- <Tooltip content="Remove URL" position="right">- <IconButtonV2- ariaLabel="Remove URL"- colorSchema="danger"- variant="plain"- size="sm"- className="mt-1.5"- onClick={() => crlUrls.remove(index)}- >- <FontAwesomeIcon icon={faTrash} />- </IconButtonV2>- </Tooltip>- </div>- )}- />- ))}- <ButtonV2- leftIcon={<FontAwesomeIcon icon={faPlus} />}- size="xs"- variant="outline_bg"- isDisabled={crlUrls.fields.length >= MAX_INTERNAL_CA_DISTRIBUTION_POINT_URLS}- onClick={handleAddCrlUrl}- >- Add URL- </ButtonV2>- </div>- </FormControl>- <div className="flex w-full justify-between gap-4 pt-4">- <ModalClose asChild>- <ButtonV2 colorSchema="secondary" variant="plain">- Cancel- </ButtonV2>- </ModalClose>- <ButtonV2- type="submit"- colorSchema="secondary"- isLoading={isSubmitting}- isDisabled={isSubmitting}- >- Save- </ButtonV2>- </div>- </form>- </ModalContent>- </Modal>-- <UpgradePlanModal- paywallKey="cert-manager.ca-distribution-points"- isOpen={popUp.upgradePlan.isOpen}- onOpenChange={(isOpen) => handlePopUpToggle("upgradePlan", isOpen)}- text="Certificate revocation lists are available on Infisical's Enterprise plan."- />- </>- );-};diff --git a/frontend/src/pages/cert-manager/CertAuthDetailsByIDPage/components/CaOcspSection.tsx b/frontend/src/pages/cert-manager/CertAuthDetailsByIDPage/components/CaOcspSection.tsxdeleted file mode 100644index 93e8cdd781..0000000000--- a/frontend/src/pages/cert-manager/CertAuthDetailsByIDPage/components/CaOcspSection.tsx+++ /dev/null@@ -1,210 +0,0 @@-import { Controller, useForm } from "react-hook-form";-import { subject } from "@casl/ability";-import { zodResolver } from "@hookform/resolvers/zod";-import { PencilIcon } from "lucide-react";-import { z } from "zod";--import { UpgradePlanModal } from "@app/components/license/UpgradePlanModal";-import { createNotification } from "@app/components/notifications";-import { ProjectPermissionCan } from "@app/components/permissions";-import {- Button,- Card,- CardAction,- CardContent,- CardDescription,- CardHeader,- CardTitle,- Detail,- DetailGroup,- DetailLabel,- DetailValue,- Dialog,- DialogClose,- DialogContent,- DialogDescription,- DialogFooter,- DialogHeader,- DialogTitle,- Field,- FieldContent,- FieldDescription,- FieldTitle,- IconButton,- Toggle-} from "@app/components/v3";-import {- ProjectPermissionCertificateAuthorityActions,- ProjectPermissionSub,- useSubscription-} from "@app/context";-import { CaType, useGetCa, useUpdateCa } from "@app/hooks/api";-import { TInternalCertificateAuthority } from "@app/hooks/api/ca/types";-import { usePopUp } from "@app/hooks/usePopUp";--type Props = {- caId: string;-};--const editSchema = z.object({- isOcspEnabled: z.boolean().default(false)-});--type EditFormData = z.infer<typeof editSchema>;--export const CaOcspSection = ({ caId }: Props) => {- const { popUp, handlePopUpToggle } = usePopUp(["editOcsp", "upgradePlan"] as const);- const { subscription } = useSubscription();-- const { data } = useGetCa({ caId, type: CaType.INTERNAL });- const ca = data as TInternalCertificateAuthority | undefined;-- const { mutateAsync: updateCa } = useUpdateCa();-- const {- control,- handleSubmit,- reset,- formState: { isSubmitting }- } = useForm<EditFormData>({- resolver: zodResolver(editSchema),- values: {- isOcspEnabled: ca?.configuration.isOcspEnabled ?? false- }- });-- if (!ca) return null;-- const isOcspEnabled = ca.configuration.isOcspEnabled ?? false;- const ocspResponderUrl = `${window.origin}/api/v1/cert-manager/ocsp/${ca.id}`;-- const handleEdit = () => {- if (!isOcspEnabled && !subscription.pkiOcsp) {- handlePopUpToggle("upgradePlan", true);- return;- }- handlePopUpToggle("editOcsp", true);- };-- const onEditSubmit = async (values: EditFormData) => {- try {- await updateCa({- id: ca.id,- type: CaType.INTERNAL,- configuration: {- isOcspEnabled: values.isOcspEnabled- } as TInternalCertificateAuthority["configuration"]- });- createNotification({- text: values.isOcspEnabled ? "OCSP enabled" : "OCSP disabled",- type: "success"- });- handlePopUpToggle("editOcsp", false);- } catch {- // MutationCache.onError already surfaces the server message, so the dialog only stays open- }- };-- return (- <>- <Card className="w-full">- <CardHeader className="border-b">- <CardTitle>OCSP</CardTitle>- <CardDescription>Answer revocation status checks for issued certificates</CardDescription>- <CardAction>- <ProjectPermissionCan- I={ProjectPermissionCertificateAuthorityActions.Edit}- a={subject(ProjectPermissionSub.CertificateAuthorities, { name: ca.name })}- >- {(isAllowed) => (- <IconButton- aria-label="Edit OCSP"- variant="outline"- size="xs"- isDisabled={!isAllowed}- onClick={handleEdit}- >- <PencilIcon />- </IconButton>- )}- </ProjectPermissionCan>- </CardAction>- </CardHeader>- <CardContent>- <DetailGroup>- <Detail>- <DetailLabel>Status</DetailLabel>- <DetailValue>{isOcspEnabled ? "Enabled" : "Disabled"}</DetailValue>- </Detail>- <Detail>- <DetailLabel>Responder URL</DetailLabel>- <DetailValue>- {isOcspEnabled ? (- <span className="break-all">{ocspResponderUrl}</span>- ) : (- <span className="text-muted">—</span>- )}- </DetailValue>- </Detail>- </DetailGroup>- </CardContent>- </Card>-- <Dialog- open={popUp.editOcsp.isOpen}- onOpenChange={(isOpen) => {- handlePopUpToggle("editOcsp", isOpen);- if (!isOpen) reset();- }}- >- <DialogContent>- <DialogHeader>- <DialogTitle>Edit OCSP</DialogTitle>- <DialogDescription>- Only certificates issued after OCSP is enabled carry the responder URL.- </DialogDescription>- </DialogHeader>- <form onSubmit={handleSubmit(onEditSubmit)} className="flex flex-col gap-4">- <Controller- control={control}- name="isOcspEnabled"- render={({ field: { value, onChange } }) => (- <Field orientation="horizontal">- <FieldContent>- <FieldTitle>Enable OCSP</FieldTitle>- <FieldDescription>- Answer revocation status checks for certificates issued by this CA.- </FieldDescription>- </FieldContent>- <Toggle- id="isOcspEnabled"- variant="success"- checked={value}- onCheckedChange={onChange}- />- </Field>- )}- />- <DialogFooter>- <DialogClose asChild>- <Button type="button" variant="ghost">- Cancel- </Button>- </DialogClose>- <Button type="submit" isPending={isSubmitting} isDisabled={isSubmitting}>- Save- </Button>- </DialogFooter>- </form>- </DialogContent>- </Dialog>-- <UpgradePlanModal- paywallKey="cert-manager.ca-ocsp"- isOpen={popUp.upgradePlan.isOpen}- onOpenChange={(isOpen) => handlePopUpToggle("upgradePlan", isOpen)}- text="OCSP is available on Infisical's Enterprise plan."- />- </>- );-};diff --git a/frontend/src/pages/cert-manager/CertAuthDetailsByIDPage/components/CaRevocationSection.tsx b/frontend/src/pages/cert-manager/CertAuthDetailsByIDPage/components/CaRevocationSection.tsxnew file mode 100644index 0000000000..2e957a0423--- /dev/null+++ b/frontend/src/pages/cert-manager/CertAuthDetailsByIDPage/components/CaRevocationSection.tsx@@ -0,0 +1,367 @@+import { Controller, useFieldArray, useForm } from "react-hook-form";+import { subject } from "@casl/ability";+import { zodResolver } from "@hookform/resolvers/zod";+import { PencilIcon, PlusIcon, Trash2Icon } from "lucide-react";+import { z } from "zod";++import { UpgradePlanModal } from "@app/components/license/UpgradePlanModal";+import { createNotification } from "@app/components/notifications";+import { ProjectPermissionCan } from "@app/components/permissions";+import {+ Badge,+ Button,+ Card,+ CardAction,+ CardContent,+ CardDescription,+ CardHeader,+ CardTitle,+ Detail,+ DetailGroup,+ DetailLabel,+ DetailValue,+ Dialog,+ DialogClose,+ DialogContent,+ DialogDescription,+ DialogFooter,+ DialogHeader,+ DialogTitle,+ Field,+ FieldContent,+ FieldDescription,+ FieldError,+ FieldGroup,+ FieldLabel,+ IconButton,+ Input,+ Toggle,+ Tooltip,+ TooltipContent,+ TooltipTrigger+} from "@app/components/v3";+import {+ ProjectPermissionCertificateAuthorityActions,+ ProjectPermissionSub,+ useSubscription+} from "@app/context";+import {+ CaType,+ MAX_DISTRIBUTION_POINT_URL_LENGTH,+ MAX_INTERNAL_CA_DISTRIBUTION_POINT_URLS,+ useGetCa,+ useUpdateCa+} from "@app/hooks/api";+import { TInternalCertificateAuthority } from "@app/hooks/api/ca/types";+import { usePopUp } from "@app/hooks/usePopUp";++type Props = {+ caId: string;+};++const distributionPointUrlEntrySchema = z.object({+ value: z+ .string()+ .trim()+ .max(MAX_DISTRIBUTION_POINT_URL_LENGTH, "URL is too long")+ .url("Must be a valid URL")+ .refine((url) => /^https?:\/\//i.test(url), { message: "URL must use http:// or https://" })+});++const editSchema = z.object({+ isOcspEnabled: z.boolean(),+ disableManagedCrlDistributionPointUrl: z.boolean(),+ crlDistributionPointUrls: z+ .array(distributionPointUrlEntrySchema)+ .max(+ MAX_INTERNAL_CA_DISTRIBUTION_POINT_URLS,+ `Up to ${MAX_INTERNAL_CA_DISTRIBUTION_POINT_URLS} URLs are allowed`+ )+ .superRefine((entries, ctx) => {+ const seen = new Set<string>();+ entries.forEach((entry, index) => {+ const normalized = entry.value.trim().replace(/\/+$/, "").toLowerCase();+ if (seen.has(normalized)) {+ ctx.addIssue({+ code: z.ZodIssueCode.custom,+ path: [index, "value"],+ message: "Duplicate URL"+ });+ }+ seen.add(normalized);+ });+ })+});++type EditFormData = z.infer<typeof editSchema>;++export const CaRevocationSection = ({ caId }: Props) => {+ const { popUp, handlePopUpToggle } = usePopUp(["editRevocation", "upgradePlan"] as const);+ const { subscription } = useSubscription();++ const { data } = useGetCa({ caId, type: CaType.INTERNAL });+ const ca = data as TInternalCertificateAuthority | undefined;++ const { mutateAsync: updateCa } = useUpdateCa();++ const {+ control,+ handleSubmit,+ reset,+ formState: { isSubmitting }+ } = useForm<EditFormData>({+ resolver: zodResolver(editSchema),+ values: {+ isOcspEnabled: ca?.configuration.isOcspEnabled ?? false,+ disableManagedCrlDistributionPointUrl:+ ca?.configuration.disableManagedCrlDistributionPointUrl ?? false,+ crlDistributionPointUrls: (ca?.configuration.crlDistributionPointUrls ?? []).map((value) => ({+ value+ }))+ }+ });++ const crlUrls = useFieldArray({ control, name: "crlDistributionPointUrls" });++ if (!ca) return null;++ const canUseOcsp = Boolean(subscription.pkiOcsp);+ const isOcspEnabled = ca.configuration.isOcspEnabled ?? false;+ const ocspResponderUrl = `${window.origin}/api/v1/cert-manager/ocsp/${ca.id}`;+ const mirrorUrls = ca.configuration.crlDistributionPointUrls ?? [];++ const handleAddCrlUrl = () => {+ if (!subscription.caCrl) {+ handlePopUpToggle("upgradePlan", true);+ return;+ }+ crlUrls.append({ value: "" });+ };++ const onEditSubmit = async (values: EditFormData) => {+ try {+ await updateCa({+ id: ca.id,+ type: CaType.INTERNAL,+ configuration: {+ isOcspEnabled: values.isOcspEnabled,+ disableManagedCrlDistributionPointUrl: values.disableManagedCrlDistributionPointUrl,+ crlDistributionPointUrls: values.crlDistributionPointUrls.map(({ value }) => value)+ } as TInternalCertificateAuthority["configuration"]+ });+ createNotification({ text: "Revocation settings updated", type: "success" });+ handlePopUpToggle("editRevocation", false);+ } catch {+ handlePopUpToggle("editRevocation", true);+ }+ };++ return (+ <>+ <Card className="w-full">+ <CardHeader className="border-b">+ <CardTitle>Revocation</CardTitle>+ <CardDescription>+ How clients check whether certificates issued by this CA are revoked+ </CardDescription>+ <CardAction>+ <ProjectPermissionCan+ I={ProjectPermissionCertificateAuthorityActions.Edit}+ a={subject(ProjectPermissionSub.CertificateAuthorities, { name: ca.name })}+ >+ {(isAllowed) => (+ <IconButton+ aria-label="Edit revocation"+ variant="outline"+ size="xs"+ isDisabled={!isAllowed}+ onClick={() => handlePopUpToggle("editRevocation", true)}+ >+ <PencilIcon />+ </IconButton>+ )}+ </ProjectPermissionCan>+ </CardAction>+ </CardHeader>+ <CardContent>+ <DetailGroup>+ <Detail>+ <DetailLabel>OCSP</DetailLabel>+ <DetailValue>{isOcspEnabled ? "Enabled" : "Disabled"}</DetailValue>+ </Detail>+ <Detail>+ <DetailLabel>OCSP Responder URL</DetailLabel>+ <DetailValue>+ {isOcspEnabled ? (+ <span className="break-all">{ocspResponderUrl}</span>+ ) : (+ <span className="text-muted">—</span>+ )}+ </DetailValue>+ </Detail>+ <Detail>+ <DetailLabel>Managed CRL URL</DetailLabel>+ <DetailValue>+ {ca.configuration.disableManagedCrlDistributionPointUrl ? "Disabled" : "Enabled"}+ </DetailValue>+ </Detail>+ <Detail>+ <DetailLabel>CRL Mirror URLs</DetailLabel>+ <DetailValue>+ {mirrorUrls.length === 0 ? (+ <span className="text-muted">—</span>+ ) : (+ <div className="flex flex-col gap-1">+ {mirrorUrls.map((url) => (+ <span key={url} className="break-all">+ {url}+ </span>+ ))}+ </div>+ )}+ </DetailValue>+ </Detail>+ </DetailGroup>+ </CardContent>+ </Card>++ <Dialog+ open={popUp.editRevocation.isOpen}+ onOpenChange={(isOpen) => {+ handlePopUpToggle("editRevocation", isOpen);+ if (!isOpen) reset();+ }}+ >+ <DialogContent>+ <DialogHeader>+ <DialogTitle>Edit Revocation</DialogTitle>+ <DialogDescription>+ Changes apply to certificates issued after you save.+ </DialogDescription>+ </DialogHeader>+ <form onSubmit={handleSubmit(onEditSubmit)} className="flex flex-col gap-4">+ <FieldGroup>+ <Controller+ control={control}+ name="isOcspEnabled"+ render={({ field: { value, onChange } }) => (+ <Field orientation="horizontal">+ <FieldContent>+ <FieldLabel>+ Enable OCSP+ {!canUseOcsp && (+ <Tooltip>+ <TooltipTrigger asChild>+ <Badge variant="info">Enterprise</Badge>+ </TooltipTrigger>+ <TooltipContent className="max-w-xs">+ OCSP is available on Infisical's Enterprise plan.+ </TooltipContent>+ </Tooltip>+ )}+ </FieldLabel>+ <FieldDescription>+ Certificates issued by this CA carry an OCSP responder URL, and that+ responder answers revocation status checks for them.+ </FieldDescription>+ </FieldContent>+ <Toggle+ variant="project"+ checked={value}+ onCheckedChange={onChange}+ disabled={!canUseOcsp && !isOcspEnabled}+ />+ </Field>+ )}+ />++ <Controller+ control={control}+ name="disableManagedCrlDistributionPointUrl"+ render={({ field: { value, onChange } }) => (+ <Field orientation="horizontal">+ <FieldContent>+ <FieldLabel>Disable managed CRL URL</FieldLabel>+ <FieldDescription>+ When enabled, the Infisical-managed CRL endpoint is not embedded in issued+ certificates. Only the mirror URLs below are included.+ </FieldDescription>+ </FieldContent>+ <Toggle variant="project" checked={value} onCheckedChange={onChange} />+ </Field>+ )}+ />++ <Field>+ <FieldLabel>CRL Mirror URLs</FieldLabel>+ <FieldContent>+ <div className="flex flex-col gap-2">+ {crlUrls.fields.map((entry, index) => (+ <Controller+ key={entry.id}+ control={control}+ name={`crlDistributionPointUrls.${index}.value`}+ render={({ field, fieldState: { error } }) => (+ <div className="flex items-start gap-2">+ <div className="flex-1">+ <Input+ {...field}+ placeholder="https://crl.example.com/internal-ca.crl"+ isError={Boolean(error)}+ />+ <FieldError errors={[error]} />+ </div>+ <IconButton+ aria-label="Remove URL"+ variant="outline"+ onClick={() => crlUrls.remove(index)}+ >+ <Trash2Icon className="h-4 w-4" />+ </IconButton>+ </div>+ )}+ />+ ))}+ <Button+ type="button"+ variant="outline"+ size="sm"+ className="self-start"+ isDisabled={crlUrls.fields.length >= MAX_INTERNAL_CA_DISTRIBUTION_POINT_URLS}+ onClick={handleAddCrlUrl}+ >+ <PlusIcon className="h-4 w-4" />+ Add URL+ </Button>+ </div>+ <FieldDescription>+ Backup CRL URLs embedded in issued certificates. Up to{" "}+ {MAX_INTERNAL_CA_DISTRIBUTION_POINT_URLS}.+ </FieldDescription>+ </FieldContent>+ </Field>+ </FieldGroup>++ <DialogFooter>+ <DialogClose asChild>+ <Button type="button" variant="ghost">+ Cancel+ </Button>+ </DialogClose>+ <Button type="submit" isPending={isSubmitting} isDisabled={isSubmitting}>+ Save+ </Button>+ </DialogFooter>+ </form>+ </DialogContent>+ </Dialog>++ <UpgradePlanModal+ paywallKey="cert-manager.ca-distribution-points"+ isOpen={popUp.upgradePlan.isOpen}+ onOpenChange={(isOpen) => handlePopUpToggle("upgradePlan", isOpen)}+ text="Custom CRL distribution points are available on Infisical's Enterprise plan."+ />+ </>+ );+};diff --git a/frontend/src/pages/cert-manager/CertAuthDetailsByIDPage/components/index.tsx b/frontend/src/pages/cert-manager/CertAuthDetailsByIDPage/components/index.tsxindex 3f1e8639a9..62ad31d76a 100644--- a/frontend/src/pages/cert-manager/CertAuthDetailsByIDPage/components/index.tsx+++ b/frontend/src/pages/cert-manager/CertAuthDetailsByIDPage/components/index.tsx@@ -2,9 +2,8 @@ export { CaCertDetailsSection } from "./CaCertDetailsSection";export { CaCertificatesSection } from "./CaCertificatesSection/CaCertificatesSection";export { CaCrlsSection } from "./CaCrlsSection";export { CaDetailsSection } from "./CaDetailsSection";-export { CaDistributionPointsSection } from "./CaDistributionPointsSection";export { CaGenerateRootCertModal } from "./CaGenerateRootCertModal";export { CaIssuerUrlSection } from "./CaIssuerUrlSection";-export { CaOcspSection } from "./CaOcspSection";export { CaRenewalModal } from "./CaRenewalModal";+export { CaRevocationSection } from "./CaRevocationSection";export { CaSigningConfigSection } from "./CaSigningConfigSection";