Skip to content

Commit 65e803c

Browse files
authored
Merge pull request #199 from AliYmn/158
Add Zizmor security workflow to enhance project security posture
2 parents 7c4f574 + bb784c8 commit 65e803c

File tree

6 files changed

+82
-0
lines changed

6 files changed

+82
-0
lines changed

.github/workflows/lint.yml

+2
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ jobs:
4747
TEST_DJANGO_VERSION: ${{ matrix.django-version }}
4848
steps:
4949
- uses: actions/checkout@v4
50+
with:
51+
persist-credentials: false
5052
- name: Set up Python ${{ matrix.python-version }}
5153
uses: actions/setup-python@v5
5254
id: sp

.github/workflows/release.yml

+2
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ jobs:
4040
RELEASE_VERSION: ${{ steps.set-package.outputs.release_version }}
4141
steps:
4242
- uses: actions/checkout@v4
43+
with:
44+
persist-credentials: false
4345
- name: Set up Python
4446
uses: actions/setup-python@v5
4547
with:

.github/workflows/test.yml

+24
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ jobs:
6060
TEST_DJANGO_VERSION: ${{ matrix.django-version }}
6161
steps:
6262
- uses: actions/checkout@v4
63+
with:
64+
persist-credentials: false
6365
- name: Set up Python ${{ matrix.python-version }}
6466
uses: actions/setup-python@v5
6567
id: sp
@@ -123,6 +125,8 @@ jobs:
123125
TEST_DJANGO_VERSION: ${{ matrix.django-version }}
124126
steps:
125127
- uses: actions/checkout@v4
128+
with:
129+
persist-credentials: false
126130
- name: Set up Python ${{ matrix.python-version }}
127131
uses: actions/setup-python@v5
128132
id: sp
@@ -180,6 +184,8 @@ jobs:
180184

181185
steps:
182186
- uses: actions/checkout@v4
187+
with:
188+
persist-credentials: false
183189
- name: Set up Python ${{ matrix.python-version }}
184190
uses: actions/setup-python@v5
185191
id: sp
@@ -257,6 +263,8 @@ jobs:
257263

258264
steps:
259265
- uses: actions/checkout@v4
266+
with:
267+
persist-credentials: false
260268
- name: Set up Python ${{ matrix.python-version }}
261269
uses: actions/setup-python@v5
262270
id: sp
@@ -314,6 +322,8 @@ jobs:
314322

315323
steps:
316324
- uses: actions/checkout@v4
325+
with:
326+
persist-credentials: false
317327
- name: Set up Python ${{ matrix.python-version }}
318328
uses: actions/setup-python@v5
319329
id: sp
@@ -374,6 +384,8 @@ jobs:
374384

375385
steps:
376386
- uses: actions/checkout@v4
387+
with:
388+
persist-credentials: false
377389
- name: Set up Python ${{ matrix.python-version }}
378390
uses: actions/setup-python@v5
379391
id: sp
@@ -437,6 +449,8 @@ jobs:
437449

438450
steps:
439451
- uses: actions/checkout@v4
452+
with:
453+
persist-credentials: false
440454
- name: Set up Python ${{ matrix.python-version }}
441455
uses: actions/setup-python@v5
442456
id: sp
@@ -506,6 +520,8 @@ jobs:
506520

507521
steps:
508522
- uses: actions/checkout@v4
523+
with:
524+
persist-credentials: false
509525
- name: Set up Python ${{ matrix.python-version }}
510526
uses: actions/setup-python@v5
511527
id: sp
@@ -565,6 +581,8 @@ jobs:
565581

566582
steps:
567583
- uses: actions/checkout@v4
584+
with:
585+
persist-credentials: false
568586
- name: Set up Python ${{ matrix.python-version }}
569587
uses: actions/setup-python@v5
570588
id: sp
@@ -632,6 +650,8 @@ jobs:
632650

633651
steps:
634652
- uses: actions/checkout@v4
653+
with:
654+
persist-credentials: false
635655
- name: Set up Python ${{ matrix.python-version }}
636656
uses: actions/setup-python@v5
637657
id: sp
@@ -700,6 +720,8 @@ jobs:
700720

701721
steps:
702722
- uses: actions/checkout@v4
723+
with:
724+
persist-credentials: false
703725
- name: Set up Python ${{ matrix.python-version }}
704726
uses: actions/setup-python@v5
705727
id: sp
@@ -771,6 +793,8 @@ jobs:
771793
with:
772794
detached: true
773795
- uses: actions/checkout@v4
796+
with:
797+
persist-credentials: false
774798
- uses: actions/setup-python@v5
775799
id: sp
776800
- name: Install uv

.github/workflows/update_coc.yml

+2
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ jobs:
2121
steps:
2222
- name: Checkout repository
2323
uses: actions/checkout@v4
24+
with:
25+
persist-credentials: false
2426

2527
- name: Fetch CODE_OF_CONDUCT.md from django-commons
2628
run: |

.github/workflows/zizmor.yml

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Zizmor
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
schedule:
9+
# Run weekly
10+
- cron: '0 0 * * 0'
11+
workflow_dispatch:
12+
13+
permissions:
14+
contents: read
15+
16+
jobs:
17+
zizmor-analysis:
18+
name: Run Zizmor
19+
runs-on: ubuntu-latest
20+
permissions:
21+
contents: read
22+
security-events: write
23+
24+
steps:
25+
- name: Checkout repository
26+
uses: actions/checkout@v4
27+
with:
28+
persist-credentials: false
29+
30+
- name: Set up Rust
31+
uses: actions-rust-lang/setup-rust-toolchain@v1
32+
33+
- name: Install Zizmor
34+
run: |
35+
cargo install zizmor
36+
37+
- name: Run Zizmor analysis
38+
run: |
39+
zizmor --format sarif .github/workflows/ > results.sarif
40+
41+
- name: Upload analysis results
42+
uses: actions/upload-artifact@v4
43+
with:
44+
name: zizmor-results
45+
path: results.sarif
46+
retention-days: 7
47+
48+
- name: Upload to code-scanning
49+
uses: github/codeql-action/upload-sarif@v3
50+
with:
51+
sarif_file: results.sarif

SECURITY.md

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Security Policy
22

33
[![CodeQL](https://github.com/django-commons/django-typer/actions/workflows/github-code-scanning/codeql/badge.svg?branch=main)](https://github.com/django-commons/django-typer/actions/workflows/github-code-scanning/codeql?query=branch:main)
4+
[![Zizmor](https://github.com/django-commons/django-typer/actions/workflows/zizmor.yml/badge.svg?branch=main)](https://woodruffw.github.io/zizmor)
45
[![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/django-commons/django-typer/badge)](https://securityscorecards.dev/viewer/?uri=github.com/django-commons/django-typer)
56

67
## Supported Versions

0 commit comments

Comments
 (0)