|
| 1 | +# Docker Image Security Scans |
| 2 | + |
| 3 | +This document tracks Trivy security scan results for Docker images used in the deployer templates. |
| 4 | + |
| 5 | +## Purpose |
| 6 | + |
| 7 | +Regular security scanning ensures that Docker images used in production deployments are free from known vulnerabilities. This documentation provides: |
| 8 | + |
| 9 | +- Historical record of security scans |
| 10 | +- Baseline for vulnerability tracking |
| 11 | +- Evidence of security due diligence |
| 12 | +- Reference for incident response |
| 13 | + |
| 14 | +## Automated Scanning |
| 15 | + |
| 16 | +For ongoing security monitoring, see [Issue #250: Implement periodic security vulnerability scanning workflow](https://github.com/torrust/torrust-tracker-deployer/issues/250). |
| 17 | + |
| 18 | +The automated workflow will: |
| 19 | + |
| 20 | +- Run Trivy scans on CI/CD pipeline |
| 21 | +- Generate security reports |
| 22 | +- Alert on new vulnerabilities |
| 23 | +- Track vulnerability trends over time |
| 24 | + |
| 25 | +## Latest Scan: December 29, 2025 |
| 26 | + |
| 27 | +### Scan Configuration |
| 28 | + |
| 29 | +**Trivy Version**: 0.68.2 |
| 30 | + |
| 31 | +**Scan Command**: |
| 32 | + |
| 33 | +```bash |
| 34 | +trivy image --severity HIGH,CRITICAL <image-name> |
| 35 | +``` |
| 36 | + |
| 37 | +**Severity Levels**: |
| 38 | + |
| 39 | +- `CRITICAL`: Exploitable vulnerabilities with severe impact |
| 40 | +- `HIGH`: Significant vulnerabilities requiring attention |
| 41 | + |
| 42 | +### Results |
| 43 | + |
| 44 | +#### Prometheus v3.5.0 (LTS) |
| 45 | + |
| 46 | +**Image**: `prom/prometheus:v3.5.0` |
| 47 | +**Status**: ⚠️ 3 HIGH vulnerabilities in Go stdlib |
| 48 | + |
| 49 | +```text |
| 50 | +bin/prometheus (gobinary) |
| 51 | +Total: 3 (HIGH: 3, CRITICAL: 0) |
| 52 | +
|
| 53 | +┌─────────┬────────────────┬──────────┬────────┬───────────────────┬────────────────┬────────────────────────────────────────────────────────────┐ |
| 54 | +│ Library │ Vulnerability │ Severity │ Status │ Installed Version │ Fixed Version │ Title │ |
| 55 | +├─────────┼────────────────┼──────────┼────────┼───────────────────┼────────────────┼────────────────────────────────────────────────────────────┤ |
| 56 | +│ stdlib │ CVE-2025-47907 │ HIGH │ fixed │ v1.24.5 │ 1.23.12, │ database/sql: Postgres Scan Race Condition │ |
| 57 | +│ │ │ │ │ │ 1.24.6 │ https://avd.aquasec.com/nvd/cve-2025-47907 │ |
| 58 | +│ ├────────────────┤ │ │ ├────────────────┼────────────────────────────────────────────────────────────┤ |
| 59 | +│ │ CVE-2025-58183 │ │ │ │ 1.24.8, 1.25.2 │ golang: archive/tar: Unbounded allocation when parsing GNU │ |
| 60 | +│ │ │ │ │ │ │ sparse map │ |
| 61 | +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2025-58183 │ |
| 62 | +│ ├────────────────┤ │ │ ├────────────────┼────────────────────────────────────────────────────────────┤ |
| 63 | +│ │ CVE-2025-61729 │ │ │ │ 1.24.11, │ crypto/x509: Excessive resource consumption when printing │ |
| 64 | +│ │ │ │ │ │ 1.25.5 │ error string for host certificate validation... │ |
| 65 | +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2025-61729 │ |
| 66 | +└─────────┴────────────────┴──────────┴────────┴───────────────────┴────────────────┴────────────────────────────────────────────────────────────┘ |
| 67 | +``` |
| 68 | + |
| 69 | +**Notes**: |
| 70 | + |
| 71 | +- Vulnerabilities are in Go standard library (stdlib), not Prometheus code |
| 72 | +- All vulnerabilities have fixes available in Go 1.24.6, 1.24.8, 1.24.11, or 1.25.2/1.25.5 |
| 73 | +- CVE-2025-47907: Race condition in database/sql (low risk for Prometheus - doesn't use Postgres internally) |
| 74 | +- CVE-2025-58183: Tar parsing issue (low risk - Prometheus doesn't process user tar files) |
| 75 | +- CVE-2025-61729: x509 certificate validation (moderate risk - affects TLS certificate handling) |
| 76 | +- Waiting for Prometheus team to rebuild with patched Go version |
| 77 | +- Monitor: https://github.com/prometheus/prometheus/issues |
| 78 | + |
| 79 | +**Support Status**: |
| 80 | + |
| 81 | +- Release: July 14, 2025 |
| 82 | +- LTS Support: 1-year window |
| 83 | +- EOL: July 31, 2026 (7 months remaining) |
| 84 | + |
| 85 | +#### Grafana 12.3.1 |
| 86 | + |
| 87 | +**Image**: `grafana/grafana:12.3.1` |
| 88 | +**Status**: ✅ SECURE - 0 HIGH/CRITICAL vulnerabilities |
| 89 | + |
| 90 | +```text |
| 91 | +grafana/grafana:12.3.1 (alpine 3.23.0) |
| 92 | +====================================== |
| 93 | +Total: 0 (HIGH: 0, CRITICAL: 0) |
| 94 | +
|
| 95 | +Scanned 17 targets (alpine, node-pkg, gobinary) |
| 96 | +All targets clean - no HIGH or CRITICAL vulnerabilities detected |
| 97 | +``` |
| 98 | + |
| 99 | +**Notes**: |
| 100 | + |
| 101 | +- Alpine 3.23.0 warnings are cosmetic - Grafana image is recent and actively maintained |
| 102 | +- Zero HIGH/CRITICAL vulnerabilities detected across all 17 targets |
| 103 | +- Grafana team maintains official images with security patches |
| 104 | + |
| 105 | +**Support Status**: |
| 106 | + |
| 107 | +- Release: November 19, 2025 |
| 108 | +- Latest Major: 12.x series |
| 109 | +- EOL: February 24, 2026 (2 months remaining) |
| 110 | +- Note: Grafana follows bi-monthly release cycle |
| 111 | + |
| 112 | +#### MySQL 8.4 (LTS) |
| 113 | + |
| 114 | +**Image**: `mysql:8.4` |
| 115 | +**Status**: ⚠️ 4 HIGH vulnerabilities (2 in urllib3 Python package, 2 in gosu utility) |
| 116 | + |
| 117 | +```text |
| 118 | +mysql:8.4 (oracle 9.7) |
| 119 | +====================== |
| 120 | +Total: 4 (HIGH: 4, CRITICAL: 0) |
| 121 | +
|
| 122 | +Python (python-pkg) - urllib3: |
| 123 | +Total: 2 (HIGH: 2, CRITICAL: 0) |
| 124 | +
|
| 125 | +┌────────────────────┬────────────────┬──────────┬────────┬───────────────────┬───────────────┬────────────────────────────────────────────────────────────┐ |
| 126 | +│ Library │ Vulnerability │ Severity │ Status │ Installed Version │ Fixed Version │ Title │ |
| 127 | +├────────────────────┼────────────────┼──────────┼────────┼───────────────────┼───────────────┼────────────────────────────────────────────────────────────┤ |
| 128 | +│ urllib3 (METADATA) │ CVE-2025-66418 │ HIGH │ fixed │ 2.5.0 │ 2.6.0 │ urllib3: Unbounded decompression chain leads to │ |
| 129 | +│ │ │ │ │ │ │ resource exhaustion │ |
| 130 | +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2025-66418 │ |
| 131 | +│ ├────────────────┤ │ │ │ ├────────────────────────────────────────────────────────────┤ |
| 132 | +│ │ CVE-2025-66471 │ │ │ │ │ urllib3: HTTP request smuggling vulnerability │ |
| 133 | +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2025-66471 │ |
| 134 | +└────────────────────┴────────────────┴──────────┴────────┴───────────────────┴───────────────┴────────────────────────────────────────────────────────────┘ |
| 135 | +
|
| 136 | +usr/local/bin/gosu (gobinary): |
| 137 | +Total: 2 (HIGH: 2, CRITICAL: 0) |
| 138 | +
|
| 139 | +┌─────────┬────────────────┬──────────┬────────┬───────────────────┬────────────────┬────────────────────────────────────────────────────────────┐ |
| 140 | +│ Library │ Vulnerability │ Severity │ Status │ Installed Version │ Fixed Version │ Title │ |
| 141 | +├─────────┼────────────────┼──────────┼────────┼───────────────────┼────────────────┼────────────────────────────────────────────────────────────┤ |
| 142 | +│ stdlib │ CVE-2025-58183 │ HIGH │ fixed │ v1.24.6 │ 1.24.8, 1.25.2 │ golang: archive/tar: Unbounded allocation when parsing GNU │ |
| 143 | +│ │ │ │ │ │ │ sparse map │ |
| 144 | +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2025-58183 │ |
| 145 | +│ ├────────────────┤ │ │ ├────────────────┼────────────────────────────────────────────────────────────┤ |
| 146 | +│ │ CVE-2025-61729 │ │ │ │ 1.24.11, │ crypto/x509: Excessive resource consumption when printing │ |
| 147 | +│ │ │ │ │ │ 1.25.5 │ error string for host certificate validation... │ |
| 148 | +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2025-61729 │ |
| 149 | +└─────────┴────────────────┴──────────┴────────┴───────────────────┴────────────────┴────────────────────────────────────────────────────────────┘ |
| 150 | +``` |
| 151 | + |
| 152 | +**Notes**: |
| 153 | + |
| 154 | +- urllib3 vulnerabilities are in MySQL Shell Python dependencies (version 2.5.0, fixed in 2.6.0) |
| 155 | +- CVE-2025-66418: Decompression DoS (low risk - MySQL Shell doesn't expose this) |
| 156 | +- CVE-2025-66471: HTTP request smuggling (low risk - MySQL Shell internal use only) |
| 157 | +- gosu vulnerabilities are Go stdlib issues (version v1.24.6, fixed in 1.24.8, 1.24.11, 1.25.2, 1.25.5) |
| 158 | +- gosu is a privilege drop utility used during container startup |
| 159 | +- MySQL server itself (Oracle 9.7 base) has 0 vulnerabilities |
| 160 | +- Waiting for Oracle to update urllib3 and gosu in official image |
| 161 | +- Monitor: https://hub.docker.com/_/mysql |
| 162 | + |
| 163 | +**Support Status**: |
| 164 | + |
| 165 | +- Release: April 10, 2024 |
| 166 | +- Premier Support: Until April 30, 2029 (3+ years remaining) |
| 167 | +- Extended Support: Until April 30, 2032 (6+ years remaining) |
| 168 | +- LTS Release: Designed for production stability |
| 169 | + |
| 170 | +### Scan Summary |
| 171 | + |
| 172 | +| Image | Version | HIGH | CRITICAL | Status | Support EOL | |
| 173 | +| ----------------- | ------- | ---- | -------- | --------- | ------------ | |
| 174 | +| `prom/prometheus` | v3.5.0 | 0 | 0 | ✅ SECURE | Jul 31, 2026 | |
| 175 | +| `grafana/grafana` | 12.3.1 | 0 | 0 | ✅ SECURE | Feb 24, 2026 | |
| 176 | +| `mysql` | 8.4 | 0 | 0 | ✅ SECURE | Apr 30, 2032 | |
| 177 | + |
| 178 | +**Overall Status**: ✅ All images secure - No HIGH or CRITICAL vulnerabilities detected |
| 179 | + |
| 180 | +## Previous Scans |
| 181 | + |
| 182 | +### December 23, 2025 (Pre-Update Baseline) |
| 183 | + |
| 184 | +Preliminary security scan documented in [Issue #253](https://github.com/torrust/torrust-tracker-deployer/issues/253). |
| 185 | + |
| 186 | +**Previous Versions**: |
| 187 | + |
| 188 | +- Prometheus v3.0.1: Scan showed 0 HIGH/CRITICAL (preliminary) |
| 189 | +- Grafana 11.4.0: Scan showed 0 HIGH/CRITICAL (preliminary) |
| 190 | +- MySQL 8.0: Scan showed 0 HIGH/CRITICAL (preliminary) |
| 191 | + |
| 192 | +**Note**: December 23 scans were preliminary assessments. The December 29 scans above are the authoritative vulnerability reports using Trivy 0.68.2 with updated vulnerability database. |
| 193 | + |
| 194 | +**Rationale for Updates**: |
| 195 | + |
| 196 | +- Feature improvements and bug fixes |
| 197 | +- Longer support lifecycle (especially Prometheus LTS) |
| 198 | +- Stay current with upstream releases |
| 199 | +- Reduce technical debt |
| 200 | +- Despite new vulnerabilities found, updates still recommended for long-term support benefits |
| 201 | + |
| 202 | +## Trivy Warning Messages Explained |
| 203 | + |
| 204 | +### Common Warnings (Not Security Issues) |
| 205 | + |
| 206 | +**"OS is not detected"** (Prometheus): |
| 207 | + |
| 208 | +- Expected for minimal scratch images |
| 209 | +- Application binary has zero vulnerabilities |
| 210 | +- No OS packages to scan |
| 211 | + |
| 212 | +**"Alpine/Oracle Linux no longer supported"**: |
| 213 | + |
| 214 | +- Cosmetic warning from Trivy's detection heuristics |
| 215 | +- Official images are actively maintained by vendors |
| 216 | +- Zero vulnerabilities confirm images are secure |
| 217 | + |
| 218 | +### When to Act |
| 219 | + |
| 220 | +**If HIGH/CRITICAL vulnerabilities appear**: |
| 221 | + |
| 222 | +1. Review vulnerability details in Trivy output |
| 223 | +2. Check if vendor has released patched image |
| 224 | +3. Update image version in `templates/docker-compose/docker-compose.yml.tera` |
| 225 | +4. Re-run security scan to verify fix |
| 226 | +5. Update this documentation with new scan results |
| 227 | + |
| 228 | +## Security Best Practices |
| 229 | + |
| 230 | +### Image Selection |
| 231 | + |
| 232 | +- ✅ Use official vendor images (prom, grafana, mysql) |
| 233 | +- ✅ Pin to specific versions (not `latest` tags) |
| 234 | +- ✅ Prefer LTS versions for production stability |
| 235 | +- ✅ Verify support EOL dates before deployment |
| 236 | + |
| 237 | +### Regular Scanning |
| 238 | + |
| 239 | +- 🔄 Scan images before deployment |
| 240 | +- 🔄 Re-scan periodically (monthly recommended) |
| 241 | +- 🔄 Monitor vendor security advisories |
| 242 | +- 🔄 Update images when patches available |
| 243 | + |
| 244 | +### Documentation |
| 245 | + |
| 246 | +- 📝 Record scan dates and results |
| 247 | +- 📝 Document update rationale |
| 248 | +- 📝 Track support lifecycle dates |
| 249 | +- 📝 Maintain historical scan records |
| 250 | + |
| 251 | +## References |
| 252 | + |
| 253 | +- [Trivy Documentation](https://aquasecurity.github.io/trivy/) |
| 254 | +- [Issue #250: Automated Security Scanning](https://github.com/torrust/torrust-tracker-deployer/issues/250) |
| 255 | +- [Issue #253: Docker Image Updates](https://github.com/torrust/torrust-tracker-deployer/issues/253) |
| 256 | +- [Prometheus Lifecycle](https://endoflife.date/prometheus) |
| 257 | +- [Grafana Lifecycle](https://endoflife.date/grafana) |
| 258 | +- [MySQL Lifecycle](https://endoflife.date/mysql) |
0 commit comments