Skip to content

Commit dd5c930

Browse files
authored
ci: add security scanning workflow (#6)
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 61add56 commit dd5c930

File tree

1 file changed

+54
-0
lines changed

1 file changed

+54
-0
lines changed

.github/workflows/security.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
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+
# Install only the dependencies, not the local package
30+
pip install PyYAML requests
31+
32+
- name: Run pip-audit
33+
run: pip-audit --strict --progress-spinner off
34+
35+
codeql:
36+
runs-on: ubuntu-latest
37+
name: CodeQL Analysis
38+
permissions:
39+
security-events: write
40+
actions: read
41+
contents: read
42+
43+
steps:
44+
- uses: actions/checkout@v4
45+
46+
- name: Initialize CodeQL
47+
uses: github/codeql-action/init@v3
48+
with:
49+
languages: python
50+
51+
- name: Perform CodeQL Analysis
52+
uses: github/codeql-action/analyze@v3
53+
with:
54+
category: "/language:python"

0 commit comments

Comments
 (0)