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

accept role_session_name from ~/.aws/config #87

Merged
merged 1 commit into from
Sep 22, 2016

Conversation

randxm
Copy link
Contributor

@randxm randxm commented Sep 16, 2016

Allows a user to add a role_session_name to their ~/.aws/config file, which will be used in place of the Unix timestamp if available.

@lox
Copy link
Collaborator

lox commented Sep 17, 2016

Thanks for the PR, what's the usecase for this?

This series of comments makes me a bit concerned that there will be unexpected side effects from this: aws/aws-cli#1389 (comment)

@randxm
Copy link
Contributor Author

randxm commented Sep 19, 2016

The main use case here is that the role_session_name is actually the User name field that appears in AWS CloudTrail logs. While there is no guarantee that a role session name that is used is "accurate" (since it can be set by anyone to be anything), it can help as a first level of "good housekeeping" and can be a lot more informative than a timestamp.

@lox
Copy link
Collaborator

lox commented Sep 21, 2016

Thoughts specifically on the concerns raised in the comment I linked to? We could work around them by appending a timestamp or random number to the role_session_name.

@randxm
Copy link
Contributor Author

randxm commented Sep 21, 2016

Appreciate the considerations here - I read through the referenced PR and I suppose I didn't directly see a conflict, thanks no doubt to the changes implemented in aws-cli based on that PR. In my testing with the modified code, I observed that modifying the role_session_name led to creating a new session in aws-vault, as expected. e.g., in the logs attached (aws-vault.txt), you can see results from 3 separate runs of aws-vault exec admin-profile -- aws cloudtrail lookup-events --max-results 1.

The first 2 (at 11:12 and 11:15) were made with one role_session_name entered in ~/.aws/config.
The third (at 11:16) was made after the role_session_name was changed.

As you can see, the first two reuse the same session; the third re-required an MFA token and generated a new session. The correct role_session_name for each run was also confirmed in cloudtrail logs.

@lox
Copy link
Collaborator

lox commented Sep 22, 2016

Ok cool, let's merge it in.

@lox lox merged commit 10ab556 into 99designs:master Sep 22, 2016
@lox
Copy link
Collaborator

lox commented Sep 22, 2016

Thanks for the PR @randxm, apologies it took me a while to QA.

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