Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[actions] add step security runner #2659

Merged
merged 1 commit into from
Dec 10, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .github/workflows/latest-npm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ jobs:
outputs:
latest: ${{ steps.set-matrix.outputs.requireds }}
steps:
- name: Harden Runner
uses: step-security/harden-runner@v1
with:
allowed-endpoints:
iojs.org:443
nodejs.org:443
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.github/workflows/toc.yml

- uses: ljharb/actions/node/matrix@main
id: set-matrix
with:
Expand Down Expand Up @@ -39,6 +45,14 @@ jobs:
- node-version: "0.10"

steps:
- name: Harden Runner
uses: step-security/harden-runner@v1
with:
allowed-endpoints:
github.com:443
iojs.org:443
nodejs.org:443
registry.npmjs.org:443
- uses: actions/checkout@v2
- uses: ljharb/actions/node/install@main
name: 'nvm install-latest-npm'
Expand All @@ -55,4 +69,8 @@ jobs:
needs: [nodes]
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@v1
with:
egress-policy: block
- run: 'echo tests completed'
24 changes: 24 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ jobs:
contents: read
runs-on: ubuntu-latest
steps:
- uses: step-security/harden-runner@v1
with:
allowed-endpoints:
github.com:443
nodejs.org:443
registry.npmjs.org:443
- uses: actions/checkout@v2
- uses: ljharb/actions/node/install@main
name: 'nvm install ${{ matrix.node-version }} && npm install'
Expand All @@ -20,6 +26,14 @@ jobs:
contents: read
runs-on: ubuntu-latest
steps:
- uses: step-security/harden-runner@v1
with:
allowed-endpoints:
ghcr.io:443
github.com:443
pkg-containers.githubusercontent.com:443
nodejs.org:443
registry.npmjs.org:443
- uses: actions/checkout@v2
- uses: ljharb/actions/node/install@main
name: 'nvm install ${{ matrix.node-version }} && npm install'
Expand All @@ -32,6 +46,12 @@ jobs:
contents: read
runs-on: ubuntu-latest
steps:
- uses: step-security/harden-runner@v1
with:
allowed-endpoints:
github.com:443
nodejs.org:443
registry.npmjs.org:443
- uses: actions/checkout@v2
- uses: ljharb/actions/node/install@main
name: 'nvm install ${{ matrix.node-version }} && npm install'
Expand All @@ -44,6 +64,10 @@ jobs:
contents: read
runs-on: ubuntu-latest
steps:
- uses: step-security/harden-runner@v1
with:
allowed-endpoints:
github.com:443
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for example, the actions/checkout action both always should be able to access github.com, and also, is the only part of the action that needs to

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I understand what you are saying, and that would be ideal. I wrote about this in the comment above.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

**

- uses: actions/checkout@v2
- name: check tests filenames
run: ./rename_test.sh --check
6 changes: 6 additions & 0 deletions .github/workflows/rebase.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Harden Runner
uses: step-security/harden-runner@v1
with:
allowed-endpoints:
api.github.com:443
github.com:443
- uses: actions/checkout@v2
- uses: ljharb/rebase@master
env:
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ jobs:
contents: read
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@v1
with:
allowed-endpoints:
github.com:443
registry.npmjs.org:443
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/require-allow-edits.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Harden Runner
uses: step-security/harden-runner@v1
with:
allowed-endpoints:
api.github.com:443
- uses: ljharb/require-allow-edits@main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
13 changes: 13 additions & 0 deletions .github/workflows/shellcheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,18 @@ jobs:
file: nvm-exec # only runs in bash

steps:
- name: Harden Runner
uses: step-security/harden-runner@v1
with:
allowed-endpoints:
ghcr.io:443
github.com:443
pkg-containers.githubusercontent.com:443
- uses: actions/checkout@v2
- name: Install shellcheck
run: brew install shellcheck
env:
HOMEBREW_NO_ANALYTICS: 1
- run: "shellcheck --version"
- name: Run shellcheck on ${{ matrix.file }}
run: shellcheck -s ${{ matrix.shell }} ${{ matrix.file }}
Expand All @@ -39,4 +48,8 @@ jobs:
needs: [shellcheck_matrix]
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@v1
with:
egress-policy: block
- run: 'echo tests completed'
6 changes: 6 additions & 0 deletions .github/workflows/toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Harden Runner
uses: step-security/harden-runner@v1
with:
allowed-endpoints:
github.com:443
registry.npmjs.org:443
- uses: actions/checkout@v2
with:
# https://github.com/actions/checkout/issues/217#issue-599945005
Expand Down