Skip to content

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.

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).
ElementWhere it livesStatus
Internal secretIn the key onlyNever leaves
credIdusr/secrets/yubikeys.jsonPublic
SaltRegistry and LUKS headerPublic
Valuesops fileSecret

The credId and the salt are useless without the physical key: that is why they are versioned in clear text.

The value is the passphrase of a LUKS keyslot. The disk header keeps, alongside, a systemd-fido2 token containing the credId and the salt :

Diagram

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.

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 :

Diagram
  • 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.

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:

  1. the attacker becomes root and modifies the host’s initrd;
  2. the administrator reboots and touches their key, as usual;
  3. the initrd requests the value for the fleet salt, and keeps it;
  4. 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 answer: the same credential, but a salt drawn for that host. The value obtained only opens its disk, which the host already reads anyway.

ElementOrdinary hostEncrypted isolated host
SaltThe key’s ownDrawn for the host
Value stored insecrets.yamlhosts/<host>.yaml
Allows enrollmentShared passphraseIts own passphrase
PressesOne, at enrollmentOne per isolated host
Enrolled keysAll those in the registryThose captured for it

The press is unavoidable, and deliberately so: if a value could be computed without the key, an attacker could too.

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> show lists 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.

ErrorWhat stops it
A module declares a fleet value on an isolated hostEvaluation fails
A fleet salt in its enrollment dataEvaluation fails
A keyslot with the fleet salt in its headerjust luks <host> show: FLEET SALT

The failure message names the offending secrets: remove them from the host, never copy them into its file.

  • 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.

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.

No, neither for the computation nor at boot: LUKS stays press-only, as on the rest of the fleet.

just yubikey <login> <key> revoke also removes its values from the isolated hosts’ files. At the next deployment, each host deletes its keyslot.