Repository navigation
66 lines (55 loc) · 1.99 KB
/
Copy pathsecurity.yml
File metadata and controls
66 lines (55 loc) · 1.99 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
name: Security
on:
push:
branches: [main]
pull_request:
branches: [main]
schedule:
# Weekly: every Monday at 06:00 UTC.
- cron: '0 6 * * 1'
workflow_dispatch:
permissions:
contents: read
concurrency:
group: security-${{ github.ref }}
cancel-in-progress: true
jobs:
pip-audit:
name: pip-audit (dependencies)
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- name: Set up Python
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
with:
python-version: '3.12'
cache: 'pip'
cache-dependency-path: pyproject.toml
- name: Install package and pip-audit
run: |
pip install --require-hashes -r requirements-ci.txt
pip install -e . --no-deps
- name: Run pip-audit
# --skip-editable skips the locally-installed editable attestix itself.
# No --strict: under --strict pip-audit fails on any un-auditable dep,
# and an editable self-install can never be audited (it errors even with
# --skip-editable). Without --strict, pip-audit still exits non-zero on
# any real dependency vulnerability — which is the behaviour we enforce.
run: pip-audit --progress-spinner off --skip-editable
bandit:
name: bandit (source code SAST)
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- name: Set up Python
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
with:
python-version: '3.12'
cache: 'pip'
cache-dependency-path: pyproject.toml
- name: Install bandit
run: pip install --require-hashes -r requirements-ci.txt
- name: Run bandit (medium+ severity, medium+ confidence)
run: bandit -r attestix -c pyproject.toml -ll -ii