Skip to content

Commit db6655e

Browse files
authored
chore: Update docs around AssumeRole permissions (#41)
1 parent 82c08e4 commit db6655e

File tree

1 file changed

+44
-1
lines changed

1 file changed

+44
-1
lines changed

README.md

+44-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,50 @@ Example:
6969
role-duration-seconds: 1200
7070
role-session-name: MySessionName
7171
```
72-
In this example, the secret `AWS_ROLE_TO_ASSUME` contains a string like `arn:aws:iam::123456789100:role/role-to-assume`.
72+
In this example, the secret `AWS_ROLE_TO_ASSUME` contains a string like `arn:aws:iam::123456789100:role/my-github-actions-role`. To assume a role in the same account as the static credentials, you can simply specify the role name, like `role-to-assume: my-github-actions-role`.
73+
74+
### Permissions
75+
76+
In order to assume a role, the IAM user for the static credentials must have the following permissions:
77+
```
78+
{
79+
"Version": "2012-10-17",
80+
"Statement": [
81+
{
82+
"Action": [
83+
"sts:AssumeRole",
84+
"sts:TagSession"
85+
],
86+
"Resource": "arn:aws:iam::123456789012:role/my-github-actions-role",
87+
"Effect": "Allow"
88+
}
89+
]
90+
}
91+
```
92+
93+
The role's trust policy must allow the IAM user to assume the role:
94+
```
95+
{
96+
"Version": "2012-10-17",
97+
"Statement": [
98+
{
99+
"Sid": "AllowIamUserAssumeRole",
100+
"Effect": "Allow",
101+
"Action": "sts:AssumeRole",
102+
"Principal": {"AWS": "arn:aws:iam::123456789012:user/my-github-actions-user"},
103+
"Condition": {
104+
"StringEquals": {"sts:ExternalId": "Example987"}
105+
}
106+
},
107+
{
108+
"Sid": "AllowPassSessionTags",
109+
"Effect": "Allow",
110+
"Action": "sts:TagSession",
111+
"Principal": {"AWS": "arn:aws:iam::123456789012:user/my-github-actions-user"}
112+
}
113+
]
114+
}
115+
```
73116

74117
### Session tagging
75118
The session will have the name "GitHubActions" and be tagged with the following tags:

0 commit comments

Comments
 (0)