HashiCorp Vault

Relution can issue device certificates from the PKI secrets engine of HashiCorp Vault →. Relution generates the key pair, has Vault sign the request through a PKI role and delivers the certificate to the device with the policy. Only Relution talks to Vault; the key of the certificate authority stays in Vault.

Supported: Vault Community Edition, Vault Enterprise, HCP Vault and OpenBao.


Preparing Vault

  1. A PKI mount with an issuing CA.

  2. A PKI role for Relution. The role, not Relution, sets O, OU, C, L, ST, the key usages and the maximum validity (max_ttl). EC keys need key_type=any.

  3. A policy for Relution, here for the mount pki:

    path "pki/sign/*"        { capabilities = ["create", "update"] }
    path "pki/revoke"        { capabilities = ["create", "update"] }
    path "pki/cert/ca_chain" { capabilities = ["read"] }
    path "pki/roles/*"       { capabilities = ["read"] }
    path "pki/roles/"        { capabilities = ["list"] }
    

    The last two lines are optional: with them Relution checks the role when a template is saved and lists the roles in the connection check.

  4. Credentials: an AppRole → (recommended) or a static token. Relution does not renew a static token: once it has expired, issuing and revoking stop.


Certificate authority

Settings → Certificate Authorities → Add, type HashiCorp Vault:

FieldValue
Vault URLhttps://host:port, without /v1
NamespaceVault Enterprise / HCP only, empty for the root namespace
PKI mount pathe.g. pki (without slashes)
Default roleUsed by templates that do not name a role
AuthenticationAppRole (role ID + secret ID) or static token

Check connection shows the Vault version and warns about an expiring token, an ignored namespace or a missing sign permission. Afterwards, PKI mount path and Default role suggest the mounts and roles Vault reported while typing.


Certificate template

Settings → Certificate Templates → Add, type Certificate, with the Vault certificate authority:

  • Vault PKI role: optional, otherwise the default role. Role names are case-sensitive.
  • Subject name: only CN, UID and serialNumber, e.g. CN=${device.serialnumber}. Placeholders are case-sensitive too.
  • Key algorithm: RSA or EC, as far as the role allows.
  • Validity / automatic renewal: Vault caps the validity at the max_ttl of the role. The renewal period must be shorter than that.

Key usages and directory name SANs are not available, the role defines them. SCEP on device is not available with Vault.


Revocation

Relution revokes a Vault certificate when it is revoked under Settings → Issued Certificates, when automatic renewal replaces it and the template is set to Directly invalidate old certificates, and when its device is deleted. If Vault is unreachable, Relution retries until Vault confirms or the certificate has expired. Vault publishes the revocation in its CRL and OCSP.


Limitations

  • When a device is enrolled again, its previous certificates are not revoked at Vault.
  • Plain http:// is only allowed for a Vault on the same machine and only with relution.pki.vault.allow-plain-http-loopback: true.
  • relution.pki.vault.namespace: REQUIRED makes a namespace mandatory for every Vault certificate authority of the server.

How helpful was this article?