-
Notifications
You must be signed in to change notification settings - Fork 3
44 lines (36 loc) · 1.11 KB
/
Copy pathsecurity.yml
File metadata and controls
44 lines (36 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
name: Security
on:
push:
branches: [master]
pull_request:
branches: [master]
schedule:
- cron: "0 6 * * 1"
jobs:
scan:
name: Dependency and SAST scan
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install security tooling
run: |
python -m pip install --upgrade pip
python -m pip install pip-audit bandit
- name: Export runtime dependencies from pyproject.toml
run: |
python - <<'PY'
import tomllib
from pathlib import Path
deps = tomllib.loads(Path("pyproject.toml").read_text())["project"]["dependencies"]
Path("requirements.audit.txt").write_text("\n".join(deps) + "\n")
print("requirements.audit.txt generated")
PY
- name: Audit Python dependencies (pip-audit)
run: |
python -m pip_audit -r requirements.audit.txt
- name: Static security scan (bandit)
run: |
python -m bandit -q -r docking -x tests,packaging -lll -iii