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

Increase the assume-role MFA expiry time to 8 hours (28800 seconds) #533

Merged
merged 1 commit into from
Apr 13, 2018

Conversation

issyl0
Copy link
Contributor

@issyl0 issyl0 commented Apr 4, 2018

  • 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 will revert the changes I made in
    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 also
    get-session-token.

(I'll test this in the test account first.)

@issyl0
Copy link
Contributor Author

issyl0 commented Apr 4, 2018

@issyl0
Copy link
Contributor Author

issyl0 commented Apr 4, 2018

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.

@issyl0 issyl0 closed this Apr 4, 2018
@issyl0 issyl0 reopened this Apr 11, 2018
@issyl0
Copy link
Contributor Author

issyl0 commented Apr 11, 2018

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.

@issyl0 issyl0 force-pushed the increase_assume_role_mfa_expiration_time branch from 4c632cc to 6afe8f4 Compare April 11, 2018 10:50
- 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`.
@issyl0 issyl0 force-pushed the increase_assume_role_mfa_expiration_time branch from 6afe8f4 to 23dd074 Compare April 11, 2018 10:54
@issyl0
Copy link
Contributor Author

issyl0 commented Apr 11, 2018

This appears to be the correct setting. I did an apply in the test account and both govuk-powerusers and govuk-administrators roles are coming up as:

screenshot 2018-04-11 13 49 23

Copy link
Contributor

@suthagarht suthagarht left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks logically correct

@issyl0
Copy link
Contributor Author

issyl0 commented Apr 13, 2018

Applied in all environments. Merging.

@issyl0 issyl0 merged commit 432d2a7 into master Apr 13, 2018
@issyl0 issyl0 deleted the increase_assume_role_mfa_expiration_time branch April 13, 2018 10:53
issyl0 pushed a commit to alphagov/govuk-developer-docs that referenced this pull request Apr 13, 2018
- 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.
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

Successfully merging this pull request may close these issues.

2 participants