forked from ProfLear/plotlyMol
-
Notifications
You must be signed in to change notification settings - Fork 1
83 lines (69 loc) · 2.12 KB
/
security.yml
File metadata and controls
83 lines (69 loc) · 2.12 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
80
81
82
83
name: Security
on:
push:
branches: [main, develop]
pull_request:
branches: [main, develop]
schedule:
# Run weekly on Monday at 08:00 UTC to catch newly disclosed CVEs
- cron: "0 8 * * 1"
defaults:
run:
shell: bash -el {0}
jobs:
dependency-audit:
name: Dependency Audit (pip-audit)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up conda environment
uses: conda-incubator/setup-miniconda@v3
with:
python-version: "3.11"
environment-file: environment.yml
activate-environment: plotlymol
auto-activate: false
miniforge-version: latest
conda-solver: libmamba
- name: Audit dependencies for known CVEs
run: pip-audit --format=markdown --output=pip-audit-report.md || true
- name: Upload audit report
if: always()
uses: actions/upload-artifact@v4
with:
name: pip-audit-report
path: pip-audit-report.md
retention-days: 30
- name: Fail on known vulnerabilities
# --strict would also fail on conda packages not found on PyPI (e.g. rdkit); omit it
run: pip-audit
codeql:
name: CodeQL Static Analysis
runs-on: ubuntu-latest
permissions:
security-events: write
actions: read
contents: read
steps:
- uses: actions/checkout@v4
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: python
# Detects: injection, path-traversal, XSS, unsafe deserialization, etc.
queries: security-and-quality
- name: Set up conda environment
uses: conda-incubator/setup-miniconda@v3
with:
python-version: "3.11"
environment-file: environment.yml
activate-environment: plotlymol
auto-activate: false
miniforge-version: latest
conda-solver: libmamba
- name: Install package
run: pip install -e .
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:python"