Skip to content

Commit 698cf9a

Browse files
authored
Merge pull request #43 from step-security-bot/chore/GHA-221908-stepsecurity-remediation
[StepSecurity] Apply security best practices
2 parents a9ec7f1 + 5440dd7 commit 698cf9a

File tree

7 files changed

+71
-11
lines changed

7 files changed

+71
-11
lines changed

.github/dependabot.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,13 @@ updates:
2121
- "github/*"
2222
schedule:
2323
interval: "weekly"
24+
25+
- package-ecosystem: pip
26+
directory: /papers/P2988
27+
schedule:
28+
interval: daily
29+
30+
- package-ecosystem: pip
31+
directory: /
32+
schedule:
33+
interval: daily

.github/workflows/ci.yml

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,14 @@ on:
1111
permissions:
1212
contents: read
1313

14+
permissions:
15+
contents: read
16+
1417
jobs:
1518
build:
19+
permissions:
20+
checks: write # for coverallsapp/github-action to create new checks
21+
contents: read # for actions/checkout to fetch code
1622
name: ${{ matrix.config.name }}
1723
runs-on: ubuntu-24.04
1824
container:
@@ -31,7 +37,12 @@ jobs:
3137
- {name: "Ubuntu GCC 13", tag: "gcc:13", toolchain: "gcc-13", cmake_args: "-G \"Ninja Multi-Config\" -DCMAKE_CONFIGURATION_TYPES=\"RelWithDebInfo;Asan\" -DCMAKE_PREFIX_PATH=\"./infra/cmake\" "}
3238
- {name: "Ubuntu GCC 12", tag: "gcc:12", toolchain: "gcc-12", cmake_args: "-G \"Ninja Multi-Config\" -DCMAKE_CONFIGURATION_TYPES=\"RelWithDebInfo;Asan\" -DCMAKE_PREFIX_PATH=\"./infra/cmake\" "}
3339
steps:
34-
- uses: actions/checkout@v6
40+
- name: Harden the runner (Audit all outbound calls)
41+
uses: step-security/harden-runner@20cf305ff2072d973412fa9b1e3a4f227bda3c76 # v2.14.0
42+
with:
43+
egress-policy: audit
44+
45+
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
3546
with:
3647
submodules: 'true'
3748
# If Clang 17, install a newer version of libc++ and libc++abi.
@@ -104,7 +115,7 @@ jobs:
104115
cmake --build .build --config Gcov --target process_coverage -- -k 0
105116
- name: Coveralls
106117
if: matrix.config.coverage
107-
uses: coverallsapp/github-action@main
118+
uses: coverallsapp/github-action@ba6dae83310bbd6d33ff77092650dc40bd444a2a # main
108119
with:
109120
file: .build/coverage.json
110121
github-token: ${{ secrets.GITHUB_TOKEN }}
@@ -118,7 +129,12 @@ jobs:
118129
issues: write
119130
steps:
120131
# See https://github.com/cli/cli/issues/5075
121-
- uses: actions/checkout@v6
132+
- name: Harden the runner (Audit all outbound calls)
133+
uses: step-security/harden-runner@20cf305ff2072d973412fa9b1e3a4f227bda3c76 # v2.14.0
134+
with:
135+
egress-policy: audit
136+
137+
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
122138
- name: Create issue
123139
run: |
124140
issue_num=$(gh issue list -s open -S "[SCHEDULED-BUILD] Build & Test failure" -L 1 --json number | jq 'if length == 0 then -1 else .[0].number end')

.github/workflows/codeql.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,11 @@ jobs:
5858
# If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how
5959
# your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages
6060
steps:
61+
- name: Harden the runner (Audit all outbound calls)
62+
uses: step-security/harden-runner@20cf305ff2072d973412fa9b1e3a4f227bda3c76 # v2.14.0
63+
with:
64+
egress-policy: audit
65+
6166
- name: Checkout repository
6267
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
6368
with:

.github/workflows/doxygen-gh-pages.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,21 @@ on:
66
- main
77
- doxify
88

9+
permissions:
10+
contents: read
11+
912
jobs:
1013
deploy:
1114
runs-on: ubuntu-latest
1215
permissions:
1316
contents: write
1417
steps:
15-
- uses: DenverCoder1/[email protected]
18+
- name: Harden the runner (Audit all outbound calls)
19+
uses: step-security/harden-runner@20cf305ff2072d973412fa9b1e3a4f227bda3c76 # v2.14.0
20+
with:
21+
egress-policy: audit
22+
23+
- uses: DenverCoder1/doxygen-github-pages-action@a30f9538f8ef1305aeceb563018f452c7a62d200 # v2.0.0
1624
with:
1725
github_token: ${{ secrets.GITHUB_TOKEN }}
1826
branch: gh-pages

.github/workflows/ossf-scorecard-analysis.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@ jobs:
2121
id-token: write
2222

2323
steps:
24+
- name: Harden the runner (Audit all outbound calls)
25+
uses: step-security/harden-runner@20cf305ff2072d973412fa9b1e3a4f227bda3c76 # v2.14.0
26+
with:
27+
egress-policy: audit
28+
2429
- name: "Checkout code"
2530
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
2631
with:

.github/workflows/pre-commit-update.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ on:
77
schedule:
88
- cron: "0 16 * * 0"
99

10+
permissions:
11+
contents: read
12+
1013
jobs:
1114
auto-update-pre-commit:
1215
permissions:

.github/workflows/pre-commit.yml

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ on:
55
pull_request:
66
push:
77

8+
permissions:
9+
contents: read
10+
811
jobs:
912
pre-commit-push:
1013
name: Pre-Commit check on Push
@@ -15,19 +18,24 @@ jobs:
1518
contents: read
1619

1720
steps:
21+
- name: Harden the runner (Audit all outbound calls)
22+
uses: step-security/harden-runner@20cf305ff2072d973412fa9b1e3a4f227bda3c76 # v2.14.0
23+
with:
24+
egress-policy: audit
25+
1826
- name: Checkout repository
19-
uses: actions/checkout@v6
27+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
2028

2129
- name: Set up Python
22-
uses: actions/setup-python@v6
30+
uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0
2331
with:
2432
python-version: 3.13
2533

2634
# We wish to run pre-commit on all files instead of the changes
2735
# only made in the push commit.
2836
#
2937
# So linting error persists when there's formatting problem.
30-
- uses: pre-commit/[email protected]
38+
- uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd # v3.0.1
3139

3240
pre-commit-pr:
3341
name: Pre-Commit check on PR
@@ -41,8 +49,13 @@ jobs:
4149
pull-requests: write
4250

4351
steps:
52+
- name: Harden the runner (Audit all outbound calls)
53+
uses: step-security/harden-runner@20cf305ff2072d973412fa9b1e3a4f227bda3c76 # v2.14.0
54+
with:
55+
egress-policy: audit
56+
4457
- name: Checkout repository
45-
uses: actions/checkout@v6
58+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
4659

4760
# pull_request_target checkout the base of the repo
4861
# We need to checkout the actual pr to lint the changes.
@@ -52,16 +65,16 @@ jobs:
5265
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5366

5467
- name: Set up Python
55-
uses: actions/setup-python@v6
68+
uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0
5669
with:
5770
python-version: 3.13
5871

5972
# we only lint on the changed file in PR.
6073
- name: Get Changed Files
6174
id: changed-files
62-
uses: step-security/changed-files@v46
75+
uses: step-security/changed-files@95b56dadb92a30ca9036f16423fd3c088a71ee94 # v46.0.5
6376

64-
- uses: pre-commit/[email protected]
77+
- uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd # v3.0.1
6578
id: run-pre-commit
6679
with:
6780
extra_args: --files ${{ steps.changed-files.outputs.all_changed_files }}

0 commit comments

Comments
 (0)