Skip to content

Commit c2cd15d

Browse files
authored
[StepSecurity] Apply security best practices (#257)
## Summary This pull request is created by [StepSecurity](https://app.stepsecurity.io/securerepo) at the request of @Nick2bad4u. Please merge the Pull Request to incorporate the requested changes. Please tag @Nick2bad4u on your message if you have any questions related to the PR. ## Security Fixes ### Pinned Dependencies GitHub Action tags and Docker tags are mutable. This poses a security risk. GitHub's Security Hardening guide recommends pinning actions to full length commit. - [GitHub Security Guide](https://docs.github.com/en/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) ### Harden Runner [Harden-Runner](https://github.com/step-security/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. See how popular open-source projects use Harden-Runner [here](https://docs.stepsecurity.io/whos-using-harden-runner). <details> <summary>Harden runner usage</summary> You can find link to view insights and policy recommendation in the build log <img src="https://github.com/step-security/harden-runner/blob/main/images/buildlog1.png?raw=true" width="60%" height="60%"> Please refer to [documentation](https://docs.stepsecurity.io/harden-runner) to find more details. </details> ### Maintain Code Quality with Pre-Commit Pre-commit is a framework for managing and maintaining multi-language pre-commit hooks. Hooks can be any scripts, code, or binaries that run at any stage of the git workflow. Pre-commit hooks are useful for enforcing code quality, code formatting, and detecting security vulnerabilities. - [Official Pre-commit documentation](https://pre-commit.com/) - [Getting Started guide](https://pre-commit.com/#getting-started) ## Feedback For bug reports, feature requests, and general feedback; please email [email protected]. To create such PRs, please visit https://app.stepsecurity.io/securerepo. Signed-off-by: StepSecurity Bot <[email protected]>
2 parents d43cccb + b49ad03 commit c2cd15d

1 file changed

Lines changed: 15 additions & 5 deletions

File tree

.github/workflows/main.yml

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,22 @@ jobs:
2626
build:
2727
runs-on: ubuntu-latest
2828
steps:
29+
- name: Harden the runner (Audit all outbound calls)
30+
uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
31+
with:
32+
egress-policy: audit
33+
2934
- name: Checkout
30-
uses: actions/checkout@v4
35+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
3136
- name: Setup Pages
32-
uses: actions/configure-pages@v5
37+
uses: actions/configure-pages@983d7736d9b0ae728b81ab479565c72886d7745b # v5.0.0
3338
- name: Build with Jekyll
34-
uses: actions/jekyll-build-pages@v1
39+
uses: actions/jekyll-build-pages@44a6e6beabd48582f863aeeb6cb2151cc1716697 # v1.0.13
3540
with:
3641
source: ./
3742
destination: ./_site
3843
- name: Upload artifact
39-
uses: actions/upload-pages-artifact@v3
44+
uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa # v3.0.1
4045

4146
# Deployment job
4247
deploy:
@@ -46,6 +51,11 @@ jobs:
4651
runs-on: ubuntu-latest
4752
needs: build
4853
steps:
54+
- name: Harden the runner (Audit all outbound calls)
55+
uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
56+
with:
57+
egress-policy: audit
58+
4959
- name: Deploy to GitHub Pages
5060
id: deployment
51-
uses: actions/deploy-pages@v4
61+
uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4.0.5

0 commit comments

Comments
 (0)