Commit b4cf804
authored
fix: [CI-21185]: Upgrade Go to 1.25.7 and run as non-root user (#51)
Security fixes:
1. Upgrade Go from 1.25 to 1.25.7 to fix critical CVEs:
- CVE-2025-68121 (critical, CVSS 10.0) - crypto/tls session resumption issue
- CVE-2025-61726 (high, CVSS 7.5) - net/url query parameter limit
- CVE-2025-61730 (medium, CVSS 5.3) - crypto/tls handshake boundary issue
2. Run container as non-root user (uid:gid 65534:65534):
- Added USER directive to run as nobody:nobody
- Copied /etc/passwd for user resolution
- Prevents privilege escalation and improves container security
Changes:
- Updated base image: golang:1.25-alpine3.21 → golang:1.25.7
- Changed from apk (alpine) to apt-get (debian) for Go 1.25.7 image
- Added non-root user configuration in final scratch image
Tested:
- Binary builds successfully
- --version flag works: returns build version
- Non-root user (65534:65534) enforced
- Permission restrictions validated1 parent 38a826f commit b4cf804
1 file changed
Lines changed: 10 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
7 | 9 | | |
8 | 10 | | |
9 | 11 | | |
| |||
44 | 46 | | |
45 | 47 | | |
46 | 48 | | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
47 | 52 | | |
48 | 53 | | |
49 | 54 | | |
50 | 55 | | |
51 | 56 | | |
52 | 57 | | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
53 | 61 | | |
54 | 62 | | |
55 | 63 | | |
| |||
0 commit comments