AlfioEmanueleFresta / xdg-credentials-portal

FIDO2 (WebAuthn) and FIDO U2F platform library for Linux written in Rust; includes a proposal for a new D-Bus Portal interface for FIDO2, accessible from Flatpak apps and Snaps 🔑
GNU Lesser General Public License v2.1
367 stars 13 forks source link

FIDO2: TPM 2.0 with PIN support #4

Open AlfioEmanueleFresta opened 4 years ago

AlfioEmanueleFresta commented 4 years ago

Includes:

AleDema commented 2 years ago

Any updates on this?

AlfioEmanueleFresta commented 2 years ago

Hey @AleDema, I don't have plans to work on this at the moment, but I would be happy to have a chat if you're interested in contributing, or have an interesting use case you'd like to discuss.

AlfioEmanueleFresta commented 2 years ago

I just discovered @psanford's tpm-fido, which is a TPM based, U2F platform authenticator for Linux. This might be a great fit.

tpm-fido currently emulates a HID device. We already support CTAP1 over HID, but it would be great to be able to integrate without HID dependencies. I've opened an issue for the implementation of high-level APIs https://github.com/psanford/tpm-fido/issues/14

As for CTAP2, in addition to higher level APIs, we would need some sort of user verification (TPM2 PIN?).

zaolin commented 6 months ago

@AlfioEmanueleFresta I may get nlnet funding for it, I am currently in discussion with them. I thought of integrating it directly into systemd so it comes by default with the distro. Any thoughts, wishes from your side?

AlfioEmanueleFresta commented 6 months ago

@zaolin that sounds great.

For FIDO2 use cases, I can think of the following requirements:

I have written about the challenge of origin scoping in a blog post. I do not recommend you solve this within your TPM (systemd?) service, but rather simply ensure the design is compatible with origin scoping being enforced by xdg-desktop-portal or whatever D-Bus portal providing FIDO2 functionality to applications. Specifically, I can think of two ways of achieving this:

  1. Using high-entropy handles to reference keys within the TPM, requiring TPM applications to keep track of these handles. The 'desktop portal' offering FIDO2 origin scoping protections would be responsible for storing per-application mappings, so as to prevent applications independently accessing FIDO2 credentials, bypassing the
  2. Using wrapped keys to offload storage of encrypted key material to user space applications.

I would recommend approach (2) because it would solve both issues of (a) supporting origin scoping enforcement by FIDO2 middleware, as well as (b) storing a virtually unbounded number of credentials, by completely offloading storage of wrapped private keys to the user space middleware.

WDYT?

I would recommend joining the Secrets @ GNOME Matrix room and connect other contributors who may have more thoughts on the systemd integration.

zaolin commented 6 months ago

@AlfioEmanueleFresta Hey, I have joined meanwhile the matrix channel. Yes I think from the first view I would also go for option 2) I need to summarize your and the systemd community feedback on that matter. I hope I can come up this week with a complete/detailed proposal. I will post it into a systemd issue and link it here as reference. I already checked your blog post and will come back here in few days :)

pepa65 commented 3 weeks ago

No need to wait for systemd integration, if something works well outside of it, systemd integration will quickly come.