-
Notifications
You must be signed in to change notification settings - Fork 89
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
initial yubikey piv support #409
base: master
Are you sure you want to change the base?
Conversation
backend/yubikey.go
Outdated
|
||
} | ||
|
||
// TODO prompt for PIN when it's not default |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can probably be left as a TODO until I figure out the PIN/password support.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think here I'll want it to prompt for the Yubikey PIV pin when it's not 123456
. Were you talking about a different PIN?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm thinking generally how to deal with password prompts in sbctl. It's not a thing yet and that needs to be planned a bit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I ended up using https://github.com/manifoldco/promptui
in my yubikey backend file, which works well and fits the general aesthetic / workflow of sbctl
Thanks for working on this!
I agree with upstream and you should just use the
Prompt everytime I reckon. We want to be able to have a different backend pr type so it makes sense to not pass this around.
Preferably one key pr key on the yubikey. This reflects the proper key hierarchy and allows us flexibility.
Preferably work on the config parts of it, and if anything is too difficult or problematic please just tell me and I'll write up the code you need.
I wonder if we should store some extra metadata around the key. So we can properly look it up when needed. What happens if we have multiple key? |
Thanks for the review! I'll keep working on it. I am thinking of using a .toml config file instead of .yaml, do you have any strong preference? I personally don't really like using .yaml as a config format because of how complicated it can be |
I'd prefer if we stick with |
Will do! I'll keep working on the PR |
I've been testing out my PR branch with the following datadir: /var/lib/sbctl/yubikeys
db_additions:
- microsoft
files:
- path: /boot/vmlinuz-linux-lts
- path: /usr/lib/fwupd/efi/fwupdx64.efi
output: /usr/lib/fwupd/efi/fwupdx64.efi.signed
keys:
pk:
type: yubikey
kek:
type: yubikey
db:
type: yubikey |
I'm busy at congress and stuff until new years. So I can't promise I'll get to this until over new years :) |
no worries! have a good new years! |
I did a |
Might I suggest |
Oh that’s cool, it looks like it might work. I will test it out, thanks! |
I fixed the non tty issue with |
I think it's ready for another review, I have it working locally on my machine for signing my uki and with the hooks, but further testing from someone else would be good |
Would it be possible for you to work a bit more on the commit history of this PR? Having 13 commits with non-descriptive names makes it harder to review properly. |
Sure, let me know if that helps. It's probably best to focus on the final commit most. I didn't bother squashing the commits for the pr |
Hey! Super cool project. I wanted to add yubikey support with its
piv
feature. Here's my initial PR for that. It's a work in progress -- please do not merge the code is still hacky, but I made the PR to get your take on my implementation so far. A few notes:go-piv/piv-go
project has a bug where it doesn't actually export a few of the key types because they have lowercase names. I submitted export KeyRSA and KeyEd25519 go-piv/piv-go#164 to fix thatpriv
in the config passed to the yubikey type but I am not sure if that's needed or if it's better to just prompt every time insteadThanks!