Using Yubikey challenge-response with sandboxed polkit-agent-helper
I’ve got my computer setup to use yubikey challenge-response authentication for most things (unlocking my KeepassXC databasee, user logins and disk encryption). I’ve had problems multiple times with permissions for this setup: The Yubikey challenge-response implementation needs to maintain some state. This state can either be stored in the user’s home directory, or some root-accessible directory. Tools like swaylock generally do not run as root, and so the per-user implementation is generally more useful (it took me a while to figure this out). For system authentication via PAM, the authentication is done via the polkit-agent-helper that runs as root. Because this helper is very security-sensitive, it is heavily sandboxed as of the time of writing. ...