Skip to content

bxp renew

Renew a certificate before it expires: no token, no login.

Usage

Renew a TLS certificate, or an SSH host certificate, with the current
certificate and its key as the proof. Nobody has to hand out a token.

It does nothing while more than a third of the certificate's lifetime
is left, so run it every hour from a timer: it renews at the right
moment by itself (certificates last 24 hours by default, so daily is
not often enough). The new certificate has the same names as the old one.

TLS: a new key is made, and the key and certificate files are replaced.
SSH: the certificate file is replaced; the host key stays the same.

A certificate that has expired or was revoked cannot be renewed; it
needs a new one with a token.

Only certificates from BastionXP CA's API ("bxp tls", a token, a login)
renew this way. Renew one from ACME with the ACME client ("bxp acme
renew"), one from SCEP with "bxp scep renew".

Usage:
  bxp renew [flags]

Examples:
  bxp renew --cert web.example.com.crt --key web.example.com.key \
      --exec "systemctl reload nginx"

  bxp renew --cert /etc/ssh/ssh_host_ed25519_key-cert.pub \
      --key /etc/ssh/ssh_host_ed25519_key --exec "systemctl reload sshd"

Flags:
      --ca-url string   address of the CA server, e.g. https://ca.example.com:8443
                        (or BXP_CA_URL; default: the one saved by "bxp trust")
      --cert string     the certificate to renew: a TLS .crt file, or an SSH ...-cert.pub file
      --exec string     a command to run after a renewal, e.g. "systemctl reload nginx"
      --force           renew now, even if more than a third of the lifetime is left
  -h, --help            help for renew
      --key string      its private key
      --root string     path of the CA's root certificate, root.crt
                        (or BXP_ROOT; default: the one saved by "bxp trust")

Global Flags:
      --config string   path to the configuration file (default "bastionxp-ca.yaml")