Skip to main content

Roles and issuance

A role is the issuance template applied when you mint a leaf cert under a root. It answers: β€œwhat’s a leaf allowed to claim, and for how long?” The role is what enforces the difference between a CA that hands out anything and a CA that’s safe to delegate.

What a role controls

The maximum effective TTL is min(role.max_ttl, intermediate.not_after - now). A leaf can’t outlive the intermediate that signed it.

Creating a role

This says: leaves under internal-services can claim any host under *.internal.example.com or *.svc.cluster.local, can’t be wildcards themselves, and live at most 7 days (24h by default).

Issuing a leaf

The private_key_pem is shown once. KnoxCall doesn’t keep it. Save it next to the cert in whatever your service expects (Kubernetes secret, file mount, etc) β€” you can’t fetch it again. The ca_chain_pem includes the intermediate so clients can validate without a separate fetch.

Subject DN inheritance

Leaves inherit org-level Subject DN fields (Organization, Country, Province, Locality) from the root if you don’t supply them on the issue call. CN and SAN come from the request. This keeps β€œissued by Acme Inc, in California” consistent across every leaf without repeating it on every call. You can override any field per-issue if you really need to.

Validation rules at issue time

KnoxCall rejects an issuance request when:
  • The CN or any SAN doesn’t match allowed_domains (subject to the allow_subdomains / allow_wildcards flags).
  • The requested TTL exceeds role.max_ttl_seconds.
  • The requested TTL would push not_after past the intermediate’s expiry. (Effective ceiling is min(role.max_ttl, intermediate.not_after - now).)
  • The intermediate is retired and no successor has been minted yet β€” surface as a 409 so the caller can retry.

Revocation

To revoke a leaf:
The cert lands in the CRL (GET /admin/pki/roots/corp/crl). With short TTLs, most certs age out before a CRL pull catches them β€” revocation is a fast kill switch, not the primary expiration mechanism.

What KnoxCall doesn’t do (yet)

  • OCSP responder β€” only CRLs at v1.
  • DER-encoded CRL β€” text format only at v1; consumers that strictly require DER need a follow-up.
  • Non-EC algorithms β€” RSA / Ed25519 are roadmap.
  • CSR-based issuance β€” the keypair is generated server-side and the private key is returned to the caller. CSR support is on the list.

Quick rules of thumb

  • Pick short default TTLs (24–48h). Issuance is cheap; renewal is a curl.
  • Use separate roots for different trust domains (corp vs iot vs web). They have separate root certs, so a leak in one doesn’t compromise the others.
  • Use separate roles within a root for different scopes β€” e.g. read-only-services (allow_subdomains=false) vs infra-services (allow_subdomains=true).
  • The customer’s trust store only ever needs the root PEM. Re-installing it across the fleet is the expensive operation; rotating intermediates and leaves is invisible.

See also