Skip to content

Commit 6aab3bf

Browse files
authored
chore(CI): update template and workflows (#616)
1 parent 8332e21 commit 6aab3bf

File tree

4 files changed

+12
-202
lines changed

4 files changed

+12
-202
lines changed

.github/workflows/duvet.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@ jobs:
2020
DOTNET_CLI_TELEMETRY_OPTOUT: 1
2121
DOTNET_NOLOGO: 1
2222
steps:
23+
- name: Support longpaths on Git checkout
24+
run: |
25+
git config --global core.longpaths true
26+
2327
- uses: actions/checkout@v3
2428
with:
25-
# This secret is in the configured environment
26-
# Token created on # 12/14/2022
27-
# expires in ~30 days 01/13/2023
28-
token: ${{ secrets.PAT_SPEC }}
29-
submodules: true
29+
submodules: true
3030

3131
- name: Install duvet
3232
shell: bash

.github/workflows/library_dafny_verification.yml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,7 @@ jobs:
4141
steps:
4242
- uses: actions/checkout@v2
4343
- name: Init Submodules
44-
env:
45-
# This secret is in the configured environment
46-
# Token created on # 09/26/2023
47-
# expires in ~30 days 10/26/2023
48-
MPL_PAT: ${{ secrets.MPL_DAFNY }}
4944
run: |
50-
AUTH="$(echo -n "pat:${MPL_PAT}" | base64 | tr -d '\n')"
51-
git config --global http.https://github.com/.extraheader "AUTHORIZATION: basic $AUTH"
52-
git config --global --add url.https://github.com/.insteadOf [email protected]:
5345
git submodule update --init libraries
5446
git submodule update --init --recursive mpl
5547

.github/workflows/library_net_tests.yml

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -54,23 +54,15 @@ jobs:
5454
- uses: actions/checkout@v2
5555
- name: Init Submodules
5656
shell: bash
57-
env:
58-
# This secret is in the configured environment
59-
# Token created on # 09/26/2023
60-
# expires in ~30 days 10/26/2023
61-
MPL_PAT: ${{ secrets.MPL_DAFNY }}
6257
run: |
63-
AUTH="$(echo -n "pat:${MPL_PAT}" | base64 | tr -d '\n')"
64-
git config --global http.https://github.com/.extraheader "AUTHORIZATION: basic $AUTH"
65-
git config --global --add url.https://github.com/.insteadOf [email protected]:
6658
git submodule update --init libraries
6759
git submodule update --init --recursive mpl
6860
6961
- name: Configure AWS Credentials
7062
uses: aws-actions/configure-aws-credentials@v1
7163
with:
7264
aws-region: us-west-2
73-
role-to-assume: arn:aws:iam::370957321024:role/GitHub-CI-ESDK-Dafny-Role-us-west-2
65+
role-to-assume: arn:aws:iam::370957321024:role/GitHub-CI-Public-ESDK-Dafny-Role-us-west-2
7466
role-session-name: NetTests
7567

7668
- name: Setup .NET Core SDK ${{ matrix.dotnet-version }}

cfn/CI.yaml

Lines changed: 6 additions & 180 deletions
Original file line numberDiff line numberDiff line change
@@ -13,197 +13,23 @@ Parameters:
1313
ProjectName:
1414
Type: String
1515
Description: A prefix that will be applied to any names
16-
Default: ESDK-Dafny
16+
Default: Public-ESDK-Dafny
1717
GitHubRepo:
1818
Type: String
1919
Description: GitHub Repo that invokes CI
20-
Default: aws/private-aws-encryption-sdk-dafny-staging
20+
Default: aws/aws-encryption-sdk-dafny
2121

2222
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-
19623
GitHubCIRole:
19724
Type: 'AWS::IAM::Role'
19825
Properties:
19926
RoleName: !Sub "GitHub-CI-${ProjectName}-Role-${AWS::Region}"
20027
Description: "Access DDB, KMS, Resources for CI from GitHub"
20128
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"
20733
AssumeRolePolicyDocument: !Sub |
20834
{
20935
"Version": "2012-10-17",

0 commit comments

Comments
 (0)