Skip to content

Commit d69708f

Browse files
chore(stepsecurity): apply security best practices (#20)
## Summary This pull request has been generated by [StepSecurity](https://app.stepsecurity.io/github/circlefin/actions/dashboard) as part of your enterprise subscription to ensure compliance with recommended security best practices. Please review and merge the pull request to apply these security enhancements. ## Security Fixes ### Harden Runner Harden-Runner is an open-source security agent for the GitHub-hosted runner to prevent software supply chain attacks. It prevents exfiltration of credentials, detects tampering of source code during build, and enables running jobs without sudo access. - [GitHub Security Guide](https://docs.github.com/en/actions/security-for-github-actions/security-guides/security-hardening-for-github-actions) - [The Open Source Security Foundation (OpenSSF) Security Guide](https://github.com/ossf/scorecard/blob/main/docs/checks.md#dangerous-workflow) ### Least Privileged GitHub Actions Token Permissions The GITHUB_TOKEN is an automatically generated secret to make authenticated calls to the GitHub API. GitHub recommends setting minimum token permissions for the GITHUB_TOKEN. - [GitHub Security Guide](https://docs.github.com/en/actions/security-guides/automatic-token-authentication#using-the-github_token-in-a-workflow) - [The Open Source Security Foundation (OpenSSF) Security Guide](https://github.com/ossf/scorecard/blob/main/docs/checks.md#token-permissions) ### Pinned Dependencies Pinning GitHub Actions to specific versions or commit SHAs ensures that your workflows remain consistent and secure. Unpinned actions can lead to unexpected changes or vulnerabilities caused by upstream updates. - [GitHub Security Guide](https://docs.github.com/en/actions/security-for-github-actions/security-guides/security-hardening-for-github-actions#using-third-party-actions) - [The Open Source Security Foundation (OpenSSF) Security Guide](https://github.com/ossf/scorecard/blob/main/docs/checks.md#pinned-dependencies) ## Feedback For bug reports, feature requests, and general feedback; please create an issue in [step-security/secure-repo](https://github.com/step-security/secure-repo) or contact us via [our website](https://www.stepsecurity.io/). --------- Signed-off-by: StepSecurity Bot <bot@stepsecurity.io> Co-authored-by: stepsecurity-app[bot] <188008098+stepsecurity-app[bot]@users.noreply.github.com> Co-authored-by: ali-kafel <ali.kafel@circle.com>
1 parent 40867b8 commit d69708f

2 files changed

Lines changed: 19 additions & 7 deletions

File tree

.github/workflows/release-test.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,20 @@ name: Test
22

33
on:
44
workflow_call:
5-
65
jobs:
76
test:
8-
runs-on: ubuntu-latest
7+
runs-on: ubuntu-latest
98
steps:
10-
- uses: actions/checkout@v4
9+
- name: Harden the runner
10+
uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2
11+
with:
12+
egress-policy: block
13+
policy: global-allowed-endpoints-policy
14+
15+
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
1116

1217
- name: Set up Python 3.10
13-
uses: actions/setup-python@v5
18+
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
1419
with:
1520
python-version: '3.10'
1621

.github/workflows/release.yml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ permissions:
1111
pull-requests: write
1212
actions: write
1313
issues: write
14+
id-token: write
1415

1516
jobs:
1617
test:
@@ -36,10 +37,16 @@ jobs:
3637
needs: release-please
3738
runs-on: ubuntu-latest
3839
steps:
39-
- uses: actions/checkout@v4
40+
- name: Harden the runner
41+
uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2
42+
with:
43+
egress-policy: block
44+
policy: global-allowed-endpoints-policy
45+
46+
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
4047

4148
- name: Set up Python
42-
uses: actions/setup-python@v5
49+
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
4350
with:
4451
python-version: '3.10'
4552

@@ -61,7 +68,7 @@ jobs:
6168
run: twine upload dist/*
6269

6370
- name: Upload build artifacts for release
64-
uses: actions/upload-artifact@v4
71+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
6572
with:
6673
name: python-package-distributions
6774
path: dist/

0 commit comments

Comments
 (0)