# Lets the person sitting at this machine use its TPM, without joining a group. # # ◆ WHAT THIS CHANGES, AND WHAT IT DELIBERATELY DOES NOT. # # Fedora's 60-tpm-udev.rules leaves /dev/tpmrm0 as root:tss mode 0660, so using it means being in # the tss group — which means an administrator, a usermod and a fresh login before DodoSSH will # offer to seal a device key. This adds the uaccess tag, and nothing else: the mode and the group # are untouched, so everything that worked before still works and an ACL is layered on top. # # uaccess is systemd's own mechanism for exactly this question and is what /dev/dri, webcams, # scanners and FIDO keys already use. logind grants a POSIX ACL to the user of the *active local # session* and takes it away again when that session ends. So: # # - somebody logged in at the physical machine gets access; # - somebody logged in over SSH does not; # - a user switched away to another VT does not; # - a system daemon running as its own user does not. # # That is a much narrower grant than adding a person to tss, which is permanent, applies over SSH, # and applies whether or not they are the one at the keyboard. # # ◆ tpmrm AND NOT tpm, WHICH IS THE WHOLE REASON THIS IS DEFENSIBLE. # # /dev/tpm0 is the raw device and access to it is exclusive — two users cannot share it, and a # process holding it can leave the chip in a state that breaks everything else. /dev/tpmrm0 is the # kernel's resource manager: it virtualises handles, swaps contexts and isolates callers from each # other, and it exists *because* the TPM is meant to be usable by more than one unprivileged # program. Granting a seat's user the manager is the use it was built for. Granting the raw device # would not be, and this rule never names it. # # ◆ THE COST, WHICH IS REAL AND IS NOT ABOUT SECRECY. # # TPM keys are protected by their own auth values, so this grants nobody the ability to read # anybody else's sealed data. What it does grant is the ability to make failed authorisation # attempts, and a TPM answers those by counting them and eventually refusing everyone — the same # dictionary-attack lockout DodoSSH relies on to make a four-digit PIN safe. # # On a machine whose disk is unlocked by the TPM at boot (systemd-cryptenroll, Clevis), a local user # who trips that lockout can stop the next boot from unlocking until it recovers. That is a denial # of service against the machine's owner by somebody already sitting at the machine, and it is worth # knowing rather than discovering. An administrator who does not accept it can mask this file: # # sudo ln -s /dev/null /etc/udev/rules.d/71-dodossh-tpm.rules # # which is the standard override and survives upgrades. DodoSSH then behaves exactly as it did # before this file existed: no device key is offered, and unlocking asks for the passphrase. # # Numbered 71 because 73-seat-late.rules is what turns the tag into an ACL, and 60-tpm-udev.rules # is what creates the device node's ownership in the first place. Anything outside that gap either # never runs or runs too late to matter. ACTION=="remove", GOTO="dodossh_tpm_end" SUBSYSTEM=="tpmrm", KERNEL=="tpmrm[0-9]*", TAG+="uaccess" LABEL="dodossh_tpm_end"