YubiKey, salts and isolated hosts
A YubiKey unlocks the fleet’s encrypted disks with one press, without ever being plugged into the hosts beforehand. This page explains the mechanism, what is public or secret, and why an isolated host does not share the rest of the fleet’s values.
One key, one formula
Section titled “One key, one formula”At enrollment (just yubikey), the key creates a FIDO2 credential: an
internal secret that never leaves it, and a public identifier, the
credId. Afterwards, it can be asked for a computation (the
hmac-secret 🡕 extension):
value = HMAC(credential internal secret, salt)- Same credential, same salt → always the same value.
- Another salt → an unrelated value, impossible to deduce from the first one.
- Each computation requires the key at hand and a press (firmware rule).
| Element | Where it lives | Status |
|---|---|---|
| Internal secret | In the key only | Never leaves |
credId | usr/secrets/yubikeys.json | Public |
| Salt | Registry and LUKS header | Public |
| Value | sops file | Secret |
The credId and the salt are useless without the physical key: that is why
they are versioned in clear text.
Unlocking at boot
Section titled “Unlocking at boot”The value is the passphrase of a LUKS keyslot. The disk header keeps, alongside, a systemd-fido2 token containing the credId and the salt :
The host only knows what the key sends it : the value with the salt it asks for. Everything else on this page follows from that point.
The ordinary fleet: one salt per key
Section titled “The ordinary fleet: one salt per key”Each key receives a salt at enrolment. A press on the admin workstation
computes the value, stored in secrets.yaml. Each encrypted host receives it at
deployment and enrols itself :
- Benefit : a new encrypted host costs no press, the key never travels.
- Cost : this value opens all the disks where the key is enrolled.
Acceptable on an ordinary host : it already holds the infra key, hence
every
secrets.yaml.
Why not on an isolated host
Section titled “Why not on an isolated host”An isolated host runs agents that read untrusted content. It is assumed it can be compromised. If its disk carried a token using the fleet salt:
- the attacker becomes root and modifies the host’s initrd;
- the administrator reboots and touches their key, as usual;
- the initrd requests the value for the fleet salt, and keeps it;
- the attacker holds what it takes to open all the other disks.
So not giving it the value through sops is not enough: the key computes it for it. The protocol even accepts two salts per request: a single press can return the host’s value and the fleet’s, if the host knows the fleet salt.
The host’s own salt
Section titled “The host’s own salt”The answer: the same credential, but a salt drawn for that host. The value obtained only opens its disk, which the host already reads anyway.
| Element | Ordinary host | Encrypted isolated host |
|---|---|---|
| Salt | The key’s own | Drawn for the host |
| Value stored in | secrets.yaml | hosts/<host>.yaml |
| Allows enrollment | Shared passphrase | Its own passphrase |
| Presses | One, at enrollment | One per isolated host |
| Enrolled keys | All those in the registry | Those captured for it |
The press is unavoidable, and deliberately so: if a value could be computed without the key, an attacker could too.
Keys far from the admin workstation
Section titled “Keys far from the admin workstation”Members’ keys are not all within reach of the admin workstation. This is not a blocker:
- Key not captured: it is not enrolled on the isolated host, which remains
unlockable with its passphrase (console or
just unlock). - Catching up: the key passes on the admin workstation,
just yubikey <login> <key>only computes what it is missing, one press per isolated host. - Tracking:
just luks <host> showlists the keys not yet captured. - New encrypted isolated host: every key goes through once again.
In practice, the isolated host is mostly unlocked remotely, or by the administrator at its console: their own keys are enough.
Safeguards
Section titled “Safeguards”| Error | What stops it |
|---|---|
| A module declares a fleet value on an isolated host | Evaluation fails |
| A fleet salt in its enrollment data | Evaluation fails |
| A keyslot with the fleet salt in its header | just luks <host> show: FLEET SALT |
The failure message names the offending secrets: remove them from the host, never copy them into its file.
Limits
Section titled “Limits”- The fleet salt is not secret: it appears in the registry and in the store of ordinary hosts. The separation holds as long as the isolated host’s attacker does not also have a foothold on the rest of the fleet.
- Touching your key on a compromised isolated host only hands it your own value, that of a disk it already controls.
Do existing keys need to be re-enrolled?
Section titled “Do existing keys need to be re-enrolled?”No. The credential stays the same; only one more value is computed, for each encrypted isolated host, when the key passes on the admin workstation.
Does the key ask for its PIN?
Section titled “Does the key ask for its PIN?”No, neither for the computation nor at boot: LUKS stays press-only, as on the rest of the fleet.
What happens to a revoked key?
Section titled “What happens to a revoked key?”just yubikey <login> <key> revoke also removes its values from the isolated
hosts’ files. At the next deployment, each host deletes its keyslot.