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

autoawsume leaves session with expired credentials for ~ 60s #91

Closed
valdisrigdon opened this issue Feb 10, 2020 · 3 comments
Closed

autoawsume leaves session with expired credentials for ~ 60s #91

valdisrigdon opened this issue Feb 10, 2020 · 3 comments

Comments

@valdisrigdon
Copy link
Contributor

Why does https://github.com/trek10inc/awsume/blob/master/awsume/autoawsume/main.py#L69 add 60s to the sleep time? This is leaving the session with invalid credentials during that 60s.

@mbarneyjr
Copy link
Member

This is a bug, it should be subtracting 60s, to make sure you always have valid credentials. Thanks for the bug report! This has been fixed in 4.2.2.

@valdisrigdon
Copy link
Contributor Author

The fix doesn't quite work; what's happening now is that it wakes up 60s early, but then discovers that nothing is expired, then tries to sleep until something expires, which is usually just under 60s - 60s, so it's a negative sleep time.

main.py needs to refresh credentials if they are expired or will expire in less than or equal to 60s as well.

@valdisrigdon
Copy link
Contributor Author

@mbarneyjr Should I open a new issue for this? With the fix that when in, auto-refresh is pretty much broken.

@mbarneyjr mbarneyjr reopened this Feb 11, 2020
mbarneyjr added a commit that referenced this issue Feb 19, 2020
Fixes #91: refresh role credentials sooner
ryansb pushed a commit to ryansb/awsume that referenced this issue Jul 14, 2021
The check to refresh role credentials needs to take into account that
they may expire within 60s so that we don't have a period of time where
the role credentials have expired.

This also ensure that if we never sleep for a negative time as this
leads to autoawsume exiting with a failure.
ryansb pushed a commit to ryansb/awsume that referenced this issue Jul 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants