Enroll a device
Install a bootstrap certificate and the trust root pin, and Hoplet enrolls the device in Hop without manual steps.
A device joins Hop through zero-touch enrollment. You install a bootstrap certificate and the trust root pin on the device. Hoplet then gets a Hop identity, reports the device and keeps the identity valid. You do not register anything per device in Hop.
What the device needs
Give the device these items before the first start:
- A bootstrap certificate and its private key: issued by a CA that is a Trusted Issuer in an active Enrollment Policy. The certificate must be valid and unique to the device. Hoplet reads
/etc/hop/hoplet/bootstrap.pemand/etc/hop/hoplet/bootstrap.key. - The trust root pin: the SHA-256 pin of the Hop trust domain root, in the form
sha256/<base64>. Hoplet uses it to authenticate Hop on first contact. - The Hop device API address: for example
https://devices-hop.unbrikd.com.
The private key stays on the device. Hop never receives it.
Create a test bootstrap certificate
For production devices, use the certificate process of your organization. For a first test, create a CA and a bootstrap certificate with OpenSSL on your provisioning machine. First create the CA:
Add ca.pem to an Enrollment Policy as a Trusted Issuer. Keep ca.key on the provisioning machine. Then create the bootstrap certificate for one device:
Copy bootstrap.pem and bootstrap.key to the device and install them:
The subject holds the serial number of the device. To report it, see Serial number.
Get the trust root pin
Get the pin from your Hop administrator through a trusted channel. If you have the root certificate of the Hop trust domain, compute the pin and add sha256/ before the output:
Do not take the pin from the server that you want to authenticate. Hoplet never trusts Hop on first use.
Start the enrollment
Set the address and the pin in /etc/hop/hoplet/config.yaml:
Check the configuration, then start Hoplet and enable it at boot:
Hoplet enrolls on the first start. hoplet status then shows the state enrolled, the client ID and the SPIFFE ID. To enroll without the service, run sudo hoplet enroll. The device shows as active in the Devices tab of the Project after its first capabilities report.
If the device does not enroll, see Troubleshooting.
How enrollment works
When Hoplet has no valid identity, it does these steps:
- It downloads the trust bundle of Hop. It accepts the bundle only if the bundle holds the pinned root and the server proves an identity issued under that root.
- It creates a new key and requests a certificate over mutual TLS (mTLS), with the bootstrap certificate as its client certificate. The request uses Enrollment over Secure Transport (EST, RFC 7030).
- Hop finds the one active Enrollment Policy that trusts the issuer of the bootstrap certificate. Hop adds the device to the Project of that policy in the state onboarded.
- Hop returns an X.509 SPIFFE Verifiable Identity Document (SVID). Its SPIFFE ID is
spiffe://<trust domain>/margo/wfm/hop/client/<clientId>. Hoplet uses the SVID for all other requests. - Hoplet reports the capabilities of the device. The first report makes the device active.
Hoplet keeps the SVID, its key and the trust bundle in /var/lib/hop/hoplet. The same bootstrap certificate always maps to the same client in Hop, so a second enrollment does not add a second device.
Renewal and expiry
An SVID is valid for 30 days. Hoplet renews it at two thirds of its lifetime, after 20 days, with a new key. Renewal uses the current SVID, not the bootstrap certificate. Hoplet also refreshes the trust bundle at the interval that Hop sets.
If the SVID expires, for example on a device that was offline, Hoplet enrolls again with the bootstrap certificate. The device keeps its client ID and its Project. For this reason, keep the bootstrap certificate and key on the device, and keep the certificate valid.
Identity errors never stop Hoplet or its workloads. Hoplet retries with backoff and shows the state in hoplet status.
Revocation
To remove a device, open it in the Devices tab of the Project and revoke it. Revocation is final. Hop refuses the client on every request, also with a valid SVID, and refuses its bootstrap certificate.
To connect the device again, install a new bootstrap certificate and enroll it as a new device. See Revoked device for the commands.
Protect the bootstrap key
With systemd credentials, the bootstrap key is encrypted on disk and only the running service can read it. On a device with systemd-creds, encrypt the key:
Load the credential into the service, and point Hoplet at it:
Run sudo systemctl daemon-reload and sudo systemctl restart hoplet. Commands that read the key then work only in the service context. When the service runs with the credential, remove /etc/hop/hoplet/bootstrap.key.