Managed Certificate Authorities
This feature is currently available only to customers participating in a Private Preview. If you'd like to participate and be among the first to try this feature, ask our support or account team for details.
A managed certificate authority (CA) is a root CA that Workload Secrets Vault creates and keeps for you. Its private key is generated and stored by the service and is never returned. You issue certificates through templates that limit which names and lifetimes callers can request, and every issued certificate is tracked so you can revoke and validate it.
The typical setup is one CA per trust domain, with one template per kind of workload. For background, see Certificates and PKI.
Creating a CA
delinea --json workload pki ca create \
--name payments-mtls \
--common-name ca.payments.example.com \
--domains '["deploy-bot.payments.example.com", "orders.payments.example.com"]' \
--max-ttl-hours 8760
| Field | Description |
|---|---|
name
|
Required. A name that's unique in your tenant. You can't change it later. |
commonName
|
Required. The CA certificate's common name, as a DNS name. |
domains
|
Required. The names this CA can issue certificates for. |
maxTtlHours
|
Required. The lifetime of the CA certificate in hours, which is also the longest lifetime of any certificate it issues, counted from when that certificate is issued. |
subject
|
Optional. Subject fields: country, state, locality, organization, organizationalUnit, and emailAddress. |
The response includes the CA certificate as Base64-encoded PEM. Give that certificate to the services that should trust certificates from this CA. To get it again later, run pki ca root-certificate get <name>.
A CA certificate expires after maxTtlHours, and there's no way to renew it. Plan to create a new CA and move your workloads to it before the old one expires. Leave enough time: a certificate's lifetime runs from when it's issued and isn't cut short when the CA certificate expires, so a certificate issued late in the CA's life can outlive the CA. The CA also keeps issuing certificates after its own certificate expires. Stop issuing from a CA once its remaining validity is shorter than the lifetimes you request.
Creating a Template
A template is bound to one CA and narrows what callers can request from it:
delinea --json workload pki template create \
--name deploy-bot \
--ca-name payments-mtls \
--max-ttl-hours 1 \
--allowed-domains '["deploy-bot.payments.example.com"]'
-
allowedDomainsmust be a non-empty subset of the CA's domains. -
maxTtlHourscan't be more than the CA'smaxTtlHours. -
A template's name and CA can't be changed. To change its limits, run
pki template update <name> --max-ttl-hours 2 --allowed-domains '[...]'with both flags. -
Deleting a template doesn't affect the certificates already issued through it.
Issuing a Certificate
delinea --json workload pki template certificate create deploy-bot \
--common-name deploy-bot.payments.example.com --ttl-hours 1 > issued.json
jq -r '.certificate' issued.json | base64 -d > client.pem
jq -r '.privateKey' issued.json | base64 -d > client.key
chmod 600 client.key
The request can include commonName (required), subjectAlternativeNames, and ttlHours. If ttlHours is 0 or left out, the certificate gets the template's maximum lifetime. The response contains:
-
id: the ID of the certificate record, used to revoke, validate, or delete it -
certificateandprivateKey: Base64-encoded PEM -
serialNumber: the certificate's serial number in hexadecimal
The private key is returned only once and isn't stored. Save it as soon as you receive it.
Requests are refused with 400 and the error code pki_validation_failed when the common name or any alternative name isn't in the template's allowed domains, the common name is the same as the CA's common name, or the lifetime is longer than the maximum. The detail field says which rule failed.
Issued certificates are valid from the moment they're issued, carry the client authentication usage only, and include the common name and every alternative name as DNS names.
Issuing Directly from a CA
You can also issue a certificate without a template, with pki ca certificate create <ca-name> and the same flags. The request is limited only by the CA's domains and maximum lifetime.
Issuing directly from a CA needs the same permission as issuing through a template. Anyone who can issue through a template can therefore also issue from any CA in the tenant, within the CA's limits instead of the template's. Grant Create PKI Certificate only to identities that you trust with every CA in the tenant.
Viewing CAs, Templates, and Certificates
Command (delinea workload pki ...) |
Shows |
|---|---|
ca list, ca get <name> |
Managed CAs, with their certificates, domains, and maximum lifetimes |
ca root-certificate get <name>
|
The CA certificate only (never the private key) |
template list, template get <name> |
Templates and their limits |
ca certificate list <ca-name>
|
Every certificate record for the CA, with issue and expiry times and revocation status |
certificate get <id>
|
One certificate record (never the private key) |
Revoking and Validating Certificates
To revoke a certificate, pass its record ID and a reason code:
delinea --json workload pki certificate revoke <id> --reason 1
The reason is a number: 0 Unspecified (the default), 1 Key compromise, 2 CA compromise, 3 Affiliation changed, 4 Superseded, 5 Cessation of operation, or 9 Privilege withdrawn. Revocation can't be undone. Revoking a certificate again succeeds and keeps the original reason and time.
To check a certificate, run pki certificate validate <id>. The response has isValid and, when it's false, an error that says why: the CA no longer exists, the certificate is revoked or expired, or it doesn't chain to the CA.
Getting the Certificate Revocation List
curl -sS -H "Authorization: Bearer $TOKEN" -o payments-mtls.crl \
"https://<your-tenant>/workload-secrets/api/v1/pki/ca/payments-mtls/crl"
-
The CRL is DER-encoded (
application/pkix-crl) and lists every revoked certificate of the CA. In the CLI, runpki ca crl get <name>. -
It's generated on each request and says to fetch it again within 7 days. A revocation appears in the next CRL you fetch.
-
Getting the CRL requires a signed-in caller with the Manage PKI Certificate Authority permission, so relying parties can't fetch it themselves. Issued certificates don't contain a CRL address either. Fetch the CRL on a schedule and publish it where your services can read it.
Deleting Certificates, Templates, and CAs
-
pki certificate delete <id>deletes a certificate record. It doesn't revoke the certificate. A deleted record no longer appears in the CRL, so don't delete the records of revoked certificates that haven't expired yet. -
pki template delete <name>deletes a template. -
pki ca delete <name>deletes a CA. It fails with409while any certificate records or templates for the CA remain, including records of revoked certificates. Delete the certificate records, then the templates, then the CA.
Permissions
Managed CAs are controlled by permissions only. Policies don't apply, so a permission covers every managed CA and template in the tenant.
| Permission | Allows |
|---|---|
| Manage PKI Certificate Authority | Create, view, and delete CAs and templates; update templates; list, view, validate, and delete certificate records; get CA certificates and CRLs |
| Create PKI Certificate | Issue certificates through any template, or directly from any CA |
| Update PKI Certificate | Revoke certificates |
Workloads that only request certificates don't need Manage PKI Certificate Authority, but then they can't read the CA certificate through the PKI commands. Store a copy of the CA certificate as an ordinary secret, which is safe because it's public, and give those workloads read access to it.
Errors
| Status | Error code | Cause |
|---|---|---|
400
|
pki_validation_failed
|
A name, domain, or lifetime breaks a rule. The detail field says which. |
404
|
pki_not_found
|
The CA, template, or certificate record doesn't exist. |
409
|
pki_conflict
|
A CA or template with that name already exists, or a CA still has certificate records or templates. |