Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

feat: add pki license gating

Sheen Capadngan90384c36d575
diff --git a/backend/src/ee/services/license/__mocks__/license-fns.ts b/backend/src/ee/services/license/__mocks__/license-fns.ts
index 0f72887b34..0bd4d10b72 100644
--- a/backend/src/ee/services/license/__mocks__/license-fns.ts
+++ b/backend/src/ee/services/license/__mocks__/license-fns.ts
@@ -5,16 +5,10 @@ export const getDefaultOnPremFeatures = () => {
tier: -1,
workspaceLimit: null,
workspacesUsed: 0,
- secretSyncLimit: null,
- maxInternalCas: null,
- maxPamAccounts: null,
- pam: null,
- certManager: null,
- secretsTemporaryAccess: null,
- enterprisePamAccount: null,
- pkiCodeSigning: null,
+ dynamicSecret: false,
memberLimit: null,
identityLimit: null,
+ subOrganization: false,
environmentLimit: null,
environmentsUsed: 0,
secretVersioning: true,
@@ -25,8 +19,14 @@ export const getDefaultOnPremFeatures = () => {
customAlerts: false,
auditLogs: false,
auditLogsRetentionDays: 0,
+ auditLogStreams: false,
+ auditLogStreamLimit: 3,
+ githubOrgSync: false,
samlSSO: true,
+ enforceGoogleSSO: false,
+ hsm: false,
oidcSSO: true,
+ secretAccessInsights: false,
scim: true,
ldap: true,
groups: false,
@@ -35,17 +35,55 @@ export const getDefaultOnPremFeatures = () => {
has_used_trial: true,
secretApproval: true,
secretRotation: true,
- caCrl: false,
+ instanceUserManagement: false,
+ externalKms: false,
+ rateLimits: {
+ readLimit: 60,
+ writeLimit: 200,
+ secretsLimit: 40
+ },
+ kmsPqc: false,
+ enforceMfa: false,
+ projectTemplates: false,
+ kmip: false,
+ gateway: false,
+ gatewayPool: false,
+ pamSlackNotifications: false,
+ secretScanning: false,
enterpriseSecretSyncs: false,
- enterpriseCertificateSyncs: false,
enterpriseAppConnections: true,
machineIdentityAuthTemplates: false,
- pkiLegacyTemplates: false,
- emailDomainVerification: true,
+ fips: true,
+ eventSubscriptions: false,
+ secretShareExternalBranding: false,
honeyTokens: false,
honeyTokenLimit: 0,
- gatewayPool: false,
- fips: true,
+ secretsBrokering: true,
+ secretSyncLimit: null,
+ maxPamAccounts: null,
+ // PKI / Cert Manager
+ pkiAcme: true,
+ pkiEst: false,
+ pkiScep: false,
+ pkiPqc: false,
+ caCrl: true,
+ pkiWildcardSans: true,
+ pkiEnterpriseCaIntegrations: false,
+ pkiExternalIntermediateCa: false,
+ pkiDiscovery: false,
+ pkiEnterpriseAlerting: false,
+ pkiApprovals: false,
+ pkiSyncs: false,
+ pkiLegacyTemplates: false,
+ pkiCodeSigning: false,
+ maxInternalCas: null,
+ maxSansPerCertificate: null,
+ // product gating
+ pam: null,
+ certManager: null,
+ secretsTemporaryAccess: null,
+ enterprisePamAccount: null,
+ crossProjectSecretSharing: false,
secretsFolderRbac: true
};
};
diff --git a/backend/src/ee/services/license/license-fns.ts b/backend/src/ee/services/license/license-fns.ts
index 0d6c87116b..97d04cc09c 100644
--- a/backend/src/ee/services/license/license-fns.ts
+++ b/backend/src/ee/services/license/license-fns.ts
@@ -56,31 +56,28 @@ export const getDefaultOnPremFeatures = (): TFeatureSet => ({
tier: -1,
workspaceLimit: null,
workspacesUsed: 0,
- secretSyncLimit: null,
- maxInternalCas: null,
- maxPamAccounts: null,
+ dynamicSecret: false,
memberLimit: null,
+ identityLimit: null,
+ subOrganization: false,
environmentLimit: null,
environmentsUsed: 0,
- identityLimit: null,
- dynamicSecret: false,
secretVersioning: true,
pitRecovery: false,
ipAllowlisting: false,
rbac: false,
- githubOrgSync: false,
customRateLimits: false,
- subOrganization: false,
customAlerts: false,
- secretAccessInsights: false,
auditLogs: false,
auditLogsRetentionDays: 0,
auditLogStreams: false,
auditLogStreamLimit: 3,
+ githubOrgSync: false,
samlSSO: false,
enforceGoogleSSO: false,
hsm: false,
oidcSSO: false,
+ secretAccessInsights: false,
scim: false,
ldap: false,
groups: false,
@@ -89,7 +86,6 @@ export const getDefaultOnPremFeatures = (): TFeatureSet => ({
has_used_trial: true,
secretApproval: false,
secretRotation: false,
- caCrl: false,
instanceUserManagement: false,
externalKms: false,
rateLimits: {
@@ -97,11 +93,6 @@ export const getDefaultOnPremFeatures = (): TFeatureSet => ({
writeLimit: 200,
secretsLimit: 40
},
- pkiEst: false,
- pkiAcme: true,
- pkiScep: false,
- pkiPqc: false,
- pkiCodeSigning: null,
kmsPqc: false,
enforceMfa: false,
projectTemplates: false,
@@ -111,16 +102,33 @@ export const getDefaultOnPremFeatures = (): TFeatureSet => ({
pamSlackNotifications: false,
secretScanning: false,
enterpriseSecretSyncs: false,
- enterpriseCertificateSyncs: false,
enterpriseAppConnections: false,
+ machineIdentityAuthTemplates: false,
fips: false,
eventSubscriptions: false,
- machineIdentityAuthTemplates: false,
- pkiLegacyTemplates: false,
secretShareExternalBranding: false,
honeyTokens: false,
honeyTokenLimit: 0,
secretsBrokering: true,
+ secretSyncLimit: null,
+ maxPamAccounts: null,
+ // PKI / Cert Manager
+ pkiAcme: true,
+ pkiEst: false,
+ pkiScep: false,
+ pkiPqc: false,
+ caCrl: true,
+ pkiWildcardSans: true,
+ pkiEnterpriseCaIntegrations: false,
+ pkiExternalIntermediateCa: false,
+ pkiDiscovery: false,
+ pkiEnterpriseAlerting: false,
+ pkiApprovals: false,
+ pkiSyncs: false,
+ pkiLegacyTemplates: false,
+ pkiCodeSigning: false,
+ maxInternalCas: null,
+ maxSansPerCertificate: null,
// product gating
pam: null,
certManager: null,
diff --git a/backend/src/ee/services/license/license-service.ts b/backend/src/ee/services/license/license-service.ts
index ea5c5f5e0d..b99a2ee466 100644
--- a/backend/src/ee/services/license/license-service.ts
+++ b/backend/src/ee/services/license/license-service.ts
@@ -129,11 +129,13 @@ export const licenseServiceFactory = ({
if (isValidOfflineLicense) {
// v2 offline licenses carry License Server v2 entitlements; project them into the feature
- // shape. v1 (or version-less) licenses carry the legacy feature set directly.
+ // shape. A v1 feature set is a snapshot frozen when the key was issued, so it is layered over
+ // current defaults: otherwise every flag added since reads as undefined on an air-gapped
+ // instance, withdrawing features the license paid for.
const features =
contents.license.version === 2 && contents.license.entitlements
? projectV2ToFeatureSet(getDefaultOnPremFeatures(), contents.license.entitlements)
- : contents.license.features;
+ : { ...getDefaultOnPremFeatures(), ...contents.license.features };
onPremFeatures = {
...features,
diff --git a/backend/src/ee/services/license/license-types.ts b/backend/src/ee/services/license/license-types.ts
index d2d89e5d81..e25cb40334 100644
--- a/backend/src/ee/services/license/license-types.ts
+++ b/backend/src/ee/services/license/license-types.ts
@@ -73,7 +73,6 @@ export type TFeatureSet = {
has_used_trial: true;
secretApproval: false;
secretRotation: false;
- caCrl: false;
instanceUserManagement: false;
externalKms: false;
rateLimits: {
@@ -81,13 +80,6 @@ export type TFeatureSet = {
writeLimit: number;
secretsLimit: number;
};
- pkiEst: boolean;
- pkiAcme: true;
- pkiScep: false;
- pkiPqc: false;
- // PKI code signing capability. null (default) is ignored (no restriction); an explicit boolean gates
- // code signer creation.
- pkiCodeSigning: null;
kmsPqc: false;
enforceMfa: false;
projectTemplates: false;
@@ -97,10 +89,8 @@ export type TFeatureSet = {
pamSlackNotifications: boolean;
secretScanning: false;
enterpriseSecretSyncs: false;
- enterpriseCertificateSyncs: false;
enterpriseAppConnections: false;
machineIdentityAuthTemplates: false;
- pkiLegacyTemplates: false;
fips: false;
eventSubscriptions: false;
secretShareExternalBranding: false;
@@ -108,8 +98,29 @@ export type TFeatureSet = {
honeyTokenLimit: 0;
secretsBrokering: true;
secretSyncLimit: null;
- maxInternalCas: null;
maxPamAccounts: null;
+
+ // PKI / Cert Manager
+ pkiAcme: true;
+ pkiEst: boolean;
+ pkiScep: false;
+ pkiPqc: false;
+ // caCrl and pkiWildcardSans default on, so self-hosted OSS keeps them; the License Server's free-plan
+ // default is what withholds them on cloud.
+ caCrl: boolean;
+ pkiWildcardSans: boolean;
+ pkiEnterpriseCaIntegrations: false;
+ pkiExternalIntermediateCa: false;
+ pkiDiscovery: false;
+ pkiEnterpriseAlerting: false;
+ pkiApprovals: false;
+ pkiSyncs: false;
+ pkiLegacyTemplates: false;
+ pkiCodeSigning: false;
+ maxInternalCas: null;
+ // Declared for the License Server plan map; enforcement lands with the CA/certificate counting work.
+ maxSansPerCertificate: null;
+
pam: null;
certManager: null;
secretsTemporaryAccess: null;
diff --git a/backend/src/ee/services/pki-discovery/pki-discovery-service.ts b/backend/src/ee/services/pki-discovery/pki-discovery-service.ts
index 5db6e2b898..b399665bd4 100644
--- a/backend/src/ee/services/pki-discovery/pki-discovery-service.ts
+++ b/backend/src/ee/services/pki-discovery/pki-discovery-service.ts
@@ -3,6 +3,7 @@ import { ForbiddenError } from "@casl/ability";
import { ActionProjectType, OrganizationActionScope } from "@app/db/schemas";
import { TGatewayPoolDALFactory } from "@app/ee/services/gateway-pool/gateway-pool-dal";
import { TGatewayPoolServiceFactory } from "@app/ee/services/gateway-pool/gateway-pool-service";
+import { TLicenseServiceFactory } from "@app/ee/services/license/license-service";
import { OrgPermissionGatewayActions, OrgPermissionSubjects } from "@app/ee/services/permission/org-permission";
import { TPermissionServiceFactory } from "@app/ee/services/permission/permission-service-types";
import {
@@ -49,6 +50,7 @@ type TPkiDiscoveryServiceFactoryDep = {
"findLatestByDiscoveryId" | "findByDiscoveryId" | "countByDiscoveryId"
>;
permissionService: Pick<TPermissionServiceFactory, "getProjectPermission" | "getOrgPermission">;
+ licenseService: Pick<TLicenseServiceFactory, "getPlan">;
gatewayV2DAL: Pick<TGatewayV2DALFactory, "findOne">;
gatewayPoolDAL: Pick<TGatewayPoolDALFactory, "findById">;
gatewayPoolService: Pick<TGatewayPoolServiceFactory, "resolveAttachableGatewayFromPool">;
@@ -75,6 +77,7 @@ export const pkiDiscoveryServiceFactory = ({
pkiDiscoveryConfigDAL,
pkiDiscoveryScanHistoryDAL,
permissionService,
+ licenseService,
gatewayV2DAL,
gatewayPoolDAL,
gatewayPoolService,
@@ -113,6 +116,15 @@ export const pkiDiscoveryServiceFactory = ({
ProjectPermissionSub.PkiDiscovery
);
+ // Creation only; existing discoveries keep scanning and stay editable.
+ const plan = await licenseService.getPlan(actorOrgId);
+ if (!plan.pkiDiscovery) {
+ throw new BadRequestError({
+ message:
+ "Failed to create certificate discovery due to plan restriction. Upgrade plan to use certificate discovery."
+ });
+ }
+
const appCfg = getConfig();
if (appCfg.isCloud) {
const existingCount = await pkiDiscoveryConfigDAL.countByProjectId(projectId);
diff --git a/backend/src/server/routes/index.ts b/backend/src/server/routes/index.ts
index e230d1efb5..33470b5e79 100644
--- a/backend/src/server/routes/index.ts
+++ b/backend/src/server/routes/index.ts
@@ -2765,6 +2765,7 @@ export const registerRoutes = async (
pkiAlertChannelDAL,
pkiAlertHistoryDAL,
permissionService,
+ licenseService,
smtpService,
kmsService,
notificationService,
@@ -3256,7 +3257,6 @@ export const registerRoutes = async (
notificationService,
pkiApplicationDAL,
projectDAL,
- licenseService,
certificateDAL,
certificateBodyDAL,
certificateSecretDAL,
@@ -3370,6 +3370,7 @@ export const registerRoutes = async (
certificateAuthorityDAL,
internalCertificateAuthorityDAL,
permissionService,
+ licenseService,
appConnectionDAL,
appConnectionService,
caAutoRenewalQueue
@@ -3553,6 +3554,7 @@ export const registerRoutes = async (
approvalPolicyStepApproversDAL,
approvalPolicyBypassersDAL,
permissionService,
+ licenseService,
projectMembershipDAL,
membershipDAL,
pkiApplicationDAL,
@@ -3773,6 +3775,7 @@ export const registerRoutes = async (
pkiDiscoveryConfigDAL,
pkiDiscoveryScanHistoryDAL,
permissionService,
+ licenseService,
gatewayV2DAL,
gatewayPoolDAL,
gatewayPoolService,
diff --git a/backend/src/services/approval-policy/approval-policy-service.ts b/backend/src/services/approval-policy/approval-policy-service.ts
index 0e195e61c3..4a1f375305 100644
--- a/backend/src/services/approval-policy/approval-policy-service.ts
+++ b/backend/src/services/approval-policy/approval-policy-service.ts
@@ -9,6 +9,7 @@ import {
TApprovalRequests
} from "@app/db/schemas";
import { TUserGroupMembershipDALFactory } from "@app/ee/services/group/user-group-membership-dal";
+import { TLicenseServiceFactory } from "@app/ee/services/license/license-service";
import { TPermissionServiceFactory } from "@app/ee/services/permission/permission-service-types";
import {
ProjectPermissionApprovalRequestActions,
@@ -95,6 +96,7 @@ type TApprovalPolicyServiceFactoryDep = {
TPermissionServiceFactory,
"getProjectPermission" | "getOrgPermission" | "getResourcePermission"
>;
+ licenseService: Pick<TLicenseServiceFactory, "getPlan">;
projectMembershipDAL: Pick<TProjectMembershipDALFactory, "findProjectMembershipsByUserIds">;
membershipDAL: Pick<TMembershipDALFactory, "find">;
pkiApplicationDAL: Pick<TPkiApplicationDALFactory, "findById">;
@@ -120,6 +122,7 @@ export const approvalPolicyServiceFactory = ({
userGroupMembershipDAL,
notificationService,
permissionService,
+ licenseService,
projectMembershipDAL,
membershipDAL,
pkiApplicationDAL,
@@ -568,6 +571,17 @@ export const approvalPolicyServiceFactory = ({
ResourcePermissionApprovalPolicyActions.Create
);
+ // CertRequest only: code signing follows pkiCodeSigning and PAM has its own product entitlement.
+ if (policyType === ApprovalPolicyType.CertRequest) {
+ const plan = await licenseService.getPlan(actor.orgId);
+ if (!plan.pkiApprovals) {
+ throw new BadRequestError({
+ message:
+ "Failed to create certificate approval policy due to plan restriction. Upgrade plan to use certificate approvals."
+ });
+ }
+ }
+
// Bypass-related fields are PAM-only at the moment. The schema accepts them on every policy
// type for forward-compat, but the service rejects non-PAM use so admins can't silently store
// configuration that the bypass branch will never honor.
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.ts
index 0831d2dd1e..fc44d13f14 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
@@ -1,6 +1,7 @@
import { ForbiddenError, subject } from "@casl/ability";
import { ActionProjectType } from "@app/db/schemas";
+import { TLicenseServiceFactory } from "@app/ee/services/license/license-service";
import { TPermissionServiceFactory } from "@app/ee/services/permission/permission-service-types";
import {
ProjectPermissionCertificateAuthorityActions,
@@ -31,6 +32,13 @@ import {
VenafiDestinationConfigSchema
} from "./ca-signing-config-types";
+// Signing through a third-party provider is the same capability as connecting one as an external CA.
+const EXTERNAL_SIGNING_TYPES: string[] = [
+ CaSigningConfigType.Venafi,
+ CaSigningConfigType.AzureAdCs,
+ CaSigningConfigType.Adcs
+];
+
type TCaSigningConfigServiceFactoryDep = {
caSigningConfigDAL: Pick<
TCaSigningConfigDALFactory,
@@ -39,6 +47,7 @@ type TCaSigningConfigServiceFactoryDep = {
certificateAuthorityDAL: Pick<TCertificateAuthorityDALFactory, "findById" | "findByIdWithAssociatedCa">;
internalCertificateAuthorityDAL: Pick<TInternalCertificateAuthorityDALFactory, "findOne" | "updateById">;
permissionService: Pick<TPermissionServiceFactory, "getProjectPermission">;
+ licenseService: Pick<TLicenseServiceFactory, "getPlan">;
appConnectionDAL: Pick<TAppConnectionDALFactory, "findById">;
appConnectionService: Pick<TAppConnectionServiceFactory, "validateAppConnectionUsageById">;
caAutoRenewalQueue: Pick<
@@ -54,6 +63,7 @@ export const caSigningConfigServiceFactory = ({
certificateAuthorityDAL,
internalCertificateAuthorityDAL,
permissionService,
+ licenseService,
appConnectionDAL,
appConnectionService,
caAutoRenewalQueue
@@ -160,10 +170,19 @@ export const caSigningConfigServiceFactory = ({
await validateAdcsAppConnectionUsage(appConnectionId, ca.projectId, permissionActor);
}
- const isExternalCa =
- type === CaSigningConfigType.Venafi ||
- type === CaSigningConfigType.AzureAdCs ||
- type === CaSigningConfigType.Adcs;
+ const isExternalCa = EXTERNAL_SIGNING_TYPES.includes(type);
+
+ // An org already signing through a provider can re-save or switch between them; only introducing
+ // one is refused. updateSigningConfig takes no type, so it cannot reach this.
+ if (isExternalCa && !EXTERNAL_SIGNING_TYPES.includes(existing?.type ?? "")) {
+ const plan = await licenseService.getPlan(actorOrgId);
+ if (!plan.pkiEnterpriseCaIntegrations) {
+ throw new BadRequestError({
+ message:
+ "Failed to sign this certificate authority through a third-party provider due to plan restriction. Upgrade plan to connect an external certificate authority."
+ });
+ }
+ }
const config = await caSigningConfigDAL.transaction(async (tx) => {
if (existing) {
diff --git a/backend/src/services/certificate-authority/certificate-authority-service.ts b/backend/src/services/certificate-authority/certificate-authority-service.ts
index 577b91383d..627cbbe969 100644
--- a/backend/src/services/certificate-authority/certificate-authority-service.ts
+++ b/backend/src/services/certificate-authority/certificate-authority-service.ts
@@ -80,6 +80,7 @@ import {
} from "./azure-ad-cs/azure-ad-cs-certificate-authority-types";
import { TCertificateAuthorityDALFactory } from "./certificate-authority-dal";
import { CaType } from "./certificate-authority-enums";
+import { CERTIFICATE_AUTHORITIES_TYPE_MAP } from "./certificate-authority-maps";
import { TCertificateAuthoritySecretDALFactory } from "./certificate-authority-secret-dal";
import {
TCertificateAuthority,
@@ -326,6 +327,12 @@ export const certificateAuthorityServiceFactory = ({
});
}
+ if (type !== CaType.INTERNAL && type !== CaType.ACME && !plan.pkiEnterpriseCaIntegrations) {
+ throw new BadRequestError({
+ message: `Failed to connect ${CERTIFICATE_AUTHORITIES_TYPE_MAP[type]} due to plan restriction. Upgrade plan to connect an external certificate authority.`
+ });
+ }
+
if (type === CaType.INTERNAL) {
const internalConfig = configuration as TCreateInternalCertificateAuthorityDTO["configuration"];
diff --git a/backend/src/services/certificate-authority/internal/internal-certificate-authority-service.ts b/backend/src/services/certificate-authority/internal/internal-certificate-authority-service.ts
index f813a0f74f..e3861b2fab 100644
--- a/backend/src/services/certificate-authority/internal/internal-certificate-authority-service.ts
+++ b/backend/src/services/certificate-authority/internal/internal-certificate-authority-service.ts
@@ -172,6 +172,15 @@ export const internalCertificateAuthorityServiceFactory = ({
const $validatePqcLicense = (keyAlgorithm: string, projectId: string) =>
validatePqcLicense({ keyAlgorithm, projectId, projectDAL, licenseService });
+ // Gates only Infisical's own distribution point. Custom URLs are gated where the CA is configured.
+ const $isManagedCrlDistributionAllowed = async (projectId: string) => {
+ const project = await projectDAL.findById(projectId);
+ if (!project) throw new NotFoundError({ message: `Project with ID '${projectId}' not found` });
+
+ const plan = await licenseService.getPlan(project.orgId);
+ return plan.caCrl;
+ };
+
// Root CAs: only keyCertSign + cRLSign (they don't perform end-entity operations)
const ROOT_CA_KEY_USAGES = x509.KeyUsageFlags.keyCertSign | x509.KeyUsageFlags.cRLSign;
// PQC root CAs also need digitalSignature per FIPS 204/205
@@ -344,6 +353,14 @@ export const internalCertificateAuthorityServiceFactory = ({
await $validatePqcLicense(keyAlgorithm, projectId);
+ // Refused rather than silently dropped, since the caller asked for it explicitly.
+ if (crlDistributionPointUrls?.length && !(await $isManagedCrlDistributionAllowed(projectId))) {
+ throw new BadRequestError({
+ message:
+ "Failed to create certificate authority with CRL distribution points due to plan restriction. Upgrade plan to use certificate revocation lists."
+ });
+ }
+
const dn = createDistinguishedName({
commonName,
organization,
@@ -664,6 +681,17 @@ export const internalCertificateAuthorityServiceFactory = ({
);
}
+ // Gating creation alone would let an org create a CA with no distribution points and patch them in.
+ // Keyed on newly added URLs, so keeping, reordering, or clearing the existing set stays open, as does
+ // toggling the managed distribution point.
+ const storedCrlUrls = new Set(ca.internalCa.crlDistributionPointUrls ?? []);
+ const addedCrlUrl = (crlDistributionPointUrls ?? []).find((url) => !storedCrlUrls.has(url));
+ if (addedCrlUrl && !(await $isManagedCrlDistributionAllowed(ca.projectId))) {
+ throw new BadRequestError({
+ message: `Failed to add the CRL distribution point '${addedCrlUrl}' due to plan restriction. Upgrade plan to use certificate revocation lists.`
+ });
+ }
+
const updatedCa = await certificateAuthorityDAL.transaction(async (tx) => {
if (status !== undefined || name !== undefined) {
await certificateAuthorityDAL.updateById(ca.id, { status, name }, tx);
@@ -1546,6 +1574,21 @@ export const internalCertificateAuthorityServiceFactory = ({
});
}
+ // No internal parent means the certificate was signed outside Infisical. createCa cannot tell the
+ // two apart, because parentCaId is written here rather than at creation.
+ if (!isInternal && ca.internalCa.type === InternalCaType.INTERMEDIATE && !parentCaId) {
+ const caProject = await projectDAL.findById(ca.projectId);
+ if (!caProject) throw new NotFoundError({ message: `Project with ID '${ca.projectId}' not found` });
+
+ const plan = await licenseService.getPlan(caProject.orgId);
+ if (!plan.pkiExternalIntermediateCa) {
+ throw new BadRequestError({
+ message:
+ "Failed to import an externally signed certificate for this intermediate CA due to plan restriction. Upgrade plan to use externally signed intermediate CAs."
+ });
+ }
+ }
+
const caCert = ca.internalCa.activeCaCertId
? await certificateAuthorityCertDAL.findById(ca.internalCa.activeCaCertId)
: undefined;
@@ -2012,7 +2055,7 @@ export const internalCertificateAuthorityServiceFactory = ({
const cdpUrls = buildCrlDistributionPointUrls(
managedCdpUrl,
ca.internalCa.crlDistributionPointUrls,
- ca.internalCa.disableManagedCrlDistributionPointUrl
+ ca.internalCa.disableManagedCrlDistributionPointUrl || !(await $isManagedCrlDistributionAllowed(ca.projectId))
);
const basicConstraintsExtension = $createBasicConstraintsExtension({
@@ -2427,7 +2470,7 @@ export const internalCertificateAuthorityServiceFactory = ({
const cdpUrls = buildCrlDistributionPointUrls(
managedCdpUrl,
ca.internalCa.crlDistributionPointUrls,
- ca.internalCa.disableManagedCrlDistributionPointUrl
+ ca.internalCa.disableManagedCrlDistributionPointUrl || !(await $isManagedCrlDistributionAllowed(ca.projectId))
);
const basicConstraintsExtension = $createBasicConstraintsExtension({
diff --git a/backend/src/services/certificate-common/certificate-utils.ts b/backend/src/services/certificate-common/certificate-utils.ts
index 59aa09ed02..2839cf2915 100644
--- a/backend/src/services/certificate-common/certificate-utils.ts
+++ b/backend/src/services/certificate-common/certificate-utils.ts
@@ -3,6 +3,7 @@ import RE2 from "re2";
import { TLicenseServiceFactory } from "@app/ee/services/license/license-service";
import { isPqcAlgorithm } from "@app/lib/crypto/pqc";
import { BadRequestError, NotFoundError } from "@app/lib/errors";
+import { isWildcardPattern, matchesNormalizedPattern } from "@app/services/certificate-policy/certificate-policy-fns";
import { TSubjectRule } from "@app/services/certificate-policy/certificate-policy-types";
import { TProjectDALFactory } from "@app/services/project/project-dal";
@@ -39,6 +40,57 @@ export const validatePqcLicense = async ({
}
};
+// Call with the request as it will actually be signed. A PQC algorithm or wildcard that only appears
+// in a CSR or a profile default is invisible until applyProfileDefaults has run.
+export const validateCertificateRequestLicense = async ({
+ request,
+ projectId,
+ projectDAL,
+ licenseService
+}: {
+ request: {
+ keyAlgorithm?: string;
+ signatureAlgorithm?: string;
+ commonName?: string;
+ // applyProfileDefaults keys off altNames; a CSR-derived request keeps its SANs in
+ // subjectAlternativeNames. Either can hold the wildcard.
+ altNames?: { value: string }[];
+ subjectAlternativeNames?: { value: string }[];
+ };
+ projectId: string;
+ projectDAL: Pick<TProjectDALFactory, "findById">;
+ licenseService: Pick<TLicenseServiceFactory, "getPlan">;
+}) => {
+ const pqcAlgorithm = [request.keyAlgorithm, request.signatureAlgorithm].find(
+ (algorithm): algorithm is string => !!algorithm && isPqcAlgorithm(algorithm)
+ );
+ const wildcardSan = [
+ ...(request.commonName ? [request.commonName] : []),
+ ...(request.altNames ?? []).map(({ value }) => value),
+ ...(request.subjectAlternativeNames ?? []).map(({ value }) => value)
+ ].find(isWildcardPattern);
+
+ if (!pqcAlgorithm && !wildcardSan) return;
+
+ const project = await projectDAL.findById(projectId);
+ if (!project) throw new NotFoundError({ message: `Project with ID '${projectId}' not found` });
+
+ const plan = await licenseService.getPlan(project.orgId);
+
+ if (pqcAlgorithm && !plan.pkiPqc) {
+ throw new BadRequestError({
+ message:
+ "Your license does not include PQC algorithms. Please upgrade to the Enterprise plan to use a PQC algorithm."
+ });
+ }
+
+ if (wildcardSan && !plan.pkiWildcardSans) {
+ throw new BadRequestError({
+ message: `Failed to issue certificate with wildcard name '${wildcardSan}' due to plan restriction. Upgrade plan to issue wildcard certificates.`
+ });
+ }
+};
+
interface CertificateRequestInput {
keyUsages?: string[];
extendedKeyUsages?: string[];
@@ -113,44 +165,13 @@ export const buildCertificateSubjectFromTemplate = (
return subject;
};
-const isWildcardPattern = (value: string): boolean => {
- return value.includes("*");
-};
-
-const createWildcardRegex = (pattern: string): RE2 => {
- const escapeRegex = new RE2(/[.+?^${}()|[\]\\]/g);
- const escaped = pattern.replace(escapeRegex, "\\$&");
- const wildcardRegex = new RE2(/\*/g);
- const regexPattern = escaped.replace(wildcardRegex, ".*");
- return new RE2(`^${regexPattern}$`);
-};
-
const validateValueAgainstPatterns = (value: string, patterns: string[]): boolean => {
if (!patterns || patterns.length === 0) {
return false;
}
const normalizedValue = value.toLowerCase();
-
- for (const pattern of patterns) {
- const normalizedPattern = pattern.toLowerCase();
- if (isWildcardPattern(pattern)) {
- try {
- const regex = createWildcardRegex(normalizedPattern);
- if (regex.test(normalizedValue)) {
- return true;
- }
- } catch {
- if (normalizedPattern === normalizedValue) {
- return true;
- }
- }
- } else if (normalizedPattern === normalizedValue) {
- return true;
- }
- }
-
- return false;
+ return patterns.some((pattern) => matchesNormalizedPattern(normalizedValue, pattern.toLowerCase()));
};
export const buildSubjectAlternativeNamesFromTemplate = (
diff --git a/backend/src/services/certificate-v3/certificate-v3-service.ts b/backend/src/services/certificate-v3/certificate-v3-service.ts
index c283f09a6e..b3ff6894c3 100644
--- a/backend/src/services/certificate-v3/certificate-v3-service.ts
+++ b/backend/src/services/certificate-v3/certificate-v3-service.ts
@@ -84,7 +84,7 @@ import {
mapEnumsForValidation,
normalizeDateForApi,
removeRootCaFromChain,
- validatePqcLicense
+ validateCertificateRequestLicense
} from "../certificate-common/certificate-utils";
import { TCertificateRequest } from "../certificate-policy/certificate-policy-types";
import { TCertificateRequestDALFactory } from "../certificate-request/certificate-request-dal";
@@ -538,23 +538,6 @@ export const certificateV3ServiceFactory = ({
EnrollmentType.API
);
- if (certificateRequest.keyAlgorithm) {
- await validatePqcLicense({
- keyAlgorithm: certificateRequest.keyAlgorithm,
- projectId: profile.projectId,
- projectDAL,
- licenseService
- });
- }
- if (certificateRequest.signatureAlgorithm) {
- await validatePqcLicense({
- keyAlgorithm: certificateRequest.signatureAlgorithm,
- projectId: profile.projectId,
- projectDAL,
- licenseService
- });
- }
-
const approvalFactory = APPROVAL_POLICY_FACTORY_MAP[ApprovalPolicyType.CertRequest](ApprovalPolicyType.CertRequest);
const matchedApprovalPolicy = (await approvalFactory.matchPolicy(
approvalPolicyDAL as TApprovalPolicyDALFactory,
@@ -567,6 +550,13 @@ export const certificateV3ServiceFactory = ({
const certificateRequestWithDefaults = applyProfileDefaults(certificateRequest, profile.defaults);
+ await validateCertificateRequestLicense({
+ request: certificateRequestWithDefaults,
+ projectId: profile.projectId,
+ projectDAL,
+ licenseService
+ });
+
if (matchedApprovalPolicy && !shouldBypassApproval(actor, matchedApprovalPolicy)) {
const approvalPolicy = matchedApprovalPolicy;
@@ -1277,6 +1267,14 @@ export const certificateV3ServiceFactory = ({
mappedCertificateRequest.keyAlgorithm = extractedKeyAlgorithm;
mappedCertificateRequest.signatureAlgorithm = extractedSignatureAlgorithm;
+ // Also the gate for ACME, SCEP and EST, which all reach issuance through here.
+ await validateCertificateRequestLicense({
+ request: mappedCertificateRequest,
+ projectId: profile.projectId,
+ projectDAL,
+ licenseService
+ });
+
// When notAfter is explicitly provided, validate using date range (notAfter overrides TTL in cert generation).
// Otherwise, validate using TTL. These are mutually exclusive to avoid "Cannot specify both" validation error.
if (notAfter) {
@@ -1747,6 +1745,13 @@ export const certificateV3ServiceFactory = ({
mappedCertificateRequest.signatureAlgorithm = extractedSignatureAlgorithm;
}
+ await validateCertificateRequestLicense({
+ request: mappedCertificateRequest,
+ projectId: profile.projectId,
+ projectDAL,
+ licenseService
+ });
+
const validationResult = await certificatePolicyService.validateCertificateRequest(
profile.certificatePolicyId,
mappedCertificateRequest
diff --git a/backend/src/services/license-client/feature-mapping.ts b/backend/src/services/license-client/feature-mapping.ts
index 3f2347fd34..fae994b28f 100644
--- a/backend/src/services/license-client/feature-mapping.ts
+++ b/backend/src/services/license-client/feature-mapping.ts
@@ -264,8 +264,38 @@ const certManagerMappings: TFeatureMapping[] = [
v1Field: "pkiCodeSigning"
},
{
- v2Key: "enterprise_certificate_syncs",
- v1Field: "enterpriseCertificateSyncs"
+ // Defaults on, so the free plan has to send false; the features below default off instead.
+ v2Key: "pki_wildcard_sans",
+ v1Field: "pkiWildcardSans"
+ },
+ {
+ v2Key: "pki_enterprise_ca_integrations",
+ v1Field: "pkiEnterpriseCaIntegrations"
+ },
+ {
+ v2Key: "pki_external_intermediate_ca",
+ v1Field: "pkiExternalIntermediateCa"
+ },
+ {
+ v2Key: "pki_discovery",
+ v1Field: "pkiDiscovery"
+ },
+ {
+ v2Key: "pki_enterprise_alerting",
+ v1Field: "pkiEnterpriseAlerting"
+ },
+ {
+ v2Key: "pki_approvals",
+ v1Field: "pkiApprovals"
+ },
+ {
+ v2Key: "pki_syncs",
+ v1Field: "pkiSyncs"
+ },
+ {
+ // Declared for completeness; enforcement lands with the CA/certificate counting work.
+ v2Key: "max_sans_per_certificate",
+ v1Field: "maxSansPerCertificate"
},
{
// v2's `internal_cas` is a usage meter; the internal-CA cap is a separate v2 feature
diff --git a/backend/src/services/pki-alert-v2/pki-alert-v2-service.ts b/backend/src/services/pki-alert-v2/pki-alert-v2-service.ts
index b13dc935d2..175b4ca5cb 100644
--- a/backend/src/services/pki-alert-v2/pki-alert-v2-service.ts
+++ b/backend/src/services/pki-alert-v2/pki-alert-v2-service.ts
@@ -1,6 +1,7 @@
import { ForbiddenError } from "@casl/ability";
import { ActionProjectType, ProjectMembershipRole, ResourceType } from "@app/db/schemas";
+import { TLicenseServiceFactory } from "@app/ee/services/license/license-service";
import { TPermissionServiceFactory } from "@app/ee/services/permission/permission-service-types";
import { ProjectPermissionActions, ProjectPermissionSub } from "@app/ee/services/permission/project-permission";
import { ResourcePermissionSub } from "@app/ee/services/permission/resource-permission";
@@ -72,6 +73,7 @@ type TPkiAlertV2ServiceFactoryDep = {
pkiAlertChannelDAL: Pick<TPkiAlertChannelDALFactory, "create" | "findByAlertId" | "deleteByAlertId" | "insertMany">;
pkiAlertHistoryDAL: Pick<TPkiAlertHistoryDALFactory, "createWithCertificates" | "findByAlertId">;
permissionService: Pick<TPermissionServiceFactory, "getProjectPermission" | "getResourcePermission">;
+ licenseService: Pick<TLicenseServiceFactory, "getPlan">;
smtpService: Pick<TSmtpService, "sendMail">;
kmsService: Pick<TKmsServiceFactory, "createCipherPairWithDataKey">;
notificationService: Pick<TNotificationServiceFactory, "createUserNotifications">;
@@ -87,6 +89,7 @@ export const pkiAlertV2ServiceFactory = ({
pkiAlertChannelDAL,
pkiAlertHistoryDAL,
permissionService,
+ licenseService,
smtpService,
kmsService,
notificationService,
@@ -236,6 +239,16 @@ export const pkiAlertV2ServiceFactory = ({
actorOrgId
});
+ const nonEmailChannel = channels.find((channel) => channel.channelType !== PkiAlertChannelType.EMAIL);
+ if (nonEmailChannel) {
+ const plan = await licenseService.getPlan(actorOrgId);
+ if (!plan.pkiEnterpriseAlerting) {
+ throw new BadRequestError({
+ message: `Failed to create alert with a ${nonEmailChannel.channelType} channel due to plan restriction. Upgrade plan to alert on channels other than email.`
+ });
+ }
+ }
+
if (eventType === PkiAlertEventType.EXPIRATION && !alertBefore) {
throw new BadRequestError({ message: "alertBefore is required for expiration alerts" });
}
@@ -413,6 +426,23 @@ export const pkiAlertV2ServiceFactory = ({
}
}
+ // An update replaces the channel set wholesale, so creation-only gating would let an org save an
+ // email-only alert and patch Slack into it. Keeping the types it already has stays allowed.
+ const addedChannelTypes = channels?.filter((channel) => channel.channelType !== PkiAlertChannelType.EMAIL);
+ if (addedChannelTypes?.length) {
+ const plan = await licenseService.getPlan(actorOrgId);
+ if (!plan.pkiEnterpriseAlerting) {
+ const existingChannels = await pkiAlertChannelDAL.findByAlertId(alertId);
+ const existingTypes = new Set(existingChannels.map((channel) => channel.channelType));
+ const newChannel = addedChannelTypes.find((channel) => !existingTypes.has(channel.channelType));
+ if (newChannel) {
+ throw new BadRequestError({
+ message: `Failed to add a ${newChannel.channelType} channel to this alert due to plan restriction. Upgrade plan to alert on channels other than email.`
+ });
+ }
+ }
+ }
+
const updateData: {
name?: string;
description?: string;
diff --git a/backend/src/services/pki-sync/pki-sync-fns.ts b/backend/src/services/pki-sync/pki-sync-fns.ts
index e80b0690c6..2e9b42ccab 100644
--- a/backend/src/services/pki-sync/pki-sync-fns.ts
+++ b/backend/src/services/pki-sync/pki-sync-fns.ts
@@ -54,8 +54,6 @@ import { TCertificateMap, THealthCheckTarget, TPkiSyncSyncResult, TPkiSyncWithCr
import { WINDOWS_SERVER_PKI_SYNC_LIST_OPTION } from "./windows-server/windows-server-pki-sync-constants";
import { windowsServerPkiSyncFactory } from "./windows-server/windows-server-pki-sync-fns";
-const ENTERPRISE_PKI_SYNCS: PkiSync[] = [];
-
const PKI_SYNC_LIST_OPTIONS = {
[PkiSync.AzureKeyVault]: AZURE_KEY_VAULT_PKI_SYNC_LIST_OPTION,
[PkiSync.AwsCertificateManager]: AWS_CERTIFICATE_MANAGER_PKI_SYNC_LIST_OPTION,
@@ -72,15 +70,15 @@ const PKI_SYNC_LIST_OPTIONS = {
[PkiSync.NutanixPrismCentral]: NUTANIX_PRISM_CENTRAL_PKI_SYNC_LIST_OPTION
};
-export const enterprisePkiSyncCheck = async (
+// Creation path only, never pki-sync-queue, so existing syncs keep running after a downgrade.
+export const assertPkiSyncLicense = async (
licenseService: Pick<TLicenseServiceFactory, "getPlan">,
orgId: string,
- pkiSyncDestination: PkiSync,
errorMessage?: string
) => {
const plan = await licenseService.getPlan(orgId);
- if (!plan.enterpriseCertificateSyncs && ENTERPRISE_PKI_SYNCS.includes(pkiSyncDestination)) {
+ if (!plan.pkiSyncs) {
throw new BadRequestError({
message: errorMessage || "Failed to create PKI sync due to plan restriction. Upgrade plan to create PKI sync."
});
diff --git a/backend/src/services/pki-sync/pki-sync-queue.ts b/backend/src/services/pki-sync/pki-sync-queue.ts
index 0ca06e8332..e8b966b0cc 100644
--- a/backend/src/services/pki-sync/pki-sync-queue.ts
+++ b/backend/src/services/pki-sync/pki-sync-queue.ts
@@ -6,7 +6,6 @@ import { randomUUID } from "crypto";
import { EventType, TAuditLogServiceFactory } from "@app/ee/services/audit-log/audit-log-types";
import { TGatewayPoolServiceFactory } from "@app/ee/services/gateway-pool/gateway-pool-service";
import { TGatewayV2ServiceFactory } from "@app/ee/services/gateway-v2/gateway-v2-service";
-import { TLicenseServiceFactory } from "@app/ee/services/license/license-service";
import { KeyStorePrefixes, TKeyStoreFactory } from "@app/keystore/keystore";
import { getConfig } from "@app/lib/config/env";
import { logger } from "@app/lib/logger";
@@ -41,7 +40,6 @@ import {
import { PkiSyncError } from "./pki-sync-errors";
import { notifyPkiSyncFailure } from "./pki-sync-failure-notification-fns";
import {
- enterprisePkiSyncCheck,
getPkiSyncProviderCapabilities,
parsePkiSyncErrorMessage,
PkiSyncFns,
@@ -87,7 +85,6 @@ type TPkiSyncQueueFactoryDep = {
notificationService: Pick<TNotificationServiceFactory, "createUserNotifications">;
pkiApplicationDAL: Pick<TPkiApplicationDALFactory, "findById">;
projectDAL: TProjectDALFactory;
- licenseService: Pick<TLicenseServiceFactory, "getPlan">;
certificateDAL: TCertificateDALFactory;
certificateBodyDAL: Pick<TCertificateBodyDALFactory, "findOne" | "create">;
certificateSecretDAL: Pick<TCertificateSecretDALFactory, "findOne" | "create">;
@@ -125,7 +122,6 @@ export const pkiSyncQueueFactory = ({
notificationService,
pkiApplicationDAL,
projectDAL,
- licenseService,
certificateDAL,
certificateBodyDAL,
certificateSecretDAL,
@@ -224,13 +220,6 @@ export const pkiSyncQueueFactory = ({
data: { syncId, auditLogInfo }
} = job;
- await enterprisePkiSyncCheck(
- licenseService,
- pkiSync.connection.orgId,
- pkiSync.destination,
- "Failed to sync certificates due to plan restriction. Upgrade plan to access enterprise PKI syncs."
- );
-
await pkiSyncDAL.updateById(syncId, {
syncStatus: PkiSyncStatus.Running
});
@@ -614,13 +603,6 @@ export const pkiSyncQueueFactory = ({
data: { syncId, auditLogInfo, deleteSyncOnComplete, certificateIds: certificateIdsToRemove }
} = job;
- await enterprisePkiSyncCheck(
- licenseService,
- pkiSync.connection.orgId,
- pkiSync.destination,
- "Failed to remove certificates due to plan restriction. Upgrade plan to access enterprise PKI syncs."
- );
-
await pkiSyncDAL.updateById(syncId, {
removeStatus: PkiSyncStatus.Running
});
diff --git a/backend/src/services/pki-sync/pki-sync-service.ts b/backend/src/services/pki-sync/pki-sync-service.ts
index 4f1cda96fc..f8c622fcad 100644
--- a/backend/src/services/pki-sync/pki-sync-service.ts
+++ b/backend/src/services/pki-sync/pki-sync-service.ts
@@ -29,7 +29,7 @@ import { HEALTH_CHECK_COMMAND_OPTION_KEY, PkiSync, PkiSyncStatus } from "./pki-s
import { PkiSyncExportFormat } from "./pki-sync-export-fns";
import {
assertPkiSyncDestinationConfigAllowsCertificateCount,
- enterprisePkiSyncCheck,
+ assertPkiSyncLicense,
getPkiSyncMaxCertificates,
getPkiSyncProviderCapabilities,
listPkiSyncOptions,
@@ -398,7 +398,7 @@ export const pkiSyncServiceFactory = ({
});
}
- await enterprisePkiSyncCheck(licenseService, actor.orgId, destination);
+ await assertPkiSyncLicense(licenseService, actor.orgId);
let subscriber;
if (subscriberId) {
diff --git a/backend/src/services/signer/signer-service.ts b/backend/src/services/signer/signer-service.ts
index 4de4c51349..0472ed15e1 100644
--- a/backend/src/services/signer/signer-service.ts
+++ b/backend/src/services/signer/signer-service.ts
@@ -421,10 +421,8 @@ export const signerServiceFactory = ({
ProjectPermissionSub.CodeSigners
);
- // pkiCodeSigning is ignored when null (no restriction); only an explicit boolean gates the feature,
- // blocking creation when it is explicitly false.
const plan = await licenseService.getPlan(dto.actorOrgId);
- if (typeof plan.pkiCodeSigning === "boolean" && !plan.pkiCodeSigning) {
+ if (!plan.pkiCodeSigning) {
throw new BadRequestError({
message: "Failed to create code signer due to plan restriction. Upgrade plan to access PKI code signing."
});
diff --git a/frontend/src/components/pki-syncs/PkiSyncSelect.tsx b/frontend/src/components/pki-syncs/PkiSyncSelect.tsx
index 5158024310..d8bab5571f 100644
--- a/frontend/src/components/pki-syncs/PkiSyncSelect.tsx
+++ b/frontend/src/components/pki-syncs/PkiSyncSelect.tsx
@@ -57,11 +57,11 @@ export const PkiSyncSelect = ({ onSelect }: Props) => {
const { popUp, handlePopUpOpen, handlePopUpToggle } = usePopUp(["upgradePlan"] as const);
const [search, setSearch] = useState("");
- const handleSelect = (destination: PkiSync, enterprise?: boolean) => {
- if (enterprise && !subscription.enterpriseCertificateSyncs) {
+ const handleSelect = (destination: PkiSync) => {
+ if (!subscription.pkiSyncs) {
handlePopUpOpen("upgradePlan", {
isEnterpriseFeature: true,
- text: "All Certificate Syncs can be unlocked if you switch to Infisical Enterprise plan."
+ text: "Certificate Syncs can be unlocked if you switch to Infisical Enterprise plan."
});
return;
}
@@ -106,11 +106,11 @@ export const PkiSyncSelect = ({ onSelect }: Props) => {
{filteredOptions.length ? (
<div className="grid grid-cols-1 gap-3 sm:grid-cols-2">
- {filteredOptions.map(({ destination, enterprise }) => (
+ {filteredOptions.map(({ destination }) => (
<SyncCard
key={destination}
destination={destination}
- onClick={() => handleSelect(destination, enterprise)}
+ onClick={() => handleSelect(destination)}
/>
))}
</div>
diff --git a/frontend/src/hooks/api/subscriptions/types.ts b/frontend/src/hooks/api/subscriptions/types.ts
index 61b08d975a..7b2585769a 100644
--- a/frontend/src/hooks/api/subscriptions/types.ts
+++ b/frontend/src/hooks/api/subscriptions/types.ts
@@ -54,16 +54,29 @@ export type SubscriptionPlan = {
| null;
trial_end: number | null;
has_used_trial: boolean;
- caCrl: boolean;
instanceUserManagement: boolean;
gateway: boolean;
gatewayPool: boolean;
pamSlackNotifications: boolean;
externalKms: boolean;
- pkiEst: boolean;
+ // PKI / Cert Manager. The /plan route returns z.any(), so nothing enforces that this mirrors
+ // the backend's TFeatureSet.
pkiAcme: boolean;
- pkiLegacyTemplates: boolean;
+ pkiEst: boolean;
+ pkiScep: boolean;
pkiPqc: boolean;
+ caCrl: boolean;
+ pkiWildcardSans: boolean;
+ pkiEnterpriseCaIntegrations: boolean;
+ pkiExternalIntermediateCa: boolean;
+ pkiDiscovery: boolean;
+ pkiEnterpriseAlerting: boolean;
+ pkiApprovals: boolean;
+ pkiSyncs: boolean;
+ pkiLegacyTemplates: boolean;
+ pkiCodeSigning: boolean;
+ maxInternalCas: number | null;
+ maxSansPerCertificate: number | null;
kmsPqc: boolean;
enforceMfa: boolean;
enforceGoogleSSO: boolean;
@@ -71,7 +84,6 @@ export type SubscriptionPlan = {
kmip: boolean;
secretScanning: boolean;
enterpriseSecretSyncs: boolean;
- enterpriseCertificateSyncs: boolean;
enterpriseAppConnections: boolean;
cardDeclined?: boolean;
cardDeclinedReason?: string;
diff --git a/frontend/src/pages/cert-manager/ApplicationDetailsByIDPage/components/ApplicationSettingsTab.tsx b/frontend/src/pages/cert-manager/ApplicationDetailsByIDPage/components/ApplicationSettingsTab.tsx
index 87addfee61..bc0b3d8694 100644
--- a/frontend/src/pages/cert-manager/ApplicationDetailsByIDPage/components/ApplicationSettingsTab.tsx
+++ b/frontend/src/pages/cert-manager/ApplicationDetailsByIDPage/components/ApplicationSettingsTab.tsx
@@ -17,6 +17,7 @@ import {
Trash2Icon
} from "lucide-react";
+import { UpgradePlanModal } from "@app/components/license/UpgradePlanModal";
import { createNotification } from "@app/components/notifications";
import { DeleteActionModal } from "@app/components/v2";
import {
@@ -56,7 +57,7 @@ import {
TooltipContent,
TooltipTrigger
} from "@app/components/v3";
-import { useProjectPermission } from "@app/context";
+import { useProjectPermission, useSubscription } from "@app/context";
import {
ProjectPermissionCertificateProfileActions,
ProjectPermissionSub
@@ -429,10 +430,25 @@ export const ApplicationSettingsTab = ({ application, profiles }: Props) => {
const attachMutation = useAttachPkiApplicationProfiles();
const detachMutation = useDetachPkiApplicationProfile();
+ const { subscription } = useSubscription();
+
const { popUp, handlePopUpToggle, handlePopUpOpen, handlePopUpClose } = usePopUp([
"policy",
- "deletePolicy"
+ "deletePolicy",
+ "upgradePlan"
] as const);
+
+ // Creation only; existing policies keep enforcing and their requests can still be approved.
+ const handleCreatePolicy = () => {
+ if (!subscription.pkiApprovals) {
+ handlePopUpOpen("upgradePlan", {
+ isEnterpriseFeature: true,
+ text: "Certificate approval policies are available on Infisical's Enterprise plan."
+ });
+ return;
+ }
+ handlePopUpOpen("policy");
+ };
const deletePolicy = useDeleteApprovalPolicy();
const { data: alertsData, isLoading: isAlertsLoading } = useGetPkiAlertsV2({
@@ -744,7 +760,7 @@ export const ApplicationSettingsTab = ({ application, profiles }: Props) => {
<span tabIndex={0}>
<Button
variant="outline"
- onClick={() => handlePopUpOpen("policy")}
+ onClick={handleCreatePolicy}
isDisabled={!canManagePolicies}
>
<FontAwesomeIcon icon={faPlus} />
@@ -859,6 +875,11 @@ export const ApplicationSettingsTab = ({ application, profiles }: Props) => {
handlePopUpToggle={handlePopUpToggle}
applicationId={application.id}
/>
+ <UpgradePlanModal
+ isOpen={popUp.upgradePlan.isOpen}
+ onOpenChange={(isOpen) => handlePopUpToggle("upgradePlan", isOpen)}
+ text={(popUp.upgradePlan?.data as { text: string })?.text}
+ />
<DeleteActionModal
isOpen={popUp.deletePolicy.isOpen}
deleteKey="delete"
diff --git a/frontend/src/pages/cert-manager/CertificateAuthoritiesPage/components/CaInstallCertModal/CaInstallCertModal.tsx b/frontend/src/pages/cert-manager/CertificateAuthoritiesPage/components/CaInstallCertModal/CaInstallCertModal.tsx
index dec26d7bde..ddb0f9b234 100644
--- a/frontend/src/pages/cert-manager/CertificateAuthoritiesPage/components/CaInstallCertModal/CaInstallCertModal.tsx
+++ b/frontend/src/pages/cert-manager/CertificateAuthoritiesPage/components/CaInstallCertModal/CaInstallCertModal.tsx
@@ -9,6 +9,7 @@ import {
import { Modal, ModalContent } from "@app/components/v2";
import { Badge, Button } from "@app/components/v3";
+import { useSubscription } from "@app/context";
import { UsePopUpState } from "@app/hooks/usePopUp";
import { AdcsCaInstallForm } from "./AdcsCaInstallForm";
@@ -100,6 +101,7 @@ type RadioCardProps = {
name: string;
description: string;
badge?: string;
+ isLocked?: boolean;
className?: string;
};
@@ -110,15 +112,17 @@ const RadioCard = ({
name,
description,
badge,
+ isLocked,
className
}: RadioCardProps) => (
<button
type="button"
onClick={onClick}
- className={`flex items-center gap-4 rounded-md border px-4 py-4 text-left transition-colors ${
+ disabled={isLocked}
+ className={`flex items-center gap-4 rounded-md border px-4 py-4 text-left transition-colors disabled:cursor-not-allowed disabled:opacity-60 ${
isSelected
? "border-project/50 bg-project/5"
- : "border-mineshaft-600 bg-mineshaft-700 hover:bg-mineshaft-600"
+ : "border-mineshaft-600 bg-mineshaft-700 enabled:hover:bg-mineshaft-600"
} ${className ?? ""}`}
>
{icon}
@@ -126,6 +130,7 @@ const RadioCard = ({
<div className="flex items-center gap-2">
<span className="text-sm font-medium text-mineshaft-100">{name}</span>
{badge && <Badge variant="neutral">{badge}</Badge>}
+ {isLocked && <Badge variant="info">Enterprise</Badge>}
</div>
<p className="mt-0.5 text-xs text-mineshaft-400">{description}</p>
</div>
@@ -143,6 +148,15 @@ export const CaInstallCertModal = ({ popUp, handlePopUpToggle }: Props) => {
const popupData = popUp?.installCaCert?.data as { caId: string } | undefined;
const caId = popupData?.caId ?? "";
+ const { subscription } = useSubscription();
+
+ // Signing an intermediate outside Infisical: Manual is the CSR/import flow, Automated connects a
+ // third-party provider. Infisical CA stays available on every plan.
+ const lockedMethods: Partial<Record<SigningMethod, boolean>> = {
+ [SigningMethod.Manual]: !subscription.pkiExternalIntermediateCa,
+ [SigningMethod.Automated]: !subscription.pkiEnterpriseCaIntegrations
+ };
+
const [step, setStep] = useState<Step>(Step.ChooseMethod);
const [selectedMethod, setSelectedMethod] = useState<SigningMethod | null>(null);
const [selectedIntegration, setSelectedIntegration] = useState<string | null>(null);
@@ -203,6 +217,7 @@ export const CaInstallCertModal = ({ popUp, handlePopUpToggle }: Props) => {
<RadioCard
key={option.value}
isSelected={selectedMethod === option.value}
+ isLocked={lockedMethods[option.value]}
onClick={() => setSelectedMethod(option.value)}
icon={
<div className="flex h-10 w-10 shrink-0 items-center justify-center rounded-md bg-mineshaft-600">
diff --git a/frontend/src/pages/cert-manager/CertificateAuthoritiesPage/components/ExternalCaModal.tsx b/frontend/src/pages/cert-manager/CertificateAuthoritiesPage/components/ExternalCaModal.tsx
index c2d30267ad..14c9e12ce4 100644
--- a/frontend/src/pages/cert-manager/CertificateAuthoritiesPage/components/ExternalCaModal.tsx
+++ b/frontend/src/pages/cert-manager/CertificateAuthoritiesPage/components/ExternalCaModal.tsx
@@ -5,6 +5,7 @@ import { ArrowLeftIcon, Loader2Icon, Lock, type LucideIcon, Search } from "lucid
import { createNotification } from "@app/components/notifications";
import {
+ Badge,
Button,
Field,
FieldDescription,
@@ -20,7 +21,7 @@ import {
SheetHeader,
SheetTitle
} from "@app/components/v3";
-import { useProject } from "@app/context";
+import { useProject, useSubscription } from "@app/context";
import {
TAvailableAppConnection,
useListAvailableAppConnections
@@ -175,13 +176,22 @@ const CA_TYPE_MEDIA: Partial<Record<CaType, Pick<ExternalCaOption, "image" | "ic
EXTERNAL_CA_OPTIONS.map((option) => [option.type, { image: option.image, icon: option.icon }])
);
-const CaTypeCard = ({ option, onClick }: { option: ExternalCaOption; onClick: () => void }) => {
+const CaTypeCard = ({
+ option,
+ onClick,
+ isLocked
+}: {
+ option: ExternalCaOption;
+ onClick: () => void;
+ isLocked?: boolean;
+}) => {
const Icon = option.icon;
return (
<button
type="button"
onClick={onClick}
- className="group flex cursor-pointer flex-col gap-3 rounded-md border border-border bg-card p-4 text-left transition-colors hover:border-mineshaft-500 hover:bg-mineshaft-700/50"
+ disabled={isLocked}
+ className="group flex cursor-pointer flex-col gap-3 rounded-md border border-border bg-card p-4 text-left transition-colors hover:border-mineshaft-500 hover:bg-mineshaft-700/50 disabled:cursor-not-allowed disabled:opacity-60 disabled:hover:border-border disabled:hover:bg-card"
>
<div className="flex items-start justify-between gap-2">
<div className="flex h-9 w-9 items-center justify-center rounded-md bg-mineshaft-700">
@@ -195,9 +205,13 @@ const CaTypeCard = ({ option, onClick }: { option: ExternalCaOption; onClick: ()
Icon && <Icon className="h-5 w-5 text-foreground" />
)}
</div>
- <span className="text-[10px] font-medium tracking-wider text-muted uppercase">
- {option.category}
- </span>
+ {isLocked ? (
+ <Badge variant="info">Enterprise</Badge>
+ ) : (
+ <span className="text-[10px] font-medium tracking-wider text-muted uppercase">
+ {option.category}
+ </span>
+ )}
</div>
<div className="flex flex-col gap-1">
<p className="text-sm font-semibold text-foreground">{option.name}</p>
@@ -209,6 +223,7 @@ const CaTypeCard = ({ option, onClick }: { option: ExternalCaOption; onClick: ()
export const ExternalCaModal = ({ popUp, handlePopUpToggle }: Props) => {
const { currentProject } = useProject();
+ const { subscription } = useSubscription();
const { data: ca, isLoading: isCaLoading } = useGetCa({
caId: (popUp?.ca?.data as { caId: string })?.caId || "",
@@ -334,7 +349,11 @@ export const ExternalCaModal = ({ popUp, handlePopUpToggle }: Props) => {
}
};
+ const isCaTypeLocked = (type: CaType) =>
+ type !== CaType.ACME && !subscription.pkiEnterpriseCaIntegrations;
+
const handleSelectType = (type: CaType) => {
+ if (isCaTypeLocked(type)) return;
reset(getInitialValuesForType(type));
setSelectedType(type);
};
@@ -877,6 +896,7 @@ export const ExternalCaModal = ({ popUp, handlePopUpToggle }: Props) => {
key={option.type}
option={option}
onClick={() => handleSelectType(option.type)}
+ isLocked={isCaTypeLocked(option.type)}
/>
))}
</div>
diff --git a/frontend/src/pages/cert-manager/DiscoveryPage/components/DiscoveryJobsTab.tsx b/frontend/src/pages/cert-manager/DiscoveryPage/components/DiscoveryJobsTab.tsx
index c873cda678..57fd08f154 100644
--- a/frontend/src/pages/cert-manager/DiscoveryPage/components/DiscoveryJobsTab.tsx
+++ b/frontend/src/pages/cert-manager/DiscoveryPage/components/DiscoveryJobsTab.tsx
@@ -3,6 +3,7 @@ import { useNavigate } from "@tanstack/react-router";
import { format } from "date-fns";
import { MoreHorizontalIcon, PlusIcon, RefreshCwIcon, SearchIcon } from "lucide-react";
+import { UpgradePlanModal } from "@app/components/license/UpgradePlanModal";
import { ProjectPermissionCan } from "@app/components/permissions";
import { HoverCard, HoverCardContent, HoverCardTrigger, Tag } from "@app/components/v2";
import {
@@ -37,7 +38,8 @@ import {
import {
ProjectPermissionPkiDiscoveryActions,
ProjectPermissionSub,
- useOrganization
+ useOrganization,
+ useSubscription
} from "@app/context";
import {
PkiDiscoveryScanStatus,
@@ -67,12 +69,26 @@ export const DiscoveryJobsTab = ({ projectId }: Props) => {
const [searchFilter, setSearchFilter] = useState("");
const [debouncedSearch] = useDebounce(searchFilter, 300);
+ const { subscription } = useSubscription();
+
const { popUp, handlePopUpOpen, handlePopUpClose, handlePopUpToggle } = usePopUp([
"createJob",
"editJob",
- "deleteJob"
+ "deleteJob",
+ "upgradePlan"
] as const);
+ const handleCreateJob = () => {
+ if (!subscription.pkiDiscovery) {
+ handlePopUpOpen("upgradePlan", {
+ isEnterpriseFeature: true,
+ text: "Certificate discovery is available on Infisical's Enterprise plan."
+ });
+ return;
+ }
+ handlePopUpOpen("createJob");
+ };
+
const { data, isPending } = useListPkiDiscoveries({
projectId,
offset: (page - 1) * PAGE_SIZE,
@@ -166,11 +182,7 @@ export const DiscoveryJobsTab = ({ projectId }: Props) => {
a={ProjectPermissionSub.PkiDiscovery}
>
{(isAllowed) => (
- <Button
- variant="project"
- onClick={() => handlePopUpOpen("createJob")}
- isDisabled={!isAllowed}
- >
+ <Button variant="project" onClick={handleCreateJob} isDisabled={!isAllowed}>
<PlusIcon />
Add Job
</Button>
@@ -350,6 +362,12 @@ export const DiscoveryJobsTab = ({ projectId }: Props) => {
onConfirm={handleDelete}
discoveryName={(popUp.deleteJob.data as TPkiDiscovery)?.name || ""}
/>
+
+ <UpgradePlanModal
+ isOpen={popUp.upgradePlan.isOpen}
+ onOpenChange={(isOpen) => handlePopUpToggle("upgradePlan", isOpen)}
+ text={(popUp.upgradePlan?.data as { text: string })?.text}
+ />
</Card>
);
};
diff --git a/frontend/src/views/PkiAlertsV2Page/components/CreatePkiAlertV2FormSteps.tsx b/frontend/src/views/PkiAlertsV2Page/components/CreatePkiAlertV2FormSteps.tsx
index 5ff0468e63..6d0175ef74 100644
--- a/frontend/src/views/PkiAlertsV2Page/components/CreatePkiAlertV2FormSteps.tsx
+++ b/frontend/src/views/PkiAlertsV2Page/components/CreatePkiAlertV2FormSteps.tsx
@@ -51,7 +51,7 @@ import {
AccordionTrigger,
Badge
} from "@app/components/v3";
-import { useProject } from "@app/context";
+import { useProject, useSubscription } from "@app/context";
import {
PkiAlertChannelTypeV2,
PkiAlertEventTypeV2,
@@ -110,6 +110,7 @@ export const CreatePkiAlertV2FormSteps = ({
formState: { errors }
} = useFormContext<TCreatePkiAlertV2>();
const { currentProject } = useProject();
+ const { subscription } = useSubscription();
const [certificatesPage, setCertificatesPage] = useState(1);
const certificatesPerPage = 6;
@@ -185,9 +186,11 @@ export const CreatePkiAlertV2FormSteps = ({
};
const isChannelLimitReached = watchedChannels.length >= MAX_CHANNELS;
+ const isEnterpriseAlertingAllowed = Boolean(subscription?.pkiEnterpriseAlerting);
const addChannel = (type: PkiAlertChannelTypeV2) => {
if (isChannelLimitReached) return;
+ if (type !== PkiAlertChannelTypeV2.EMAIL && !isEnterpriseAlertingAllowed) return;
justAddedRef.current = true;
let config:
@@ -717,17 +720,35 @@ export const CreatePkiAlertV2FormSteps = ({
<FontAwesomeIcon icon={faEnvelope} className="mr-2" />
Email
</DropdownMenuItem>
- <DropdownMenuItem onClick={() => addChannel(PkiAlertChannelTypeV2.WEBHOOK)}>
- <FontAwesomeIcon icon={faLink} className="mr-2" />
- Webhook
+ <DropdownMenuItem
+ isDisabled={!isEnterpriseAlertingAllowed}
+ onClick={() => addChannel(PkiAlertChannelTypeV2.WEBHOOK)}
+ >
+ <span className="flex items-center gap-2">
+ <FontAwesomeIcon icon={faLink} />
+ Webhook
+ {!isEnterpriseAlertingAllowed && <Badge variant="info">Enterprise</Badge>}
+ </span>
</DropdownMenuItem>
- <DropdownMenuItem onClick={() => addChannel(PkiAlertChannelTypeV2.SLACK)}>
- <FontAwesomeIcon icon={faSlack} className="mr-2" />
- Slack
+ <DropdownMenuItem
+ isDisabled={!isEnterpriseAlertingAllowed}
+ onClick={() => addChannel(PkiAlertChannelTypeV2.SLACK)}
+ >
+ <span className="flex items-center gap-2">
+ <FontAwesomeIcon icon={faSlack} />
+ Slack
+ {!isEnterpriseAlertingAllowed && <Badge variant="info">Enterprise</Badge>}
+ </span>
</DropdownMenuItem>
- <DropdownMenuItem onClick={() => addChannel(PkiAlertChannelTypeV2.PAGERDUTY)}>
- <FontAwesomeIcon icon={faBell} className="mr-2" />
- PagerDuty
+ <DropdownMenuItem
+ isDisabled={!isEnterpriseAlertingAllowed}
+ onClick={() => addChannel(PkiAlertChannelTypeV2.PAGERDUTY)}
+ >
+ <span className="flex items-center gap-2">
+ <FontAwesomeIcon icon={faBell} />
+ PagerDuty
+ {!isEnterpriseAlertingAllowed && <Badge variant="info">Enterprise</Badge>}
+ </span>
</DropdownMenuItem>
</DropdownMenuContent>
</DropdownMenu>