Skip to content
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

webauthnutil: add helpers for webauthn #2686

Merged
merged 3 commits into from Oct 19, 2021
Merged

Conversation

calebdoxsey
Copy link
Contributor

Summary

Add a webauthnutil package for helping with webauthn. It includes:

  • CredentialStorage which stores webauthn credentials in the databroker.
  • GetDeviceType gets a device type from the databroker or a set of pre-defined device types.
  • EnrollmentToken which is a SecureToken containing the enrollment id. This token may be passed on the URL to automatically approve a new device. It is HMAC'd and has an expiration timestamp.
  • Helpers for generating Request and Creation options which convert the protobuf types into the webauthn types.
  • GenerateChallenge used to generate a challenge, which is a random SecureToken that expires after 15 minutes.
  • GetUserEntity and GetUserEntityID to fill in the user details for webauthn. The User ID has unique requirements so we use a UUID v5.

Checklist

  • reference any related issues
  • updated docs
  • updated unit tests
  • updated UPGRADING.md
  • add appropriate tag (improvement / bug / etc)
  • ready for review

@calebdoxsey calebdoxsey added the enhancement New feature or request label Oct 19, 2021
@calebdoxsey calebdoxsey requested a review from a team as a code owner October 19, 2021 13:38
@codeclimate
Copy link

codeclimate bot commented Oct 19, 2021

Code Climate has analyzed commit 6c4e79e and detected 0 issues on this pull request.

View more on Code Climate.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.2%) to 65.048% when pulling 6c4e79e on cdoxsey/webauthnutil into ddccbcf on master.

)

const (
ceremonyTimeout = time.Minute * 15
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

15 min seems very large value, is it coming from the standard?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was arbitrary. It's the time the user has before the challenge expires. I thought it might take a bit sometimes, say if someone has to go get their yubikey from somewhere... what would be a better value?

@calebdoxsey calebdoxsey merged commit 1c445c4 into master Oct 19, 2021
@calebdoxsey calebdoxsey deleted the cdoxsey/webauthnutil branch October 19, 2021 19:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants