-
Notifications
You must be signed in to change notification settings - Fork 4
69 lines (63 loc) · 2 KB
/
Copy pathsecurity.yml
File metadata and controls
69 lines (63 loc) · 2 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
name: Continuous Security Verification
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
schedule:
- cron: '37 3 * * 0' # Run weekly on Sundays to catch newly published CVEs
permissions:
contents: read
jobs:
static-analysis:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v4
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v5
with:
python-version: "3.14"
cache: 'pip'
- run: python -m pip install --upgrade pip
- run: pip install ruff bandit mypy pip-audit
# Fast checks
- run: ruff check .
- run: bandit -c pyproject.toml -r mailgun
- run: mypy --strict mailgun
semgrep:
runs-on: ubuntu-latest
container:
# Official Semgrep Docker image
image: semgrep/semgrep
# Skip any PR created by dependabot to avoid permission issues (Per Semgrep docs)
if: (github.actor != 'dependabot[bot]')
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v4
- name: Run Semgrep CE scan
run: >-
semgrep scan
--config "p/python"
--config "p/owasp-top-ten"
--config "p/supply-chain"
--config "p/command-injection"
--config "p/insecure-transport"
--error
pip-audit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v4
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v5
with: { python-version: "3.14" }
- run: python -m pip install --upgrade pip
- run: pip install pip-audit
- run: pip-audit --strict
osv-scan:
permissions:
actions: read
security-events: write # For Security Tab
contents: read
uses: "google/osv-scanner-action/.github/workflows/osv-scanner-reusable.yml@v2.5.1"
with:
# Explicit root scanning
scan-args: |-
--recursive
./