@@ -13,197 +13,23 @@ Parameters:
13
13
ProjectName :
14
14
Type : String
15
15
Description : A prefix that will be applied to any names
16
- Default : ESDK-Dafny
16
+ Default : Public- ESDK-Dafny
17
17
GitHubRepo :
18
18
Type : String
19
19
Description : GitHub Repo that invokes CI
20
- Default : aws/private- aws-encryption-sdk-dafny-staging
20
+ Default : aws/aws-encryption-sdk-dafny
21
21
22
22
Resources :
23
- KeyStoreTestTable :
24
- Type : AWS::DynamoDB::Table
25
- Properties :
26
- AttributeDefinitions :
27
- - AttributeName : " branch-key-id"
28
- AttributeType : " S"
29
- - AttributeName : " type"
30
- AttributeType : " S"
31
- - AttributeName : " status"
32
- AttributeType : " S"
33
- KeySchema :
34
- - AttributeName : " branch-key-id"
35
- KeyType : " HASH"
36
- - AttributeName : " type"
37
- KeyType : " RANGE"
38
- ProvisionedThroughput :
39
- ReadCapacityUnits : " 5"
40
- WriteCapacityUnits : " 5"
41
- TableName : !Ref KeyStoreTable
42
- GlobalSecondaryIndexes :
43
- - IndexName : !Sub "Active-Keys"
44
- KeySchema :
45
- - AttributeName : " branch-key-id"
46
- KeyType : " HASH"
47
- - AttributeName : " status"
48
- KeyType : " RANGE"
49
- Projection :
50
- ProjectionType : " ALL"
51
- ProvisionedThroughput :
52
- ReadCapacityUnits : " 5"
53
- WriteCapacityUnits : " 5"
54
-
55
- HierarchicalKeyringTestTable :
56
- Type : AWS::DynamoDB::Table
57
- Properties :
58
- AttributeDefinitions :
59
- - AttributeName : " branch-key-id"
60
- AttributeType : " S"
61
- - AttributeName : " version"
62
- AttributeType : " S"
63
- - AttributeName : " status"
64
- AttributeType : " S"
65
- KeySchema :
66
- - AttributeName : " branch-key-id"
67
- KeyType : " HASH"
68
- - AttributeName : " version"
69
- KeyType : " RANGE"
70
- ProvisionedThroughput :
71
- ReadCapacityUnits : " 5"
72
- WriteCapacityUnits : " 5"
73
- TableName : !Ref TableName
74
- GlobalSecondaryIndexes :
75
- - IndexName : " Active-Keys"
76
- KeySchema :
77
- - AttributeName : " status"
78
- KeyType : " HASH"
79
- - AttributeName : " branch-key-id"
80
- KeyType : " RANGE"
81
- Projection :
82
- ProjectionType : " ALL"
83
- ProvisionedThroughput :
84
- ReadCapacityUnits : " 5"
85
- WriteCapacityUnits : " 5"
86
-
87
- # This policy SHOULD be given to:
88
- # - aws/private-aws-encryption-sdk-dafny-staging
89
- # - ToolsDevelopment
90
- HierarchicalKeyringTestTableUsage :
91
- Type : " AWS::IAM::ManagedPolicy"
92
- Properties :
93
- Description : " Allow Read, Write, and Delete of Items in HierarchicalKeyringTestTable"
94
- ManagedPolicyName : !Sub "${ProjectName}-DDB-ReadWriteDelete-${AWS::Region}"
95
- PolicyDocument :
96
- Version : ' 2012-10-17'
97
- Statement :
98
- - Effect : Allow
99
- Action :
100
- - dynamodb:PutItem
101
- - dynamodb:DeleteItem
102
- - dynamodb:GetItem
103
- - dynamodb:Query
104
- Resource :
105
- - !Sub " arn:aws:dynamodb:${AWS::Region}:${AWS::AccountId}:table/${TableName}"
106
- - !Sub " arn:aws:dynamodb:${AWS::Region}:${AWS::AccountId}:table/${TableName}/index/*"
107
- - Effect : Allow
108
- Action :
109
- - dynamodb:DescribeTable
110
- - dynamodb:CreateTable
111
- - dynamodb:PutItem
112
- - dynamodb:DeleteItem
113
- - dynamodb:GetItem
114
- - dynamodb:Query
115
- - dynamodb:ConditionCheckItem
116
- - dynamodb:UpdateItem
117
- Resource :
118
- - !Sub " arn:aws:dynamodb:${AWS::Region}:${AWS::AccountId}:table/${KeyStoreTable}"
119
- - !Sub " arn:aws:dynamodb:${AWS::Region}:${AWS::AccountId}:table/${KeyStoreTable}/index/*"
120
-
121
-
122
- HierarchicalGitHubKMSKeyID :
123
- Type : ' AWS::KMS::Key'
124
- Properties :
125
- Description : KMS Key for GitHub Action Workflow
126
- Enabled : true
127
- KeyPolicy :
128
- Version : 2012-10-17
129
- Statement :
130
- - Effect : Allow
131
- Principal :
132
- AWS : !Sub 'arn:aws:iam::${AWS::AccountId}:root'
133
- Action : ' kms:*'
134
- Resource : ' *'
135
-
136
- KMSUsage :
137
- Type : ' AWS::IAM::ManagedPolicy'
138
- Properties :
139
- PolicyDocument : !Sub |
140
- {
141
- "Version": "2012-10-17",
142
- "Statement": [
143
- {
144
- "Effect": "Allow",
145
- "Action": [
146
- "kms:Decrypt",
147
- "kms:GenerateDataKeyWithoutPlaintext",
148
- "kms:ReEncrypt*"
149
- ],
150
- "Resource": "arn:aws:kms:*:${AWS::AccountId}:key/${HierarchicalGitHubKMSKeyID}"
151
- }
152
- ]
153
- }
154
- ManagedPolicyName : Hierarchical-GitHub-KMS-Key-Policy
155
-
156
- RSAGitHubKMSKeyID :
157
- Type : ' AWS::KMS::Key'
158
- Properties :
159
- Description : KMS RSA Key for GitHub Action Workflow
160
- Enabled : true
161
- KeyPolicy :
162
- Version : 2012-10-17
163
- Statement :
164
- - Effect : Allow
165
- Principal :
166
- AWS : !Sub 'arn:aws:iam::${AWS::AccountId}:root'
167
- Action : ' kms:*'
168
- Resource : ' *'
169
- KeySpec : " RSA_2048"
170
- KeyUsage : " ENCRYPT_DECRYPT"
171
- MultiRegion : true
172
-
173
- RSAKMSUsage :
174
- Type : ' AWS::IAM::ManagedPolicy'
175
- Properties :
176
- PolicyDocument : !Sub |
177
- {
178
- "Version": "2012-10-17",
179
- "Statement": [
180
- {
181
- "Effect": "Allow",
182
- "Action": [
183
- "kms:Encrypt",
184
- "kms:Decrypt",
185
- "kms:ReEncrypt*",
186
- "kms:Generate*",
187
- "kms:GetPublicKey",
188
- "kms:DescribeKey"
189
- ],
190
- "Resource": "arn:aws:kms:*:${AWS::AccountId}:key/${RSAGitHubKMSKeyID}"
191
- }
192
- ]
193
- }
194
- ManagedPolicyName : RSA-GitHub-KMS-Key-Policy
195
-
196
23
GitHubCIRole :
197
24
Type : ' AWS::IAM::Role'
198
25
Properties :
199
26
RoleName : !Sub "GitHub-CI-${ProjectName}-Role-${AWS::Region}"
200
27
Description : " Access DDB, KMS, Resources for CI from GitHub"
201
28
ManagedPolicyArns :
202
- - " arn:aws:iam::370957321024:policy/PolymorphTestModels-KMS-us-west-2"
203
- - !Ref KMSUsage
204
- - !Ref RSAKMSUsage
205
- - " arn:aws:iam::370957321024:policy/PolymorphTestModels-DDB-ReadWriteDelete-us-west-2"
206
- - !Ref HierarchicalKeyringTestTableUsage
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"
207
33
AssumeRolePolicyDocument : !Sub |
208
34
{
209
35
"Version": "2012-10-17",
0 commit comments