Use OpenBao as an intermediate CA

In this how-to guide, we will configure OpenBao to act as an intermediate Certificate Authority (CA) using OpenBao’s PKI secrets engine. Here self-signed-certificates will be the parent CA and tls-certificates-requirer will be the charm requesting a certificate to OpenBao.

The certificates issued by OpenBao will have a validity period that is half of its intermediate CA’s, which is determined by the root provider’s configuration, in this case, the self-signed certificates.

image|690x129

Note

OpenBao PKI will only allow issuing certificates depending on how it is configured, please see pki_allow_subdomains, pki_allowed_domains, pki_allow_any_name and pki_allow_wildcard_certificates

  1. Configure OpenBao’s common name

    juju config openbao pki_ca_common_name=<your domain name>
    
  2. Configure OpenBao PKI Engine to allow issuing certificates for subdomains

    juju config openbao pki_allow_subdomains=true
    
  3. Deploy the parent CA

    juju deploy self-signed-certificates --channel 1/stable
    
  4. Integrate OpenBao with its parent CA

    juju relate openbao:tls-certificates-pki self-signed-certificates
    
  5. Deploy tls-certificates-requirer

    juju deploy tls-certificates-requirer --config common_name=<your domain name>  --config sans_dns=<your domain name>
    
  6. Integrate TLS Certificates Requirer with OpenBao

    juju relate tls-certificates-requirer openbao:openbao-pki
    
  7. Retrieve the certificate

    juju run tls-certificates-requirer/leader get-certificate