-
Notifications
You must be signed in to change notification settings - Fork 73
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
Increase the assume-role MFA expiry time to 8 hours (28800 seconds) #533
Conversation
The docs I read were https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_manage_modify.html and https://docs.aws.amazon.com/IAM/latest/APIReference/API_UpdateRole.html, so maybe this is right? |
It seems like I have to wait for hashicorp/terraform-provider-aws#3977, upgrade the provider and then change my approach. Closing this for now. Thanks for pointing it out, @davbo. |
That PR has been merged now, so I've implemented this in the correct way (hopefully). I'll test it in the test account and see if it works. |
4c632cc
to
6afe8f4
Compare
- AWS recently increased the assume-role session token expiry time to a maximum of 12 hours. This makes our sessions last for eight hours, the length of the working day, to avoid having to re-assume role multiple times a day. This is done via the `max_session_duration` parameter on `aws_iam_role` as implemented in the AWS terraform provider v0.14.0. - This will revert the changes I made in #498, and I'll have to change the docs again, but it makes it simpler in the long run - you only have to remember an `assume-role` command, not also `get-session-token`.
6afe8f4
to
23dd074
Compare
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.
Looks logically correct
Applied in all environments. Merging. |
- Now that tokens have an eight hour expiry (alphagov/govuk-aws#533), we don't need to do the intermediary workaround of calling `aws sts get-session-token` for a longer session without MFA. - This has the side effect that you'll need to re-authenticate with MFA if you wish to switch environments, but I don't think that's necessarily a bad thing at the moment.
maximum of 12 hours. This makes our sessions last for eight hours, the
length of the working day, to avoid having to re-assume role multiple
times a day.
Only ask for MFA on assume-role once in 12 hours #498, and I'll have to
change the docs again, but it makes it simpler in the long run - you
only have to remember an
assume-role
command, not alsoget-session-token
.(I'll test this in the test account first.)