Skip to content

Commit

Permalink
[StepSecurity] ci: Harden GitHub Actions (#1034)
Browse files Browse the repository at this point in the history
* [StepSecurity] ci: Harden GitHub Actions in ci.yml

* [StepSecurity] ci: Harden GitHub Actions in codeql-analysis.yml
  • Loading branch information
step-security-bot committed Sep 29, 2022
1 parent 8415c4a commit 0095cd8
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ jobs:
- "pypy-3.8"

steps:
- name: Harden Runner
uses: step-security/harden-runner@v1
with:
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs

- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
Expand All @@ -60,6 +65,11 @@ jobs:
needs: tests

steps:
- name: Harden Runner
uses: step-security/harden-runner@v1
with:
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs

- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
Expand Down Expand Up @@ -90,6 +100,11 @@ jobs:
name: Build docs & run doctests
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@v1
with:
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs

- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
Expand All @@ -103,6 +118,11 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Harden Runner
uses: step-security/harden-runner@v1
with:
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs

- uses: actions/checkout@v3
- uses: hynek/build-and-inspect-python-package@v1

Expand All @@ -114,6 +134,11 @@ jobs:
os: [ubuntu-latest, windows-latest]

steps:
- name: Harden Runner
uses: step-security/harden-runner@v1
with:
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs

- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
Expand All @@ -133,6 +158,11 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Harden Runner
uses: step-security/harden-runner@v1
with:
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs

- name: Decide whether the needed jobs succeeded or failed
uses: re-actors/alls-green@release/v1
with:
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ on:
schedule:
- cron: '30 22 * * 4'

permissions: # added using https://github.com/step-security/secure-workflows
contents: read

jobs:
analyze:
name: Analyze
Expand All @@ -24,6 +27,11 @@ jobs:
language: [ 'python' ]

steps:
- name: Harden Runner
uses: step-security/harden-runner@v1
with:
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs

- name: Checkout repository
uses: actions/checkout@v3

Expand Down

0 comments on commit 0095cd8

Please sign in to comment.