Skip to content

Commit d3d1278

Browse files
[StepSecurity] Apply security best practices (#167)
Signed-off-by: StepSecurity Bot <[email protected]>
1 parent f0db0ae commit d3d1278

15 files changed

+207
-28
lines changed

.github/workflows/NewYearUpdateCopyright.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ jobs:
2323
permissions:
2424
issues: write
2525
steps:
26+
- name: Harden the runner (Audit all outbound calls)
27+
uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
28+
with:
29+
egress-policy: audit
30+
2631
- name: Happy New Year!
2732
run: |
2833
new_issue_url=$(gh issue create \

.github/workflows/ci.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,15 @@ jobs:
1919
env:
2020
JEKYLL_VERSION: ${{ matrix.jekyll }}
2121
steps:
22+
- name: Harden the runner (Audit all outbound calls)
23+
uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
24+
with:
25+
egress-policy: audit
26+
2227
- name: Checkout Repository
23-
uses: actions/[email protected]
28+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2429
- name: Set Up Ruby 3.3.6
25-
uses: ruby/[email protected]
30+
uses: ruby/setup-ruby@bfefad842bb982ff05b233bcbc1571d97a87e69f # v1.206.0
2631
with:
2732
ruby-version: 3.3.6
2833
bundler-cache: true

.github/workflows/codeql.yml

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
# For most projects, this workflow file will not need changing; you simply need
2+
# to commit it to your repository.
3+
#
4+
# You may wish to alter this file to override the set of languages analyzed,
5+
# or to provide custom queries or build logic.
6+
#
7+
# ******** NOTE ********
8+
# We have attempted to detect the languages in your repository. Please check
9+
# the `language` matrix defined below to confirm you have the correct set of
10+
# supported CodeQL languages.
11+
#
12+
name: "CodeQL"
13+
14+
on:
15+
push:
16+
branches: ["main"]
17+
pull_request:
18+
# The branches below must be a subset of the branches above
19+
branches: ["main"]
20+
schedule:
21+
- cron: "0 0 * * 1"
22+
23+
permissions:
24+
contents: read
25+
26+
jobs:
27+
analyze:
28+
name: Analyze
29+
runs-on: ubuntu-latest
30+
permissions:
31+
actions: read
32+
contents: read
33+
security-events: write
34+
35+
strategy:
36+
fail-fast: false
37+
matrix:
38+
language: ["ruby"]
39+
# CodeQL supports [ $supported-codeql-languages ]
40+
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
41+
42+
steps:
43+
- name: Harden the runner (Audit all outbound calls)
44+
uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
45+
with:
46+
egress-policy: audit
47+
48+
- name: Checkout repository
49+
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
50+
51+
# Initializes the CodeQL tools for scanning.
52+
- name: Initialize CodeQL
53+
uses: github/codeql-action/init@3599b3baa15b485a2e49ef411a7a4bb2452e7f93 # v3.30.5
54+
with:
55+
languages: ${{ matrix.language }}
56+
# If you wish to specify custom queries, you can do so here or in a config file.
57+
# By default, queries listed here will override any specified in a config file.
58+
# Prefix the list here with "+" to use these queries and those in the config file.
59+
60+
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
61+
# If this step fails, then you should remove it and run the build manually (see below)
62+
- name: Autobuild
63+
uses: github/codeql-action/autobuild@3599b3baa15b485a2e49ef411a7a4bb2452e7f93 # v3.30.5
64+
65+
# ℹ️ Command-line programs to run using the OS shell.
66+
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
67+
68+
# If the Autobuild fails above, remove it and uncomment the following three lines.
69+
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
70+
71+
# - run: |
72+
# echo "Run, Build Application using script"
73+
# ./location_of_script_within_repo/buildscript.sh
74+
75+
- name: Perform CodeQL Analysis
76+
uses: github/codeql-action/analyze@3599b3baa15b485a2e49ef411a7a4bb2452e7f93 # v3.30.5
77+
with:
78+
category: "/language:${{matrix.language}}"

.github/workflows/dependency-review.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,12 @@ jobs:
1616
dependency-review:
1717
runs-on: ubuntu-latest
1818
steps:
19+
- name: Harden the runner (Audit all outbound calls)
20+
uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
21+
with:
22+
egress-policy: audit
23+
1924
- name: 'Checkout Repository'
20-
uses: actions/[email protected]
25+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2126
- name: 'Dependency Review'
22-
uses: actions/[email protected]
27+
uses: actions/dependency-review-action@3b139cfc5fae8b618d3eae3675e383bb1769c019 # v4.5.0

.github/workflows/docker-update.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ env:
2020
REGISTRY: ghcr.io
2121
IMAGE_NAME: ${{ github.repository }}
2222

23+
permissions:
24+
contents: read
25+
2326
jobs:
2427
push_to_registry:
2528
name: Push Docker image to GitHub Packages
@@ -28,8 +31,13 @@ jobs:
2831
packages: write
2932
contents: read
3033
steps:
34+
- name: Harden the runner (Audit all outbound calls)
35+
uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
36+
with:
37+
egress-policy: audit
38+
3139
- name: Check out the repo
32-
uses: actions/checkout@v2
40+
uses: actions/checkout@ee0669bd1cc54295c223e0bb666b733df41de1c5 # v2.7.0
3341

3442
- name: Log in to the Container registry
3543
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9

.github/workflows/jekyll.yml

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,17 +31,22 @@ jobs:
3131
build:
3232
runs-on: ubuntu-22.04
3333
steps:
34+
- name: Harden the runner (Audit all outbound calls)
35+
uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
36+
with:
37+
egress-policy: audit
38+
3439
- name: Checkout
35-
uses: actions/[email protected]
40+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
3641
- name: Setup Ruby
37-
uses: ruby/[email protected]
42+
uses: ruby/setup-ruby@28c4deda893d5a96a6b2d958c5b47fc18d65c9d3 # v1.213.0
3843
with:
3944
ruby-version: '3.3.6' # Not needed with a .ruby-version file
4045
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
4146
cache-version: 4 # Increment this number if you need to re-download cached gems
4247
- name: Setup Pages
4348
id: pages
44-
uses: actions/[email protected]
49+
uses: actions/configure-pages@983d7736d9b0ae728b81ab479565c72886d7745b # v5.0.0
4550
- name: Build with Jekyll
4651
# Outputs to the './_site' directory by default
4752
run: bundle exec jekyll build --trace --incremental --baseurl "${{ steps.pages.outputs.base_path }}"
@@ -51,7 +56,7 @@ jobs:
5156
LOG_LEVEL: debug
5257
- name: Upload artifact
5358
# Automatically uploads an artifact from the './_site' directory by default
54-
uses: actions/[email protected]
59+
uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa # v3.0.1
5560

5661
# Deployment job
5762
deploy:
@@ -61,6 +66,11 @@ jobs:
6166
runs-on: ubuntu-latest
6267
needs: build
6368
steps:
69+
- name: Harden the runner (Audit all outbound calls)
70+
uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
71+
with:
72+
egress-policy: audit
73+
6474
- name: Deploy to GitHub Pages
6575
id: deployment
66-
uses: actions/[email protected]
76+
uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4.0.5

.github/workflows/main.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,12 @@ jobs:
1818
runs-on: ubuntu-latest
1919
steps:
2020
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
21-
- uses: actions/checkout@v2
21+
- name: Harden the runner (Audit all outbound calls)
22+
uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
23+
with:
24+
egress-policy: audit
25+
26+
- uses: actions/checkout@ee0669bd1cc54295c223e0bb666b733df41de1c5 # v2.7.0
2227

2328
- name: Test directory contents
2429
run: 'ls -al'
@@ -27,7 +32,7 @@ jobs:
2732
uses: ./actions
2833

2934
- name: Upload a Build Artifact
30-
uses: actions/[email protected]
35+
uses: actions/upload-artifact@ee69f02b3dfdecd58bb31b4d133da38ba6fe3700 # v2.2.3
3136
with:
3237
# Artifact name
3338
name: pandoc PDF # optional, default is artifact

.github/workflows/pandoc.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,21 @@ on:
88
branches:
99
- main
1010

11+
permissions:
12+
contents: read
13+
1114
jobs:
1215
build:
1316
runs-on: ubuntu-latest
1417

1518
steps:
19+
- name: Harden the runner (Audit all outbound calls)
20+
uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
21+
with:
22+
egress-policy: audit
23+
1624
- name: Checkout repository
17-
uses: actions/[email protected]
25+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
1826

1927
- name: Set up Pandoc
2028
run: |
@@ -65,7 +73,7 @@ jobs:
6573
git commit -m "[docs](doc): adding output to GitHub"
6674
6775
- name: Upload output
68-
uses: actions/[email protected]
76+
uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4.5.0
6977
with:
7078
name: output
7179
path: output

.github/workflows/permission_advisor.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,12 @@ jobs:
2121
advisor:
2222
runs-on: ubuntu-latest
2323
steps:
24-
- uses: GitHubSecurityLab/actions-permissions/[email protected]
24+
- name: Harden the runner (Audit all outbound calls)
25+
uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
26+
with:
27+
egress-policy: audit
28+
29+
- uses: GitHubSecurityLab/actions-permissions/advisor@babd69bc8d78e6cdece903dfdcfb72d4e1a4f00d # v1.0.2-beta5
2530
with:
2631
name: ${{ inputs.name }}
2732
count: ${{ inputs.count }}

.github/workflows/readme-checker.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,15 @@ jobs:
88
lint:
99
runs-on: ubuntu-latest
1010
steps:
11+
- name: Harden the runner (Audit all outbound calls)
12+
uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
13+
with:
14+
egress-policy: audit
15+
1116
- name: Checkout
12-
uses: actions/[email protected]
17+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
1318
- name: Checking markdown
14-
uses: DavidAnson/[email protected]
19+
uses: DavidAnson/markdownlint-cli2-action@05f32210e84442804257b2a6f20b273450ec8265 # v19.1.0
1520
with:
1621
globs: |
1722
*.md

0 commit comments

Comments
 (0)