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
fix(pki-discovery): truncate long installation names and gate ca stores
bernie-g0824811a3083
diff --git a/frontend/src/pages/cert-manager/CertificateDetailsByIDPage/components/CertificateInstallationsSection.tsx b/frontend/src/pages/cert-manager/CertificateDetailsByIDPage/components/CertificateInstallationsSection.tsxindex 404454e44c..95523fa2d9 100644--- a/frontend/src/pages/cert-manager/CertificateDetailsByIDPage/components/CertificateInstallationsSection.tsx+++ b/frontend/src/pages/cert-manager/CertificateDetailsByIDPage/components/CertificateInstallationsSection.tsx@@ -84,13 +84,14 @@ export const CertificateInstallationsSection = ({ certificateId }: Props) => {<TableBody>{paginatedInstallations.map((installation) => (<TableRow key={installation.id} linked>- <TableCell>+ <TableCell className="max-w-80"><RowLink{...getInstancePinningLink(currentProject.orgId,currentProject,`discovery/installations/${installation.id}`)!}+ title={installation.name || getEndpoint(installation)}>{installation.name || getEndpoint(installation)}</RowLink>diff --git a/frontend/src/pages/cert-manager/DiscoveryDetailsByIDPage/DiscoveryDetailsByIDPage.tsx b/frontend/src/pages/cert-manager/DiscoveryDetailsByIDPage/DiscoveryDetailsByIDPage.tsxindex 9c02cb3b98..643345419d 100644--- a/frontend/src/pages/cert-manager/DiscoveryDetailsByIDPage/DiscoveryDetailsByIDPage.tsx+++ b/frontend/src/pages/cert-manager/DiscoveryDetailsByIDPage/DiscoveryDetailsByIDPage.tsx@@ -174,7 +174,7 @@ const Page = () => {<DiscoveryDetailsSection discovery={discovery} /><DiscoveryTargetSection discovery={discovery} /></div>- <div className="flex flex-1 flex-col gap-y-5">+ <div className="flex min-w-0 flex-1 flex-col gap-y-5"><DiscoveryScanLogsSectiondiscoveryId={discoveryId}onTriggerScan={handleTriggerScan}diff --git a/frontend/src/pages/cert-manager/DiscoveryDetailsByIDPage/components/DiscoveryInstallationsSection.tsx b/frontend/src/pages/cert-manager/DiscoveryDetailsByIDPage/components/DiscoveryInstallationsSection.tsxindex e52fbb580a..83a396f323 100644--- a/frontend/src/pages/cert-manager/DiscoveryDetailsByIDPage/components/DiscoveryInstallationsSection.tsx+++ b/frontend/src/pages/cert-manager/DiscoveryDetailsByIDPage/components/DiscoveryInstallationsSection.tsx@@ -87,18 +87,24 @@ export const DiscoveryInstallationsSection = ({ discoveryId, projectId, isScanRu<TableBody>{installations.map((installation) => (<TableRow key={installation.id} linked>- <TableCell>+ <TableCell className="max-w-48"><RowLink{...getInstancePinningLink(currentProject.orgId,currentProject,`discovery/installations/${installation.id}`)!}+ title={installation.name || getEndpoint(installation)}>{installation.name || getEndpoint(installation)}</RowLink></TableCell>- <TableCell>{installation.primaryCertName || "N/A"}</TableCell>+ <TableCell+ className="max-w-44 truncate"+ title={installation.primaryCertName ?? undefined}+ >+ {installation.primaryCertName || "N/A"}+ </TableCell><TableCell>{getGatewayLabel(installation) || "N/A"}</TableCell><TableCell>{format(new Date(installation.lastSeenAt), "MMM dd, yyyy HH:mm")}diff --git a/frontend/src/pages/cert-manager/DiscoveryPage/components/DiscoveryJobSheet/WindowsServerStoresFields.tsx b/frontend/src/pages/cert-manager/DiscoveryPage/components/DiscoveryJobSheet/WindowsServerStoresFields.tsxindex 3b8b6c13a1..f9d04650ef 100644--- a/frontend/src/pages/cert-manager/DiscoveryPage/components/DiscoveryJobSheet/WindowsServerStoresFields.tsx+++ b/frontend/src/pages/cert-manager/DiscoveryPage/components/DiscoveryJobSheet/WindowsServerStoresFields.tsx@@ -18,7 +18,7 @@ import {WindowsCertificateStoreLabels} from "@app/hooks/api/pkiDiscovery/types";-import { TWindowsServerDiscoveryJobForm } from "./discovery-job-form-schema";+import { CA_CERTIFICATE_STORES, TWindowsServerDiscoveryJobForm } from "./discovery-job-form-schema";const STORE_DESCRIPTIONS: Record<WindowsCertificateStore, string> = {[WindowsCertificateStore.Personal]:@@ -36,26 +36,23 @@ const SERVER_STORES = [WindowsCertificateStore.RemoteDesktop];-const CA_STORES = [- WindowsCertificateStore.IntermediateCertificationAuthorities,- WindowsCertificateStore.TrustedRootCertificationAuthorities-];-type StoreOptionsProps = {stores: WindowsCertificateStore[];value: WindowsCertificateStore[];onChange: (stores: WindowsCertificateStore[]) => void;+ isDisabled?: boolean;};-const StoreOptions = ({ stores, value, onChange }: StoreOptionsProps) => (+const StoreOptions = ({ stores, value, onChange, isDisabled }: StoreOptionsProps) => (<FieldGroup data-slot="checkbox-group">{stores.map((store) => {const id = `certificate-store-${store.replace(" ", "-")}`;return (- <Field key={store} orientation="horizontal">+ <Field key={store} orientation="horizontal" data-disabled={isDisabled}><Checkboxid={id}variant="project"+ isDisabled={isDisabled}isChecked={value.includes(store)}onCheckedChange={(checked) =>onChange(@@ -67,7 +64,7 @@ const StoreOptions = ({ stores, value, onChange }: StoreOptionsProps) => (/><FieldContent><FieldTitle>- <Label htmlFor={id} className="cursor-pointer">+ <Label htmlFor={id} className={isDisabled ? "cursor-not-allowed" : "cursor-pointer"}>{WindowsCertificateStoreLabels[store]}</Label></FieldTitle>@@ -80,7 +77,8 @@ const StoreOptions = ({ stores, value, onChange }: StoreOptionsProps) => ();export const WindowsServerStoresFields = () => {- const { control, trigger } = useFormContext<TWindowsServerDiscoveryJobForm>();+ const { control, trigger, watch } = useFormContext<TWindowsServerDiscoveryJobForm>();+ const includeCa = watch("importStandaloneCaCertificates");return (<Controller@@ -94,12 +92,11 @@ export const WindowsServerStoresFields = () => {</FieldSet><FieldSet><FieldLegend variant="label">CA Certificate Stores</FieldLegend>- <StoreOptions stores={CA_STORES} value={value} onChange={onChange} /><Controllercontrol={control}name="importStandaloneCaCertificates"- render={({ field: { value: includeCa, onChange: setIncludeCa } }) => (- <Field orientation="horizontal" className="mt-2">+ render={({ field: { onChange: setIncludeCa } }) => (+ <Field orientation="horizontal" className="mb-2"><FieldContent><FieldTitle><Label htmlFor="import-standalone-ca" className="cursor-pointer">@@ -117,12 +114,21 @@ export const WindowsServerStoresFields = () => {checked={includeCa}onCheckedChange={(checked) => {setIncludeCa(checked);- trigger("certificateStores");+ if (!checked) {+ onChange(value.filter((store) => !CA_CERTIFICATE_STORES.includes(store)));+ trigger("certificateStores");+ }}}/></Field>)}/>+ <StoreOptions+ stores={CA_CERTIFICATE_STORES}+ value={value}+ onChange={onChange}+ isDisabled={!includeCa}+ /></FieldSet><FieldError errors={[error]} /></div>diff --git a/frontend/src/pages/cert-manager/DiscoveryPage/components/DiscoveryJobSheet/discovery-job-form-schema.ts b/frontend/src/pages/cert-manager/DiscoveryPage/components/DiscoveryJobSheet/discovery-job-form-schema.tsindex ba888c77d5..e4c6bd4b58 100644--- a/frontend/src/pages/cert-manager/DiscoveryPage/components/DiscoveryJobSheet/discovery-job-form-schema.ts+++ b/frontend/src/pages/cert-manager/DiscoveryPage/components/DiscoveryJobSheet/discovery-job-form-schema.ts@@ -173,28 +173,16 @@ const WindowsServerSchema = BaseSchema.extend({importStandaloneCaCertificates: z.boolean()});-const CA_ONLY_STORES = [+export const CA_CERTIFICATE_STORES = [WindowsCertificateStore.IntermediateCertificationAuthorities,WindowsCertificateStore.TrustedRootCertificationAuthorities];-export const DiscoveryJobFormSchema = z- .discriminatedUnion("discoveryType", [NetworkSchema, LinuxServerSchema, WindowsServerSchema])- .superRefine((form, ctx) => {- if (- form.discoveryType === PkiDiscoveryType.WindowsServer &&- !form.importStandaloneCaCertificates &&- form.certificateStores.length > 0 &&- form.certificateStores.every((store) => CA_ONLY_STORES.includes(store))- ) {- ctx.addIssue({- code: z.ZodIssueCode.custom,- path: ["certificateStores"],- message:- "These stores only hold CA certificates. Turn on Include CA Certificates or select another store."- });- }- });+export const DiscoveryJobFormSchema = z.discriminatedUnion("discoveryType", [+ NetworkSchema,+ LinuxServerSchema,+ WindowsServerSchema+]);export type TDiscoveryJobForm = z.infer<typeof DiscoveryJobFormSchema>;export type TNetworkDiscoveryJobForm = z.infer<typeof NetworkSchema>;@@ -215,14 +203,17 @@ export const getDefaultFormValues = (if (type === PkiDiscoveryType.WindowsServer) {const config = discovery?.targetConfig;+ const importStandaloneCaCertificates = config?.importStandaloneCaCertificates ?? false;return {...base,discoveryType: PkiDiscoveryType.WindowsServer,connections: discovery?.connections ?? [],- certificateStores: Object.values(WindowsCertificateStore).filter((store) =>- (config?.certificateStores ?? DEFAULT_WINDOWS_CERTIFICATE_STORES).includes(store)+ certificateStores: Object.values(WindowsCertificateStore).filter(+ (store) =>+ (config?.certificateStores ?? DEFAULT_WINDOWS_CERTIFICATE_STORES).includes(store) &&+ (importStandaloneCaCertificates || !CA_CERTIFICATE_STORES.includes(store))),- importStandaloneCaCertificates: config?.importStandaloneCaCertificates ?? false+ importStandaloneCaCertificates};}diff --git a/frontend/src/pages/cert-manager/DiscoveryPage/components/InstallationsTab.tsx b/frontend/src/pages/cert-manager/DiscoveryPage/components/InstallationsTab.tsxindex 8b1ac8f54d..452ea50ebf 100644--- a/frontend/src/pages/cert-manager/DiscoveryPage/components/InstallationsTab.tsx+++ b/frontend/src/pages/cert-manager/DiscoveryPage/components/InstallationsTab.tsx@@ -182,7 +182,7 @@ export const InstallationsTab = ({ projectId }: Props) => {<TableBody>{installations.map((installation) => (<TableRow key={installation.id} linked>- <TableCell>+ <TableCell className="max-w-96"><div className="flex items-center gap-2"><DiscoveryTypeIcontype={getInstallationDiscoveryType(installation)}@@ -194,13 +194,18 @@ export const InstallationsTab = ({ projectId }: Props) => {currentProject,`discovery/installations/${installation.id}`)!}+ className="min-w-0"+ title={installation.name || getEndpoint(installation)}>{installation.name || getEndpoint(installation)}</RowLink>{getKeystoreStatusBadge(installation)}</div></TableCell>- <TableCell>+ <TableCell+ className="max-w-56 truncate"+ title={installation.primaryCertName ?? undefined}+ >{installation.primaryCertName || <span className="text-accent">—</span>}</TableCell><TableCell>{getGatewayLabel(installation) || "N/A"}</TableCell>