Prompt for MFA token for users
See original GitHub issueWhen a profile is configured with mfa_serial
for a role (Assume Role Provider), boto3 will request MFA tokens and assume the role. Why doesn’t a similar functionality exist for users? If a user profile has a mfa_serial
parameter, shouldn’t boto3 ask for MFA tokens and authenticate with these?
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Azure AD Multi-Factor Authentication prompts and session ...
In this scenario, MFA prompts multiple times as each application requests an OAuth Refresh Token to be validated with MFA. In Azure AD,...
Read more >Sure, keep me signed in! And don't prompt for MFA!
Today a short blog about MFA prompts, session lifetime, and cookies. This will give you an idea of how you can tune the...
Read more >Users Aren't Getting MFA Prompts Every Day - Sean McAvinue
There is little value in prompting users every day to answer MFA on the ... we log on to Windows and receive a...
Read more >Authenticate access using MFA through the AWS CLI
How do I use an MFA token to authenticate access to my AWS resources with the AWS Command Line Interface (AWS CLI)? ...
Read more >Add Step-up Authentication - Auth0
Once the user successfully authenticates with MFA, Auth0 generates and sends a new access token that includes the high-value scope.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I understand that I can script this process, I guess my question is why boto3 doesn’t do this automatically?
I’m in the process of trying to script around this exact problem myself so the answer to this question is relevant for my use-case as I’m finding myself trying to determine how to perform the following workflow:
context:
$HOME/.aws/credentials
usually contains a few accounts IE:mfa_serial
) uses sub-accounts so there’s a config$HOME/.aws/config
defines profiles under one of the aforementioned specified accounts:So the problem:
We have an inventory CLI tool which needs to do resource querying. The problem is that MFA was recently set to forced for only one of the main accounts
org1-admin
. The CLI tool needs to be able to ask the CLI admin for their MFA token if the CLI tool is querying againstorg1-admin
resources and then assume an sts role just for that account. That’s fine. The problem is that there is no reason for the script to attempt to query for MFA until it’s necessary (when it needs to seek resources from org1-admin).Since boto doesn’t seem to be intelligent enough to notice when an account requires MFA for authorization, I need to code this in. My main problem is that I’m not really sure how to introspect the boto3 object to see if
mfa_serial
exists.