Skip to content

Commit 8d1a3ad

Browse files
committed
Don't allow GithubRole to modify its own permissions
1 parent 88e49d3 commit 8d1a3ad

File tree

1 file changed

+18
-3
lines changed

1 file changed

+18
-3
lines changed

cloud-formation/github-role.yaml

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Resources:
1616
Condition:
1717
StringLike:
1818
token.actions.githubusercontent.com:sub: !Sub repo:${Repository}:*
19-
Path: /gocapture/
19+
Path: /go_capture/
2020
Policies:
2121
- PolicyName: CloudFormationPolicy
2222
PolicyDocument: {
@@ -37,6 +37,21 @@ Resources:
3737
]
3838
}
3939
- PolicyName: IamPolicy
40+
PolicyDocument: {
41+
"Version": "2012-10-17",
42+
"Statement": [
43+
{
44+
"Effect": Allow,
45+
"Action": [
46+
iam:GetRole,
47+
iam:GetUser,
48+
iam:ListAccessKeys,
49+
],
50+
"Resource": "arn:aws:iam::200049542062:user/go_capture/*"
51+
},
52+
]
53+
}
54+
- PolicyName: IamDeployUserPolicy
4055
PolicyDocument: {
4156
"Version": "2012-10-17",
4257
"Statement": [
@@ -48,13 +63,13 @@ Resources:
4863
iam:DeleteUserPolicy,
4964
iam:GetRole,
5065
iam:GetUser,
51-
iam:ListAccessKeys,
5266
iam:PutRolePolicy,
5367
iam:PutRoleRole,
5468
iam:PutUserPolicy,
5569
iam:UpdateAssumeRolePolicy,
70+
iam:ListAccessKeys,
5671
],
57-
"Resource": "*"
72+
"Resource": "arn:aws:iam::200049542062:user/go_capture/beta_deploy"
5873
},
5974
]
6075
}

0 commit comments

Comments
 (0)