Skip to content

Name constraints

Name constraints, written into the intermediate certificate, tell every TLS client which names this CA may issue for. Even if the intermediate key were stolen, certificates for other names would be refused everywhere.

ca:
  name_constraints:
    dns_domains: [example.com, corp.internal]   # these and every name below them
    ip_ranges: [10.0.0.0/8]
    email_domains: [example.com]                 # addresses at example.com

Rules

  • Set them before bxp init: they are part of the intermediate. Changing them later takes a new intermediate: bxp new-intermediate writes the configuration's constraints into it. bxp doctor warns while the two differ.
  • A kind of name you do not list is not allowed at all: with only dns_domains, no certificate gets an IP address or an email address.
  • example.com allows example.com and every name below it. .example.com, with a leading dot, allows only the names below it.
  • The CA checks each certificate the way clients will, and refuses what falls outside, whatever a token or an ACME order allows.
  • server.names and acme.allowed_domains must fit the constraints.

Under an existing root

With an external root, the constraints cannot be put into the CSR. Ask the company's CA to write constraints into the certificate it issues; BastionXP CA refuses names outside whatever constraints the chain carries.

Check them

bxp doctor --config bastionxp-ca.yaml      # shows the constraints, and warns if config and intermediate differ
openssl x509 -in /var/lib/bastionxp-ca/intermediate.crt -noout -ext nameConstraints

Client support

Name constraints are part of RFC 5280 and are enforced by current TLS libraries (OpenSSL, Go, BoringSSL, NSS, Windows, macOS). They are a defence in depth: plan as if a few old clients might ignore them.