Skip to content

Commit ebca121

Browse files
committed
ci: add security scanning workflow
Add automated security checks: - pip-audit for known vulnerabilities in dependencies - CodeQL static analysis for Python code Runs on: - Every push and PR to main - Weekly schedule (Monday 9:00 UTC) for catching new CVEs
1 parent 14bfc51 commit ebca121

File tree

1 file changed

+53
-0
lines changed

1 file changed

+53
-0
lines changed

.github/workflows/security.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Security
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
schedule:
9+
# Run weekly on Monday at 9:00 UTC
10+
- cron: "0 9 * * 1"
11+
12+
jobs:
13+
dependency-audit:
14+
runs-on: ubuntu-latest
15+
name: Dependency Audit
16+
17+
steps:
18+
- uses: actions/checkout@v4
19+
20+
- name: Set up Python
21+
uses: actions/setup-python@v5
22+
with:
23+
python-version: "3.11"
24+
25+
- name: Install dependencies
26+
run: |
27+
python -m pip install --upgrade pip
28+
pip install pip-audit
29+
pip install .
30+
31+
- name: Run pip-audit
32+
run: pip-audit --strict --progress-spinner off
33+
34+
codeql:
35+
runs-on: ubuntu-latest
36+
name: CodeQL Analysis
37+
permissions:
38+
security-events: write
39+
actions: read
40+
contents: read
41+
42+
steps:
43+
- uses: actions/checkout@v4
44+
45+
- name: Initialize CodeQL
46+
uses: github/codeql-action/init@v3
47+
with:
48+
languages: python
49+
50+
- name: Perform CodeQL Analysis
51+
uses: github/codeql-action/analyze@v3
52+
with:
53+
category: "/language:python"

0 commit comments

Comments
 (0)