Skip to content

Commit

Permalink
Change Harden Runner actions from audit to block (#1813)
Browse files Browse the repository at this point in the history
  • Loading branch information
jmgrady authored Jan 18, 2023
1 parent 1ed2ff9 commit 33080a5
Show file tree
Hide file tree
Showing 8 changed files with 131 additions and 34 deletions.
37 changes: 32 additions & 5 deletions .github/workflows/backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,17 @@ jobs:
- name: Harden Runner
uses: step-security/harden-runner@ebacdc22ef6c2cfb85ee5ded8f2e640f4c776dd5 # v2.0.0
with:
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs

disable-sudo: true
egress-policy: block
allowed-endpoints: >
aka.ms:443
api.nuget.org:443
codecov.io:443
dc.services.visualstudio.com:443
dotnetcli.azureedge.net:443
github.com:443
storage.googleapis.com:443
uploader.codecov.io:443
- uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # v3.2.0
- name: Setup dotnet
uses: actions/setup-dotnet@607fce577a46308457984d59e4954e075820f10a # v3.0.3
Expand Down Expand Up @@ -59,7 +68,15 @@ jobs:
- name: Harden Runner
uses: step-security/harden-runner@ebacdc22ef6c2cfb85ee5ded8f2e640f4c776dd5 # v2.0.0
with:
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs
disable-sudo: true
egress-policy: block
allowed-endpoints: >
aka.ms:443
api.github.com:443
api.nuget.org:443
dc.services.visualstudio.com:443
dotnetcli.azureedge.net:443
github.com:443
- name: Checkout repository
uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # v3.2.0
Expand Down Expand Up @@ -93,8 +110,18 @@ jobs:
- name: Harden Runner
uses: step-security/harden-runner@ebacdc22ef6c2cfb85ee5ded8f2e640f4c776dd5 # v2.0.0
with:
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs

disable-sudo: true
egress-policy: block
allowed-endpoints: >
api.nuget.org:443
dc.services.visualstudio.com:443
deb.debian.org:80
github.com:443
mcr.microsoft.com:443
eastus.data.mcr.microsoft.com:443
centralus.data.mcr.microsoft.com:443
westcentralus.data.mcr.microsoft.com:443
westus.data.mcr.microsoft.com:443
- uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # v3.2.0
with:
fetch-depth: 0
Expand Down
27 changes: 22 additions & 5 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,23 @@ jobs:
strategy:
fail-fast: false
matrix:
language: ["csharp", "javascript", "python"]
language:
- name: csharp
endpoints: >
api.github.com:443
api.nuget.org:443
dc.services.visualstudio.com:443
github.com:443
- name: javascript
endpoints: >
api.github.com:443
github.com:443
- name: python
endpoints: >
api.github.com:443
files.pythonhosted.org:443
github.com:443
pypi.org:443
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
# Use only 'java' to analyze code written in Java, Kotlin or both
# Use only 'javascript' to analyze code written in JavaScript, TypeScript or both
Expand All @@ -45,16 +61,17 @@ jobs:
- name: Harden Runner
uses: step-security/harden-runner@ebacdc22ef6c2cfb85ee5ded8f2e640f4c776dd5 # v2.0.0
with:
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs

disable-sudo: true
egress-policy: block
allowed-endpoints: ${{ matrix.language.endpoints }}
- name: Checkout repository
uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # v3.2.0

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@959cbb7472c4d4ad70cdfe6f4976053fe48ab394 # v2.1.37
with:
languages: ${{ matrix.language }}
languages: ${{ matrix.language.name }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
Expand All @@ -80,4 +97,4 @@ jobs:
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@959cbb7472c4d4ad70cdfe6f4976053fe48ab394 # v2.1.37
with:
category: "/language:${{matrix.language}}"
category: "/language:${{matrix.language.name}}"
40 changes: 31 additions & 9 deletions .github/workflows/deploy_qa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,38 @@ jobs:
strategy:
matrix:
component: [frontend, backend, maintenance, database]

runs-on: ubuntu-latest
outputs:
image_tag: ${{ steps.build_combine.outputs.image_tag }}
steps:
- name: Harden Runner
uses: step-security/harden-runner@ebacdc22ef6c2cfb85ee5ded8f2e640f4c776dd5 # v2.0.0
with:
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs

disable-sudo: true
egress-policy: block
allowed-endpoints: >
${{ secrets.AWS_ACCOUNT }}.dkr.ecr.${{ secrets.AWS_DEFAULT_REGION }}.amazonaws.com
api.ecr.${{ secrets.AWS_DEFAULT_REGION }}.amazonaws.com:443
auth.docker.io:443
files.pythonhosted.org:443
github.com:443
production.cloudflare.docker.com:443
pypi.org:443
registry-1.docker.io:443
registry.npmjs.org:443
sts.${{ secrets.AWS_DEFAULT_REGION }}.amazonaws.com:443
api.nuget.org:443
dc.services.visualstudio.com:443
deb.debian.org:80
mcr.microsoft.com:443
eastus.data.mcr.microsoft.com:443
centralus.data.mcr.microsoft.com:443
westcentralus.data.mcr.microsoft.com:443
westus.data.mcr.microsoft.com:443
archive.ubuntu.com:80
security.ubuntu.com:80
api.github.com:443
- uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # v3.2.0
with:
fetch-depth: 0
Expand All @@ -40,8 +63,12 @@ jobs:
- name: Harden Runner
uses: step-security/harden-runner@ebacdc22ef6c2cfb85ee5ded8f2e640f4c776dd5 # v2.0.0
with:
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs

disable-sudo: true
egress-policy: block
allowed-endpoints: >
api.ecr.${{ secrets.AWS_DEFAULT_REGION }}.amazonaws.com:443
github.com:443
sts.${{ secrets.AWS_DEFAULT_REGION }}.amazonaws.com:443
- uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # v3.2.0
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@97271860067ec931c45b8d104fbf0d15954ab85c # v1-node16
Expand All @@ -55,11 +82,6 @@ jobs:
needs: build
runs-on: [self-hosted, thecombine]
steps:
- name: Harden Runner
uses: step-security/harden-runner@ebacdc22ef6c2cfb85ee5ded8f2e640f4c776dd5 # v2.0.0
with:
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs

- uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # v3.2.0
- name: Deploy The Combine Update
uses: ./.github/actions/combine-deploy-update
Expand Down
5 changes: 0 additions & 5 deletions .github/workflows/deploy_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,6 @@ jobs:
needs: build
runs-on: [self-hosted, thecombine]
steps:
- name: Harden Runner
uses: step-security/harden-runner@ebacdc22ef6c2cfb85ee5ded8f2e640f4c776dd5 # v2.0.0
with:
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs

- uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # v3.2.0
with:
fetch-depth: 0
Expand Down
22 changes: 18 additions & 4 deletions .github/workflows/frontend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,14 @@ jobs:
- name: Harden Runner
uses: step-security/harden-runner@ebacdc22ef6c2cfb85ee5ded8f2e640f4c776dd5 # v2.0.0
with:
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs

disable-sudo: true
egress-policy: block
allowed-endpoints: >
codecov.io:443
github.com:443
registry.npmjs.org:443
storage.googleapis.com:443
uploader.codecov.io:443
- uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # v3.2.0
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 # v3.5.1
Expand Down Expand Up @@ -52,8 +58,16 @@ jobs:
- name: Harden Runner
uses: step-security/harden-runner@ebacdc22ef6c2cfb85ee5ded8f2e640f4c776dd5 # v2.0.0
with:
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs

disable-sudo: true
egress-policy: block
allowed-endpoints: >
auth.docker.io:443
files.pythonhosted.org:443
github.com:443
production.cloudflare.docker.com:443
pypi.org:443
registry-1.docker.io:443
registry.npmjs.org:443
- uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # v3.2.0
with:
fetch-depth: 0
Expand Down
13 changes: 11 additions & 2 deletions .github/workflows/maintenance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,17 @@ jobs:
- name: Harden Runner
uses: step-security/harden-runner@ebacdc22ef6c2cfb85ee5ded8f2e640f4c776dd5 # v2.0.0
with:
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs

disable-sudo: true
egress-policy: block
allowed-endpoints: >
archive.ubuntu.com:80
auth.docker.io:443
files.pythonhosted.org:443
github.com:443
production.cloudflare.docker.com:443
pypi.org:443
registry-1.docker.io:443
security.ubuntu.com:80
- uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # v3.2.0
with:
fetch-depth: 0
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,12 @@ jobs:
- name: Harden Runner
uses: step-security/harden-runner@ebacdc22ef6c2cfb85ee5ded8f2e640f4c776dd5 # v2.0.0
with:
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs

disable-sudo: true
egress-policy: block
allowed-endpoints: >
files.pythonhosted.org:443
github.com:443
pypi.org:443
- uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # v3.2.0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@5ccb29d8773c3f3f653e1705f474dfaa8a06a912 # v4.4.0
Expand Down
13 changes: 11 additions & 2 deletions .github/workflows/scorecards.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,17 @@ jobs:
- name: Harden Runner
uses: step-security/harden-runner@ebacdc22ef6c2cfb85ee5ded8f2e640f4c776dd5 # v2.0.0
with:
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs

disable-sudo: true
egress-policy: block
allowed-endpoints: >
api.github.com:443
api.osv.dev:443
bestpractices.coreinfrastructure.org:443
fulcio.sigstore.dev:443
github.com:443
index.docker.io:443
mcr.microsoft.com:443
sigstore-tuf-root.storage.googleapis.com:443
- name: "Checkout code"
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0
with:
Expand Down

0 comments on commit 33080a5

Please sign in to comment.