Closed crispy101 closed 1 year ago
I've had the same issue and it's solvable by populating role_session_name
in the ~/.aws/config
file for each profile with the role_arn
.
You can enforce a policy to make the role_session_name
be provided. There's an example in the below link to AWS's docs which enforces the role_session_name
must equal the user's AWS username.
https://aws.amazon.com/blogs/security/easily-control-naming-individual-iam-role-sessions/
Once you do that, the session name will be the value of role_session_name
, not boto-session-xxxxx
.
@pjaybell It works like a charm! Thanks very much!
Issue Say you are using a cross account access role, i.e. authenticated in
MASTER
account to accessPRODUCTION
account. In~/.aws/config
:Run the command below to open a session:
Now SSM Session Manager console, as well as CloudTrail, sees "botocore-session-xxxxxxxx" instead of your username on the MASTER account.
Desired behaviour
Your username on the MASTER is shown in SSM Session Manager console and recorded in CloudTrail - this already happens when you start a session via the Console.