trek10inc / awsume

A utility for easily assuming AWS IAM roles from the command line.
https://awsu.me
MIT License
488 stars 90 forks source link

Allow session name to be configure in config.yaml #100

Closed choonming closed 3 years ago

choonming commented 4 years ago

Whenever I want to assume a role via awsume, it will use my account name for the session. The user ID will appear as XXACCESSKEYIDXXX:account_name. I can fix this by adding --session name when running awsume but would it not be better if we can configure a default for all the awsume's parameter into the config.yaml?

colors: true
fuzzy-match: false
role-duration: 0
session-name: name
mbarneyjr commented 4 years ago

Hi @choonming ,

There is a ~/.aws/config file profile property called role_session_name, documented here: https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html

Unfortunately, this property is not currently supported by awsume yet, but it's now on the list. Will support for this profile configuration property be sufficient for your use case or would a global default still be preferrable?

choonming commented 4 years ago

Hi @mbarneyjr ,

The property role_session_name do work if I'm not using awsume. If we set it both global default and per profile configuration in the configuration file, it'll be awesome. With the current awsume, It's rather difficult to identify the users on CloudTrail when everyone is assuming roles via awsume.

Even better if it can honor the properties in .aws/config

mbarneyjr commented 4 years ago

Sure thing, we'll be sure to support both in the next release, thanks for the bug report!

mbarneyjr commented 3 years ago

Hi, sorry for the delay in response! I've implemented this and a few other fixes. This should be found in pre release 4.5.0a1. I'll deploy this to release 4.5.0 once I'm confident in the changes. If you experience any issues with pre release 4.5.0a1 please update this issue, thanks!

mbarneyjr commented 3 years ago

Sorry for the delay, this has been deployed to 4.5.0