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

add --assume-duration flag to env and shell #119

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ryan-norton
Copy link
Collaborator

add the --assume-duration flag to env and shell commands to allow
specifying a custom role duration from the CLI

Copy link
Owner

@miquella miquella left a 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
Copy link
Owner

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()
Copy link
Owner

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
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