-
Notifications
You must be signed in to change notification settings - Fork 30
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
add --assume-duration flag to env and shell #119
base: master
Are you sure you want to change the base?
Conversation
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.
Preliminary review, looks like there are a few changes we should make (in addition to the rebase now needed).
env.go
Outdated
if err != nil { | ||
return nil, err | ||
} | ||
v.AWSKey.RoleDuration = assumeDuration |
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.
If there is no AWSKey
configured in the vault, this could cause a SEGFAULT. We need to guard this with a v.AWSKey != nil
check.
env.go
Outdated
@@ -150,8 +158,24 @@ func (e *Env) getSession(store vaulted.Store) (*vaulted.Session, error) { | |||
} | |||
|
|||
if e.Role != "" { | |||
return session.Assume(e.Role) | |||
assumeDuration, err := e.getAssumeDuration() |
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.
Delaying the parsing of the duration to this point means that we will have already prompted the user for their vault password and MFA before we throw an error indicating that their duration was ill formatted. We should probably validate the duration format before we open the vault.
add the --assume-duration flag to env and shell commands to allow specifying a custom role duration from the CLI
allows saving an assume role duration inside of the vault that will be used alongside a stored role
c5b5fa5
to
682fa60
Compare
add the --assume-duration flag to env and shell commands to allow
specifying a custom role duration from the CLI