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

Proposal: Feature for automatically getting STS token via a configurable command #1019

Open
msabramo opened this issue Mar 11, 2017 · 4 comments
Labels
automation-exempt feature-request This issue requests a feature. p3 This is a minor priority issue sts

Comments

@msabramo
Copy link
Contributor

I was going to look into implementing this and sending a PR but wanted to check if it's a good idea first.

I'd love if I could set in ~/.aws/config a key called get_token_command or such (open on better name...). If the user does an an AWS operation and gets back a "security token expired" error, then boto would invoke the configured command.

This is basically taking the idea of https://github.com/msabramo/aws-cli-get-token-command and pushing it down into boto, so that it can work with AWS CLI but also other Python programs that use boto.

What do folks think?

@JordonPhillips
Copy link
Contributor

Automating away MFA kind of defeats the point. I can understand wanting a longer expiration time, but having a process automatically grabbing a new token isn't actually any different than just having a fixed policy with credentials scoped to what you need. You still have the power to rotate / revoke credentials when necessary.

Can I ask what your use case is? It could be that I'm missing something.

@JordonPhillips JordonPhillips added the closing-soon This issue will automatically close in 4 days unless further comments are made. label Mar 13, 2017
@msabramo
Copy link
Contributor Author

Yeah, so we have an internal tool where we authenticate to our corporate system and it hands out a 1 hour session token for AWS CLI operations. This tool was designed as a Web UI and uses browser cookies and depending on whether or not your session is still valid, it might just give you the session token no questions asked or it may ask you to login with username and password and/or it may require MFA (I think it requires the MFA every 12 hours). However, we also have a command-line program that is able to spin up the web browser and grab the session token automatically, if you already have valid browser cookies and the authentication is not necessary yet.

So my hope here was to have a way to make boto fire off this command when my session token is expired. In most cases, this would hit the browser, get good cookies and automatically get a new session token and then rerun the operation.

@JordonPhillips JordonPhillips removed closing-soon This issue will automatically close in 4 days unless further comments are made. needs-discussion others-chime-in labels Jul 21, 2017
@JordonPhillips
Copy link
Contributor

Ah, so like being able to call off to another process to provide credentials / tokens. That makes a lot of sense and would be super useful for a number of other things.

@saskell
Copy link

saskell commented Sep 9, 2018

I ran into a situation where this idea could have helped.

OR... if STS Temporary tokens were being used, boto could keep track of the expiration time, and when that time is hit it re-reads the ~/.aws/credentials file to see if some other process has updated the credentials. If the credentials have been updated then it uses them.

@swetashre swetashre added the auto-label-exempt Issue will not be subject to stale-bot label Aug 13, 2020
@github-actions github-actions bot added the closing-soon This issue will automatically close in 4 days unless further comments are made. label Sep 23, 2021
@kdaily kdaily added automation-exempt and removed closing-soon This issue will automatically close in 4 days unless further comments are made. auto-label-exempt Issue will not be subject to stale-bot labels Sep 23, 2021
@boto boto deleted a comment from github-actions bot Sep 23, 2021
@aBurmeseDev aBurmeseDev added the p3 This is a minor priority issue label Nov 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automation-exempt feature-request This issue requests a feature. p3 This is a minor priority issue sts
Projects
None yet
Development

No branches or pull requests

7 participants