Commit f3ab4e1
authored
chore(security): harden CI, Dockerfile, and bump deps (#22)
CI (push.yaml):
- Add top-level permissions: {} and per-job least-privilege
(contents: read, packages: write for ghcr push)
- SHA-pin all actions with version comments:
- actions/checkout v2 -> v4.3.1
- docker/setup-buildx-action v1 -> v3.12.0
- docker/login-action v1 -> v3.7.0
- docker/build-push-action v2 -> v6.19.2
- Add persist-credentials: false to checkout
Dockerfile:
- Bump python:3.8-slim-buster -> python:3.12-slim (Python 3.8 is EOL;
Debian buster is also EOL)
- SHA-pin the base image
- Add --no-cache-dir to pip install (smaller image)
- Run as non-root user (uid 1001)
requirements.txt — bump all deps (3.5-4 year old pins, several with CVEs):
- apscheduler 3.7.0 -> 3.11.2
- requests 2.25.0 -> 2.34.2 (fixes CVE-2024-35195 among others)
- python-decouple 3.3 -> 3.8
- prometheus-client 0.9.0 -> 0.25.0
- pygithub 1.51 -> 2.9.1
github-traffic.py:
- Switch to PyGithub 2.x auth API (Github(auth=Auth.Token(token)))
to clear DeprecationWarning
- De-duplicate redundant imports1 parent 908408d commit f3ab4e1
4 files changed
Lines changed: 26 additions & 18 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
| 5 | + | |
4 | 6 | | |
5 | 7 | | |
6 | 8 | | |
| |||
10 | 12 | | |
11 | 13 | | |
12 | 14 | | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
13 | 18 | | |
14 | | - | |
15 | | - | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
16 | 23 | | |
17 | 24 | | |
18 | | - | |
| 25 | + | |
19 | 26 | | |
20 | 27 | | |
21 | | - | |
| 28 | + | |
22 | 29 | | |
23 | 30 | | |
24 | 31 | | |
25 | 32 | | |
26 | 33 | | |
27 | 34 | | |
28 | | - | |
| 35 | + | |
29 | 36 | | |
30 | 37 | | |
31 | 38 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
5 | 4 | | |
6 | 5 | | |
7 | | - | |
8 | 6 | | |
9 | 7 | | |
10 | 8 | | |
| |||
14 | 12 | | |
15 | 13 | | |
16 | 14 | | |
17 | | - | |
| 15 | + | |
18 | 16 | | |
19 | 17 | | |
20 | 18 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
3 | | - | |
4 | | - | |
5 | | - | |
6 | | - | |
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
0 commit comments