-
Notifications
You must be signed in to change notification settings - Fork 4
Allow users to assume MFA device is already configured #68
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
Conversation
Testing: go run ./cmd/ setup --iam-user cgilmer-delete-me --iam-role engineer --aws-profile delete-id --aws-account-id REDACTED --no-mfa
|
if len(mfaDeviceOutput.MFADevices) == 0 { | ||
return errors.New("no MFA devices registered") | ||
} | ||
mfaDevice := mfaDeviceOutput.MFADevices[0] |
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.
Does this mean you're taking the first device? Is it possible to have more than 1? How do you support a user who wants to use an MFA device that isn't the first one?
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 didn't think the setup supported more than one. Now I'm curious.
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.
Yeah, there's room for several in the api return but in practice I've never ever seen more than one. I assume it's some kind of internal tooling where they can provision a new one while the old one is being deprovisioned.
Regardless, I think it's a difficult user experience to try to figure out which one the user wants to select given the output of the API. So it's probably safe to assume the first one is the right one and all other edge cases will not be handled.
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.
For safety I added in an error if more than one is returned.
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.
Thank you!
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.
lgtm!
This was a useful modification for MilMove where new credentials were provided after the MFA was already set up. Passing the flag
--no-mfa
will retrieve the existing MFA serial number instead of creating and enabling a new device.Pivotal Story:
Notes: This could possibly be a separate subcommand like
setup-new-aws-user update-creds
but for now it feels better to keep things simplified until we know more about the workflow around setting up accounts.