Repository navigation
79 lines (66 loc) · 2.23 KB
/
Copy pathsecurity-ci.yml
File metadata and controls
79 lines (66 loc) · 2.23 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
67
68
69
70
71
72
73
74
75
76
77
78
79
name: Security CI
on:
push:
branches: [main, master, v5.0.1-bate]
pull_request:
branches: [main, master]
schedule:
- cron: '17 3 * * 1'
concurrency:
group: security-ci-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
python-security:
name: Python dependency and source audit
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- name: Set up Python 3.12
uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7
with:
python-version: '3.12'
cache: pip
cache-dependency-path: backend_api_python/requirements-dev.txt
- name: Install audit tools
working-directory: ./backend_api_python
run: python -m pip install --disable-pip-version-check "bandit[toml]>=1.8.6,<2" "pip-audit>=2.9,<3"
- name: Audit locked dependencies
working-directory: ./backend_api_python
run: pip-audit -r requirements.lock --no-deps --disable-pip --progress-spinner off
- name: Scan high-severity source findings
working-directory: ./backend_api_python
run: bandit -q -r app -x app/data -lll -ii
secret-scan:
name: Secret scan
runs-on: ubuntu-latest
steps:
- name: Checkout full history
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
fetch-depth: 0
- name: Run Gitleaks
run: |
docker run --rm \
--user "$(id -u):$(id -g)" \
--volume "$GITHUB_WORKSPACE:/repo:ro" \
ghcr.io/gitleaks/gitleaks:v8.30.1 \
git --redact --verbose /repo
codeql:
name: CodeQL
runs-on: ubuntu-latest
permissions:
contents: read
packages: read
security-events: write
steps:
- name: Checkout code
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- name: Initialize CodeQL
uses: github/codeql-action/init@9b3254085494b55a0f7c4c2b3d2d52cc712ce370 # v4.39.1
with:
languages: python
- name: Analyze
uses: github/codeql-action/analyze@9b3254085494b55a0f7c4c2b3d2d52cc712ce370 # v4.39.1