Generating a self-signed certificate authority

An environment that has no public DNS, or that uses its own certificates, uses a certificate authority that you provide, instead of ACME validation.

With CERT_ISSUER=ca, the installer uploads the certificate authority that you provide, and cert-manager issues the Cloudera Cloud Factory certificates from it. If you do not need your own certificate authority, set CERT_ISSUER=selfsigned, and cert-manager generates a root certificate without any files.

cert-manager requires an X.509 version 3 certificate that carries the basicConstraints and keyUsage extensions.

The openssl req -x509 command produces a version 1 certificate with no extensions, so generate the certificate from a configuration file. The configuration file also avoids the -addext option, which some LibreSSL builds do not provide.

  1. Generate the certificate authority private key.
    openssl genrsa -out ca.key 4096
  2. Create the certificate configuration file.
    cat > ca.cnf <<'EOF'
    [req]
    distinguished_name = dn
    x509_extensions    = v3_ca
    prompt             = no
    [dn]
    CN = CCF Self-Signed CA
    [v3_ca]
    basicConstraints       = critical,CA:TRUE
    keyUsage               = critical,digitalSignature,keyCertSign,cRLSign
    subjectKeyIdentifier   = hash
    authorityKeyIdentifier = keyid:always
    EOF
  3. Generate the version 3 certificate authority certificate, which is valid for 10 years.
    openssl req -x509 -new -nodes -key ca.key -sha256 -days 3650 \
      -config ca.cnf -extensions v3_ca -out ca.crt
  4. Remove the configuration file.
    rm ca.cnf
  5. Verify that the certificate carries the extensions that cert-manager requires.
    openssl x509 -in ca.crt -noout -text \
      | grep -A1 -E 'Version:|Basic Constraints|Key Usage'

    The verification command returns Version: 3, X509v3 Basic Constraints: critical CA:TRUE, and X509v3 Key Usage: critical Digital Signature, Certificate Sign, CRL Sign.

Set the following values in bootstrap.env when you run the installer from the container image, where the paths are the mount points inside the container:

CERT_ISSUER=ca
CA_CERT_FILE=/certs/ca.crt
CA_KEY_FILE=/certs/ca.key

Set the following values when you run the installer from source, where the paths are local paths:

CERT_ISSUER=ca
CA_CERT_FILE=./ca.crt
CA_KEY_FILE=./ca.key