Skip to content

Commit f26d59b

Browse files
authored
Merge pull request #375 from IntelPython/backport-zizmor-ci-hardening
ci: harden GitHub Actions workflows and add zizmor scan
2 parents d87b5c5 + ac4b034 commit f26d59b

10 files changed

Lines changed: 67 additions & 7 deletions

‎.github/dependabot.yml‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ updates:
55
schedule:
66
interval: "weekly"
77
day: "saturday"
8+
cooldown:
9+
default-days: 7
810
rebase-strategy: "disabled"
911
labels: ["autoupdate"]
1012
groups:
@@ -16,6 +18,8 @@ updates:
1618
schedule:
1719
interval: "weekly"
1820
day: "saturday"
21+
cooldown:
22+
default-days: 7
1923
rebase-strategy: "disabled"
2024
labels: ["autoupdate"]
2125
groups:

‎.github/workflows/build-with-clang.yml‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ on:
55
push:
66
branches: [master]
77

8-
permissions: read-all
8+
permissions:
9+
contents: read
910

1011
jobs:
1112
build-with-clang:
@@ -51,6 +52,7 @@ jobs:
5152
- name: Checkout repo
5253
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
5354
with:
55+
persist-credentials: false
5456
fetch-depth: 0
5557

5658
- name: Install mkl_fft dependencies

‎.github/workflows/build-with-standard-clang.yml‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ on:
55
push:
66
branches: [master]
77

8-
permissions: read-all
8+
permissions:
9+
contents: read
910

1011
jobs:
1112
build-with-standard-clang:
@@ -43,6 +44,7 @@ jobs:
4344
- name: Checkout repo
4445
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
4546
with:
47+
persist-credentials: false
4648
fetch-depth: 0
4749

4850
- name: Install mkl_fft dependencies

‎.github/workflows/build_pip.yml‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ on:
66
- master
77
pull_request:
88

9-
permissions: read-all
9+
permissions:
10+
contents: read
1011

1112
jobs:
1213
build:
@@ -23,6 +24,7 @@ jobs:
2324
steps:
2425
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
2526
with:
27+
persist-credentials: false
2628
fetch-depth: 0
2729

2830
- uses: conda-incubator/setup-miniconda@8ee1f361103df19b6f8c8655fd3967a8ecb162d5 # v4.0.1

‎.github/workflows/conda-package-cf.yml‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ on:
66
- master
77
pull_request:
88

9-
permissions: read-all
9+
permissions:
10+
contents: read
1011

1112
env:
1213
PACKAGE_NAME: mkl_fft
@@ -40,6 +41,7 @@ jobs:
4041

4142
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
4243
with:
44+
persist-credentials: false
4345
fetch-depth: 0
4446

4547
- name: Set pkgs_dirs
@@ -180,6 +182,7 @@ jobs:
180182

181183
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
182184
with:
185+
persist-credentials: false
183186
fetch-depth: 0
184187

185188
- uses: conda-incubator/setup-miniconda@8ee1f361103df19b6f8c8655fd3967a8ecb162d5 # v4.0.1

‎.github/workflows/conda-package.yml‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ on:
66
- master
77
pull_request:
88

9-
permissions: read-all
9+
permissions:
10+
contents: read
1011

1112
env:
1213
PACKAGE_NAME: mkl_fft
@@ -40,6 +41,7 @@ jobs:
4041

4142
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
4243
with:
44+
persist-credentials: false
4345
fetch-depth: 0
4446

4547
- name: Set pkgs_dirs
@@ -223,6 +225,7 @@ jobs:
223225

224226
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
225227
with:
228+
persist-credentials: false
226229
fetch-depth: 0
227230

228231
- uses: conda-incubator/setup-miniconda@8ee1f361103df19b6f8c8655fd3967a8ecb162d5 # v4.0.1

‎.github/workflows/coverity.yml‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ jobs:
2424
steps:
2525
- name: Checkout repo
2626
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
27+
with:
28+
persist-credentials: false
2729

2830
- name: Setup Python
2931
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0

‎.github/workflows/openssf-scorecard.yml‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ on:
1616
branches: [ "master" ]
1717

1818
# Declare default permissions as read only.
19-
permissions: read-all
19+
permissions:
20+
contents: read
2021

2122
jobs:
2223
analysis:

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ on:
55
push:
66
branches: [master]
77

8-
permissions: read-all
8+
permissions:
9+
contents: read
910

1011
jobs:
1112
pre-commit:
@@ -15,6 +16,7 @@ jobs:
1516
- name: Checkout repo
1617
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
1718
with:
19+
persist-credentials: false
1820
# use commit hash to make "no-commit-to-branch" check passing
1921
ref: ${{ github.sha }}
2022

‎.github/workflows/zizmor.yml‎

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Security scan of GitHub Actions workflows (zizmor)
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
9+
permissions: {}
10+
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
13+
cancel-in-progress: true
14+
15+
jobs:
16+
zizmor:
17+
name: Scan GitHub Actions workflows
18+
19+
runs-on: ubuntu-latest
20+
timeout-minutes: 10
21+
22+
permissions:
23+
contents: read # needed to clone the repo
24+
25+
steps:
26+
- name: Checkout mkl_fft repo
27+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
28+
with:
29+
persist-credentials: false
30+
31+
- name: Run zizmor
32+
uses: zizmorcore/zizmor-action@70fb788f84895a7701f5643d103d587e460b5c99 # v0.6.3
33+
with:
34+
# Low/informational template-injection notes come from internally-defined
35+
# values (no external input), so they are reported as annotations but do not gate CI
36+
min-severity: medium
37+
advanced-security: false
38+
annotations: true
39+
inputs: .github/

0 commit comments

Comments
 (0)