Skip to content

Commit b37c645

Browse files
add more
1 parent 1808597 commit b37c645

File tree

2 files changed

+72
-3
lines changed

2 files changed

+72
-3
lines changed

cfn/ESDK-Python.yml

+5-3
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,7 @@ Resources:
174174
- !Ref CodeBuildBatchPolicy
175175
- !Ref CodeBuildBasePolicy
176176
- !Ref SecretsManagerPolicy
177+
- !Ref CodeBuildCISTSAllow
177178

178179
CodeBuildCIServiceRole:
179180
Type: "AWS::IAM::Role"
@@ -186,6 +187,7 @@ Resources:
186187
- !Ref CryptoToolsKMS
187188
- !Ref CodeBuildCIBatchPolicy
188189
- !Ref CodeBuildBasePolicy
190+
- !Ref CodeBuildCISTSAllow
189191

190192
CodeBuildBatchPolicy:
191193
Type: "AWS::IAM::ManagedPolicy"
@@ -350,9 +352,9 @@ Resources:
350352
"Version": "2012-10-17",
351353
"Statement": [
352354
{
353-
"Effect": "Allow",
354-
"Action": "sts:AssumeRole",
355-
"Resource": "arn:aws:iam::370957321024:role/GitHub-CI-Public-ESDK-Java-Role-us-west-2"
355+
"Effect": "Allow",
356+
"Action": "sts:AssumeRole",
357+
"Resource": "arn:aws:iam::370957321024:role/GitHub-CI-Public-ESDK-Python-Role-us-west-2"
356358
}
357359
]
358360
}

cfn/Public-ESDK-Python-CI.yml

+67
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
AWSTemplateFormatVersion: "2010-09-09"
2+
Description: "DDB Table and IAM Managed Policies/Role for AWS KMS Hierarchical Keyring Testing"
3+
4+
Parameters:
5+
TableName:
6+
Type: String
7+
Description: Test Table Name
8+
Default: HierarchicalKeyringTestTable
9+
KeyStoreTable:
10+
Type: String
11+
Description: Key Store Test Table Name
12+
Default: KeyStoreTestTable
13+
ProjectName:
14+
Type: String
15+
Description: A prefix that will be applied to any names
16+
Default: Public-ESDK-Python
17+
GitHubRepo:
18+
Type: String
19+
Description: GitHub Repo that invokes CI
20+
Default: aws/aws-encryption-sdk-python
21+
22+
Resources:
23+
GitHubCIRole:
24+
Type: 'AWS::IAM::Role'
25+
Properties:
26+
RoleName: !Sub "GitHub-CI-${ProjectName}-Role-${AWS::Region}"
27+
Description: "Access DDB, KMS, Resources for CI from GitHub"
28+
ManagedPolicyArns:
29+
- "arn:aws:iam::370957321024:policy/ESDK-Dafny-DDB-ReadWriteDelete-us-west-2"
30+
- "arn:aws:iam::370957321024:policy/Hierarchical-GitHub-KMS-Key-Policy"
31+
- "arn:aws:iam::370957321024:policy/KMS-Public-CMK-EncryptDecrypt-Key-Access"
32+
- "arn:aws:iam::370957321024:policy/RSA-GitHub-KMS-Key-Policy"
33+
AssumeRolePolicyDocument: !Sub |
34+
{
35+
"Version": "2012-10-17",
36+
"Statement": [
37+
{
38+
"Effect": "Allow",
39+
"Principal": { "Federated": "arn:aws:iam::${AWS::AccountId}:oidc-provider/token.actions.githubusercontent.com" },
40+
"Action": "sts:AssumeRoleWithWebIdentity",
41+
"Condition": {
42+
"StringEquals": {
43+
"token.actions.githubusercontent.com:aud": "sts.amazonaws.com"
44+
},
45+
"StringLike": {
46+
"token.actions.githubusercontent.com:sub": "repo:${GitHubRepo}:*"
47+
}
48+
}
49+
},
50+
{
51+
"Effect": "Allow",
52+
"Principal": {
53+
"AWS": "*"
54+
},
55+
"Action": "sts:AssumeRole",
56+
"Condition": {
57+
"StringEquals": {
58+
"aws:PrincipalArn": [
59+
"arn:aws:iam::587316601012:role/service-role/codebuild-python-esdk-CI-service-role",
60+
"arn:aws:iam::587316601012:role/service-role/codebuild-python-esdk-service-role",
61+
"arn:aws:iam::${AWS::AccountId}:role/ToolsDevelopment"
62+
]
63+
}
64+
}
65+
}
66+
]
67+
}

0 commit comments

Comments
 (0)