Skip to content

Commit b730288

Browse files
authored
PYTHON-4969 Add GitHub Actions scanner (#191)
* PYTHON-4969 Add GitHub Actions scanner * address findings
1 parent 05d9914 commit b730288

File tree

5 files changed

+41
-0
lines changed

5 files changed

+41
-0
lines changed

.github/workflows/codeql.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ jobs:
4242
uses: actions/checkout@v4
4343
with:
4444
ref: ${{ inputs.ref }}
45+
persist-credentials: false
4546
- name: Set up Python
4647
uses: actions/setup-python@v5
4748
with:

.github/workflows/dist.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ jobs:
2222
- uses: actions/checkout@v4
2323
with:
2424
ref: ${{ inputs.ref }}
25+
persist-credentials: false
2526
- name: Set up Python
2627
uses: actions/setup-python@v5
2728
with:

.github/workflows/linters.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ jobs:
1313
runs-on: ubuntu-latest
1414
steps:
1515
- uses: actions/checkout@v4
16+
with:
17+
persist-credentials: false
1618
- uses: actions/setup-python@v5
1719
with:
1820
python-version: '3.10'
@@ -29,6 +31,8 @@ jobs:
2931
runs-on: ubuntu-latest
3032
steps:
3133
- uses: actions/checkout@v4
34+
with:
35+
persist-credentials: false
3236
- uses: actions/setup-python@v5
3337
with:
3438
cache: 'pip'

.github/workflows/test-python.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ jobs:
2323
steps:
2424
- name: Checkout django-mongodb
2525
uses: actions/checkout@v4
26+
with:
27+
persist-credentials: false
2628
- name: install the django-mongodb backend
2729
run: |
2830
pip3 install --upgrade pip
@@ -33,6 +35,7 @@ jobs:
3335
repository: 'mongodb-forks/django'
3436
ref: 'mongodb-5.0.x'
3537
path: 'django_repo'
38+
persist-credentials: false
3639
- name: Install system packages for Django's Python test dependencies
3740
run: |
3841
sudo apt-get update

.github/workflows/zizmor.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: GitHub Actions Security Analysis with zizmor
2+
3+
on:
4+
push:
5+
branches: ["main"]
6+
pull_request:
7+
branches: ["**"]
8+
9+
jobs:
10+
zizmor:
11+
name: zizmor latest via Cargo
12+
runs-on: ubuntu-latest
13+
permissions:
14+
security-events: write
15+
steps:
16+
- name: Checkout repository
17+
uses: actions/checkout@v4
18+
with:
19+
persist-credentials: false
20+
- name: Setup Rust
21+
uses: actions-rust-lang/setup-rust-toolchain@v1
22+
- name: Get zizmor
23+
run: cargo install zizmor
24+
- name: Run zizmor
25+
run: zizmor --format sarif . > results.sarif
26+
env:
27+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
28+
- name: Upload SARIF file
29+
uses: github/codeql-action/upload-sarif@v3
30+
with:
31+
sarif_file: results.sarif
32+
category: zizmor

0 commit comments

Comments
 (0)