Skip to content

Commit c096e5f

Browse files
committed
Merge branch 'main' into int
2 parents 4672343 + 267e16e commit c096e5f

File tree

24 files changed

+1988
-1645
lines changed

24 files changed

+1988
-1645
lines changed

.github/dependabot.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: gomod
4+
directory: "/"
5+
schedule:
6+
interval: weekly
7+
open-pull-requests-limit: 3
8+
- package-ecosystem: "github-actions"
9+
directory: "/"
10+
schedule:
11+
interval: weekly
12+
- package-ecosystem: docker
13+
directory: "/"
14+
schedule:
15+
interval: weekly
16+
open-pull-requests-limit: 3

.github/workflows/automatePR.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ jobs:
1616
actions: write
1717

1818
steps:
19-
- uses: actions/checkout@v3
19+
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b
2020
with:
2121
repository: step-security/secure-workflows
2222

2323
- name: Automate PR
24-
uses: step-security/secure-workflows/Automate-PR@main
24+
uses: step-security/secure-workflows/Automate-PR@98ff385ea512d8ac7a1445f95e199f6864f439e1
2525
with:
2626
github-token: ${{secrets.PAT }}
2727
issue-id: ${{ github.event.issue.number}}

.github/workflows/codeql.yml

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
# For most projects, this workflow file will not need changing; you simply need
2+
# to commit it to your repository.
3+
#
4+
# You may wish to alter this file to override the set of languages analyzed,
5+
# or to provide custom queries or build logic.
6+
#
7+
# ******** NOTE ********
8+
# We have attempted to detect the languages in your repository. Please check
9+
# the `language` matrix defined below to confirm you have the correct set of
10+
# supported CodeQL languages.
11+
#
12+
name: "CodeQL"
13+
14+
on:
15+
push:
16+
branches: ["main"]
17+
pull_request:
18+
# The branches below must be a subset of the branches above
19+
branches: ["main"]
20+
schedule:
21+
- cron: "35 17 * * 4"
22+
23+
permissions: # added using https://github.com/step-security/secure-workflows
24+
contents: read
25+
26+
jobs:
27+
analyze:
28+
name: Analyze
29+
runs-on: ubuntu-latest
30+
permissions:
31+
actions: read
32+
contents: read
33+
security-events: write
34+
35+
strategy:
36+
fail-fast: false
37+
matrix:
38+
language: ["go"]
39+
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
40+
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
41+
42+
steps:
43+
- name: Harden Runner
44+
uses: step-security/harden-runner@ebacdc22ef6c2cfb85ee5ded8f2e640f4c776dd5
45+
with:
46+
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs
47+
48+
- name: Checkout repository
49+
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b
50+
51+
# Initializes the CodeQL tools for scanning.
52+
- name: Initialize CodeQL
53+
uses: github/codeql-action/init@e0e5ded33cabb451ae0a9768fc7b0410bad9ad44
54+
with:
55+
languages: ${{ matrix.language }}
56+
# If you wish to specify custom queries, you can do so here or in a config file.
57+
# By default, queries listed here will override any specified in a config file.
58+
# Prefix the list here with "+" to use these queries and those in the config file.
59+
60+
# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
61+
# queries: security-extended,security-and-quality
62+
63+
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
64+
# If this step fails, then you should remove it and run the build manually (see below)
65+
- name: Autobuild
66+
uses: github/codeql-action/autobuild@e0e5ded33cabb451ae0a9768fc7b0410bad9ad44
67+
68+
# ℹ️ Command-line programs to run using the OS shell.
69+
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
70+
71+
# If the Autobuild fails above, remove it and uncomment the following three lines.
72+
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
73+
74+
# - run: |
75+
# echo "Run, Build Application using script"
76+
# ./location_of_script_within_repo/buildscript.sh
77+
78+
- name: Perform CodeQL Analysis
79+
uses: github/codeql-action/analyze@e0e5ded33cabb451ae0a9768fc7b0410bad9ad44
80+
with:
81+
category: "/language:${{matrix.language}}"

.github/workflows/int.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
runs-on: ubuntu-latest
1616
steps:
1717
- name: Harden Runner
18-
uses: step-security/harden-runner@dd2c410b088af7c0dc8046f3ac9a8f4148492a95
18+
uses: step-security/harden-runner@ebacdc22ef6c2cfb85ee5ded8f2e640f4c776dd5
1919
with:
2020
egress-policy: audit
2121
- name: Checkout

.github/workflows/kbanalysis.yml

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,13 @@ name: KBAnalysis
22
on:
33
issues:
44
types:
5-
- opened
6-
- reopened
7-
- closed
5+
- opened
6+
- reopened
7+
- closed
8+
workflow_dispatch:
9+
schedule:
10+
- cron: "0 0 * * *"
11+
812
permissions:
913
contents: read
1014

@@ -15,19 +19,19 @@ jobs:
1519
issues: write
1620
contents: write
1721
pull-requests: write
18-
22+
1923
steps:
2024
- name: Harden Runner
21-
uses: step-security/harden-runner@dd2c410b088af7c0dc8046f3ac9a8f4148492a95
25+
uses: step-security/harden-runner@ebacdc22ef6c2cfb85ee5ded8f2e640f4c776dd5
2226
with:
2327
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs
2428

2529
- uses: actions/checkout@d0651293c4a5a52e711f25b41b05b2212f385d28
2630
with:
2731
repository: step-security/secure-workflows
28-
32+
2933
- name: KBAnalysis
30-
uses: step-security/secure-workflows/kbanalysis@03a07b65449688ebe9e517e4446b9f323bb194a0
34+
uses: step-security/secure-workflows/kbanalysis@9d85dcc91fadd9e87b427561d92e9fb82690940f
3135
with:
3236
github-token: ${{secrets.PAT }}
3337
issue-id: ${{ github.event.issue.number}}
@@ -43,7 +47,7 @@ jobs:
4347
uses: peter-evans/create-pull-request@18f7dc018cc2cd597073088f7c7591b9d1c02672
4448
with:
4549
token: ${{secrets.PAT}} # need to use PAT since GITHUB_TOKEN does not initiate workflows
46-
body: "This PR adds a YAML file to describe token permissions needed for Action: ${{steps.get-action.outputs.id}}.\n Fixes #${{github.event.issue.number}}"
50+
body: "This PR adds a YAML file to describe token permissions needed for Action: ${{steps.get-action.outputs.id}}."
4751
commit-message: "added KB for issue#${{github.event.issue.number}}"
4852
title: "[KB] Add GitHub token permissions for ${{steps.get-action.outputs.id}} Action"
4953
branch: "issue#${{github.event.issue.number}}"

.github/workflows/release.yml

Lines changed: 24 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ name: Cfnrelease
22

33
on:
44
workflow_dispatch:
5-
push:
6-
branches:
7-
- main
8-
9-
permissions: # added using https://github.com/step-security/secure-workflows
5+
push:
6+
branches:
7+
- main
8+
9+
permissions: # added using https://github.com/step-security/secure-workflows
1010
contents: read
1111

1212
jobs:
@@ -17,14 +17,14 @@ jobs:
1717
runs-on: ubuntu-latest
1818
steps:
1919
- name: Harden Runner
20-
uses: step-security/harden-runner@dd2c410b088af7c0dc8046f3ac9a8f4148492a95
20+
uses: step-security/harden-runner@ebacdc22ef6c2cfb85ee5ded8f2e640f4c776dd5
2121
with:
2222
egress-policy: audit
2323
- name: Checkout
2424
uses: actions/checkout@629c2de402a417ea7690ca6ce3f33229e27606a5
2525
with:
2626
fetch-depth: 0
27-
- name: Set up Go
27+
- name: Set up Go
2828
uses: actions/setup-go@37335c7bb261b353407cff977110895fa0b4f7d8
2929
with:
3030
go-version: 1.17
@@ -33,29 +33,37 @@ jobs:
3333
env:
3434
PAT: ${{ secrets.PAT }}
3535

36-
- uses: step-security/wait-for-secrets@v1
36+
- uses: step-security/wait-for-secrets@1204ba02d7a707c4ef2e906d2ea1e36eebd9bbd2
3737
id: wait-for-secrets
3838
with:
3939
slack-webhook-url: ${{ secrets.SLACK_WEBHOOK_URL }}
4040
secrets: |
41-
AWS_ACCESS_KEY_ID
42-
AWS_SECRET_ACCESS_KEY
43-
41+
AWS_ACCESS_KEY_ID:
42+
name: 'AWS access key id'
43+
description: 'Access key id for secure-workflows prod'
44+
AWS_SECRET_ACCESS_KEY:
45+
name: 'AWS secret access key'
46+
description: 'Secret access key for secure-workflows prod'
47+
AWS_SESSION_TOKEN:
48+
name: 'AWS session token'
49+
description: 'Session token for secure-workflows prod'
50+
4451
- name: Configure AWS Credentials
4552
uses: aws-actions/configure-aws-credentials@ea7b857d8a33dc2fb4ef5a724500044281b49a5e
4653
with:
47-
aws-access-key-id: ${{ steps.wait-for-secrets.outputs.AWS_ACCESS_KEY_ID }}
54+
aws-access-key-id: ${{ steps.wait-for-secrets.outputs.AWS_ACCESS_KEY_ID }}
4855
aws-secret-access-key: ${{ steps.wait-for-secrets.outputs.AWS_SECRET_ACCESS_KEY }}
56+
aws-session-token: ${{ steps.wait-for-secrets.outputs.AWS_SESSION_TOKEN }}
4957
aws-region: us-west-2
50-
58+
5159
- name: Deploy to AWS CloudFormation
5260
uses: aws-actions/aws-cloudformation-github-deploy@72bea2c93ca6be253b71b5966ecde13f9e8af2d4
5361
with:
5462
name: secure-workflow-api-ecr
5563
template: cloudformation/ecr.yml
5664
parameter-overrides: "ResourceName=secure-workflow-api"
5765
no-fail-on-empty-changeset: "1"
58-
66+
5967
- name: Login to Amazon ECR
6068
id: login-ecr
6169
uses: aws-actions/amazon-ecr-login@aaf69d68aa3fb14c1d5a6be9ac61fe15b48453a2
@@ -68,7 +76,7 @@ jobs:
6876
run: |
6977
docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG .
7078
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
71-
79+
7280
- name: Deploy to AWS CloudFormation
7381
uses: aws-actions/aws-cloudformation-github-deploy@72bea2c93ca6be253b71b5966ecde13f9e8af2d4
7482
with:
@@ -77,7 +85,5 @@ jobs:
7785
parameter-overrides: >-
7886
ResourceName=secure-workflow-api,
7987
ImageTag=${{ github.sha }},
80-
PAT=${{ secrets.PAT }}
88+
PAT=${{ secrets.PAT }}
8189
no-fail-on-empty-changeset: "1"
82-
83-

.github/workflows/test.yml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,23 @@
11
name: Test
22
on:
3-
pull_request_target:
3+
pull_request:
44
branches:
55
- main
66
push:
77
branches:
8-
- main # to update code coverage
8+
- main # to update code coverage
99

10-
permissions: # added using https://github.com/step-security/secure-workflows
10+
permissions: # added using https://github.com/step-security/secure-workflows
1111
contents: read
12-
12+
concurrency:
13+
group: ${{ github.workflow }}
1314
jobs:
1415
test:
1516
permissions:
1617
contents: read
1718
runs-on: ubuntu-latest
1819
steps:
19-
- uses: step-security/harden-runner@14dc64f30986eaa2ad2dddcec073f5aab18e5a24 # v1
20+
- uses: step-security/harden-runner@ebacdc22ef6c2cfb85ee5ded8f2e640f4c776dd5 # v1
2021
with:
2122
allowed-endpoints: >
2223
api.github.com:443
@@ -37,7 +38,7 @@ jobs:
3738
with:
3839
go-version: 1.17
3940
- name: Run coverage
40-
run: go test -race -coverprofile=coverage.txt -covermode=atomic
41+
run: go test ./... -coverpkg=./... -race -coverprofile=coverage.txt -covermode=atomic
4142
env:
42-
PAT: ${{ secrets.PAT_READ_ONLY }}
43+
PAT: ${{ secrets.GITHUB_TOKEN }}
4344
- uses: codecov/codecov-action@f32b3a3741e1053eb607407145bc9619351dc93b # v2

0 commit comments

Comments
 (0)