Skip to content

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

Improve DC examples

Carlos Monastyrski7763b025d158
diff --git a/backend/src/services/certificate-authority/certificate-authority-fns.test.ts b/backend/src/services/certificate-authority/certificate-authority-fns.test.ts
index 6f038f3d5e..fa792763de 100644
--- a/backend/src/services/certificate-authority/certificate-authority-fns.test.ts
+++ b/backend/src/services/certificate-authority/certificate-authority-fns.test.ts
@@ -251,9 +251,9 @@ describe("createDistinguishedName", () => {
it("should emit one DC RDN per domain component, in the given order, after the CN", () => {
const dn = createDistinguishedName({
commonName: "auth-AD-MANAGER02-CA",
- domainComponents: ["app", "lucidgov", "auth"]
+ domainComponents: ["app", "example", "auth"]
});
- expect(dn).toBe("CN=auth-AD-MANAGER02-CA, DC=app, DC=lucidgov, DC=auth");
+ expect(dn).toBe("CN=auth-AD-MANAGER02-CA, DC=app, DC=example, DC=auth");
});
it("should skip empty domain component values", () => {
diff --git a/backend/src/services/certificate-policy/certificate-policy-service.test.ts b/backend/src/services/certificate-policy/certificate-policy-service.test.ts
index 8ce79ffa5b..fa8f6aa41d 100644
--- a/backend/src/services/certificate-policy/certificate-policy-service.test.ts
+++ b/backend/src/services/certificate-policy/certificate-policy-service.test.ts
@@ -730,13 +730,13 @@ describe("CertificatePolicyService", () => {
mockCertificatePolicyDAL.findById.mockResolvedValue(
buildSubjectPolicy([
{ type: CertSubjectAttributeType.COMMON_NAME, allowed: ["*-CA"] },
- { type: CertSubjectAttributeType.DOMAIN_COMPONENT, allowed: ["app", "lucidgov", "auth"] }
+ { type: CertSubjectAttributeType.DOMAIN_COMPONENT, allowed: ["app", "example", "auth"] }
])
);
const request: TCertificateRequest = {
commonName: "auth-AD-MANAGER02-CA",
- domainComponents: ["app", "lucidgov", "auth"]
+ domainComponents: ["app", "example", "auth"]
};
const result = await service.validateCertificateRequest("template-123", request);
@@ -747,18 +747,18 @@ describe("CertificatePolicyService", () => {
mockCertificatePolicyDAL.findById.mockResolvedValue(
buildSubjectPolicy([
{ type: CertSubjectAttributeType.COMMON_NAME, allowed: ["*-CA"] },
- { type: CertSubjectAttributeType.DOMAIN_COMPONENT, allowed: ["*.lucidgov"] }
+ { type: CertSubjectAttributeType.DOMAIN_COMPONENT, allowed: ["*.example"] }
])
);
const request: TCertificateRequest = {
commonName: "auth-AD-MANAGER02-CA",
- domainComponents: ["app", "lucidgov", "auth"]
+ domainComponents: ["app", "example", "auth"]
};
const result = await service.validateCertificateRequest("template-123", request);
expect(result.isValid).toBe(false);
- expect(result.errors).toContain("domain_component value 'app' does not match allowed patterns: *.lucidgov");
+ expect(result.errors).toContain("domain_component value 'app' does not match allowed patterns: *.example");
});
it("should deny a domain component that matches a denied pattern", async () => {
@@ -771,7 +771,7 @@ describe("CertificatePolicyService", () => {
const request: TCertificateRequest = {
commonName: "auth-AD-MANAGER02-CA",
- domainComponents: ["app", "lucidgov", "auth"]
+ domainComponents: ["app", "example", "auth"]
};
const result = await service.validateCertificateRequest("template-123", request);
@@ -789,7 +789,7 @@ describe("CertificatePolicyService", () => {
const missing: TCertificateRequest = {
commonName: "auth-AD-MANAGER02-CA",
- domainComponents: ["app", "lucidgov"]
+ domainComponents: ["app", "example"]
};
const missingResult = await service.validateCertificateRequest("template-123", missing);
expect(missingResult.isValid).toBe(false);
@@ -797,7 +797,7 @@ describe("CertificatePolicyService", () => {
const present: TCertificateRequest = {
commonName: "auth-AD-MANAGER02-CA",
- domainComponents: ["app", "lucidgov", "auth"]
+ domainComponents: ["app", "example", "auth"]
};
const presentResult = await service.validateCertificateRequest("template-123", present);
expect(presentResult.isValid).toBe(true);
@@ -810,7 +810,7 @@ describe("CertificatePolicyService", () => {
const request: TCertificateRequest = {
commonName: "auth-AD-MANAGER02-CA",
- domainComponents: ["app", "lucidgov", "auth"]
+ domainComponents: ["app", "example", "auth"]
};
const result = await service.validateCertificateRequest("template-123", request);
diff --git a/docs/documentation/platform/pki/settings/policies.mdx b/docs/documentation/platform/pki/settings/policies.mdx
index f93b53a768..1761a29d75 100644
--- a/docs/documentation/platform/pki/settings/policies.mdx
+++ b/docs/documentation/platform/pki/settings/policies.mdx
@@ -79,8 +79,8 @@ For each attribute, configure enforcement:
Domain Component (DC) support is for requests that use DC attributes explicitly. Each DC value is
matched independently against the Domain Component rule (like a Subject Alternative Name),
separately from the Common Name. A subject can carry more than one domain component (for example
- `CN=host, DC=auth, DC=lucidgov, DC=app`), so allow the labels your requests use, such as `auth`,
- `lucidgov`, and `app`, or a pattern like `*`.
+ `CN=host, DC=auth, DC=example, DC=app`), so allow the labels your requests use, such as `auth`,
+ `example`, and `app`, or a pattern like `*`.
</Note>
<Warning>