-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
### What kind of change does this PR introduce? * This updates audited workflows to restrict the URLs that they can pull from * `gitleaks` has been added as a pre-commit hook (prevents accidental committing of secrets) * Some permissions adjustments have been made ### Does this PR introduce a breaking change? No. ### Other information: https://github.com/gitleaks/gitleaks https://securityscorecards.dev/viewer/?uri=github.com%2FOuranosinc%2Fxclim https://github.com/step-security/harden-runner
- Loading branch information
Showing
16 changed files
with
245 additions
and
134 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,12 +12,19 @@ permissions: # added using https://github.com/step-security/secure-repo | |
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
permissions: | ||
actions: write | ||
contents: write | ||
pull-requests: write | ||
steps: | ||
- name: Harden Runner | ||
uses: step-security/harden-runner@eb238b55efaa70779f274895e782ed17c84f2895 # v2.6.1 | ||
with: | ||
egress-policy: audit | ||
disable-sudo: true | ||
egress-policy: block | ||
allowed-endpoints: > | ||
api.github.com:443 | ||
github.com:443 | ||
- name: Checkout | ||
uses: actions/[email protected] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,14 @@ jobs: | |
add-to-project: | ||
name: Add Issue to xclim Project | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
repository-projects: write | ||
steps: | ||
- name: Harden Runner | ||
uses: step-security/harden-runner@eb238b55efaa70779f274895e782ed17c84f2895 # v2.6.1 | ||
with: | ||
egress-policy: audit | ||
- uses: actions/[email protected] | ||
with: | ||
project-url: https://github.com/orgs/Ouranosinc/projects/6 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,7 +15,12 @@ jobs: | |
- name: Harden Runner | ||
uses: step-security/harden-runner@eb238b55efaa70779f274895e782ed17c84f2895 # v2.6.1 | ||
with: | ||
egress-policy: audit | ||
disable-sudo: true | ||
egress-policy: block | ||
allowed-endpoints: > | ||
api.github.com:443 | ||
github.com:443 | ||
objects.githubusercontent.com:443 | ||
- name: Check out code | ||
uses: actions/[email protected] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,14 @@ jobs: | |
dependency-review: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Harden Runner | ||
uses: step-security/harden-runner@eb238b55efaa70779f274895e782ed17c84f2895 # v2.6.1 | ||
with: | ||
disable-sudo: true | ||
egress-policy: block | ||
allowed-endpoints: > | ||
api.github.com:443 | ||
github.com:443 | ||
- name: 'Checkout Repository' | ||
uses: actions/[email protected] | ||
- name: 'Dependency Review' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,14 +12,24 @@ on: [pull_request_target] | |
# See: https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request_target | ||
|
||
permissions: | ||
checks: write | ||
contents: read | ||
pull-requests: write | ||
|
||
jobs: | ||
label: | ||
name: Label | ||
runs-on: ubuntu-latest | ||
permissions: | ||
checks: write | ||
contents: read | ||
pull-requests: write | ||
steps: | ||
- uses: actions/[email protected] | ||
with: | ||
repo-token: "${{ secrets.GITHUB_TOKEN }}" | ||
- name: Harden Runner | ||
uses: step-security/harden-runner@eb238b55efaa70779f274895e782ed17c84f2895 # v2.6.1 | ||
with: | ||
disable-sudo: true | ||
egress-policy: block | ||
allowed-endpoints: > | ||
api.github.com:443 | ||
- uses: actions/[email protected] | ||
with: | ||
repo-token: "${{ secrets.GITHUB_TOKEN }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,19 +10,25 @@ on: | |
- review_requested | ||
|
||
permissions: | ||
checks: write | ||
contents: read | ||
pull-requests: write | ||
|
||
jobs: | ||
label_approved: | ||
name: Label on Approval | ||
runs-on: ubuntu-latest | ||
if: | | ||
(!contains(github.event.pull_request.labels.*.name, 'approved')) && | ||
(github.event.review.state == 'approved') && | ||
(github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name) | ||
runs-on: ubuntu-latest | ||
permissions: | ||
checks: write | ||
contents: read | ||
pull-requests: write | ||
steps: | ||
- name: Harden Runner | ||
uses: step-security/harden-runner@eb238b55efaa70779f274895e782ed17c84f2895 # v2.6.1 | ||
with: | ||
egress-policy: audit | ||
- name: Label Approved | ||
uses: actions/[email protected] | ||
with: | ||
|
@@ -36,11 +42,19 @@ jobs: | |
comment_approved: | ||
name: Comment Concerning Approved Tag | ||
runs-on: ubuntu-latest | ||
if: | | ||
(github.event_name == 'pull_request_target') && | ||
(github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name) | ||
runs-on: ubuntu-latest | ||
permissions: | ||
checks: write | ||
contents: read | ||
pull-requests: write | ||
steps: | ||
- name: Harden Runner | ||
uses: step-security/harden-runner@eb238b55efaa70779f274895e782ed17c84f2895 # v2.6.1 | ||
with: | ||
egress-policy: audit | ||
- name: Find comment | ||
uses: peter-evans/[email protected] | ||
id: fc | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -76,7 +76,13 @@ jobs: | |
- name: Harden Runner | ||
uses: step-security/harden-runner@eb238b55efaa70779f274895e782ed17c84f2895 # v2.6.1 | ||
with: | ||
egress-policy: audit | ||
disable-sudo: true | ||
egress-policy: block | ||
allowed-endpoints: > | ||
files.pythonhosted.org:443 | ||
github.com:443 | ||
pypi.org:443 | ||
raw.githubusercontent.com:443 | ||
- uses: actions/[email protected] | ||
- name: Set up Python${{ matrix.python-version }} | ||
uses: actions/[email protected] | ||
|
@@ -124,7 +130,18 @@ jobs: | |
- name: Harden Runner | ||
uses: step-security/harden-runner@eb238b55efaa70779f274895e782ed17c84f2895 # v2.6.1 | ||
with: | ||
egress-policy: audit | ||
egress-policy: block | ||
allowed-endpoints: > | ||
azure.archive.ubuntu.com:80 | ||
coveralls.io:443 | ||
esm.ubuntu.com:443 | ||
files.pythonhosted.org:443 | ||
github.com:443 | ||
motd.ubuntu.com:443 | ||
packages.microsoft.com:443 | ||
ppa.launchpadcontent.net:443 | ||
pypi.org:443 | ||
raw.githubusercontent.com:443 | ||
- uses: actions/[email protected] | ||
- name: Install Eigen3 | ||
if: contains(matrix.tox-env, 'sbck') | ||
|
@@ -167,7 +184,16 @@ jobs: | |
- name: Harden Runner | ||
uses: step-security/harden-runner@eb238b55efaa70779f274895e782ed17c84f2895 # v2.6.1 | ||
with: | ||
egress-policy: audit | ||
disable-sudo: true | ||
egress-policy: block | ||
allowed-endpoints: > | ||
api.github.com:443 | ||
coveralls.io:443 | ||
files.pythonhosted.org:443 | ||
github.com:443 | ||
objects.githubusercontent.com:443 | ||
pypi.org:443 | ||
raw.githubusercontent.com:443 | ||
- uses: actions/[email protected] | ||
- name: Setup Conda (Micromamba) with Python${{ matrix.python-version }} | ||
uses: mamba-org/[email protected] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,6 +20,14 @@ jobs: | |
contents: read | ||
pull-requests: write | ||
steps: | ||
- name: Harden Runner | ||
uses: step-security/harden-runner@eb238b55efaa70779f274895e782ed17c84f2895 # v2.6.1 | ||
with: | ||
disable-sudo: true | ||
egress-policy: block | ||
allowed-endpoints: > | ||
api.github.com:443 | ||
github.com:443 | ||
- uses: actions/[email protected] | ||
- name: Find xclim-testdata Tag and CI Testing Branch | ||
run: | | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,7 +42,15 @@ jobs: | |
- name: Harden Runner | ||
uses: step-security/harden-runner@eb238b55efaa70779f274895e782ed17c84f2895 # v2.6.1 | ||
with: | ||
egress-policy: audit | ||
disable-sudo: true | ||
egress-policy: block | ||
allowed-endpoints: > | ||
api.github.com:443 | ||
files.pythonhosted.org:443 | ||
github.com:443 | ||
objects.githubusercontent.com:443 | ||
pypi.org:443 | ||
raw.githubusercontent.com:443 | ||
- uses: actions/[email protected] | ||
with: | ||
fetch-depth: 0 # Fetch all history for all branches and tags. | ||
|
Oops, something went wrong.