Spec 08 — Image CVE scanning + dependency PRs
Purpose
We pull :latest for several images (prom/prometheus, grafana/grafana, prom/alertmanager, caddy). There’s no tracking of when an image was last pulled, no CVE scanning, no Renovate/Dependabot for our own Python services (queue-exporter, pdf-service). Drift is silent and security advisories are missed until an audit.
Two layers:
- Renovate for keeping image tags and Python deps up to date (PRs to review).
- Trivy in nightly CI to surface CVEs in currently-running images.
Rulebook
- No
:latestin compose files (after this spec). Use pinned digests or semver tags; let Renovate bump them. - CVE policy: CRITICAL → fix within 7 days. HIGH → within 30. MEDIUM/LOW → batched quarterly.
- Renovate auto-merges patch updates for dev-only tools (renderer, image scanners). All else is PR-with-review.
Implementation plan
- Pin all image tags in
monitoring/docker-compose.ymlandhostinger/docker-compose.ymlto current versions. - Add
renovate.jsonat repo root configured for:- Docker image tag updates (semver-aware)
- Python
requirements.txtupdates ininfra-src/ - GitHub Actions versions
- Add
.github/workflows/trivy-scan.yml— nightly, runstrivy imageagainst every image in compose files. Posts summary to Discord; opens issue for CRITICAL findings. - Add
.github/dependabot.ymlas belt-and-braces for GH Actions only (Renovate covers the rest but Dependabot is simpler for Actions).
Acceptance criteria
- No
:latesttags in any compose file (grep returns zero) - Renovate dashboard issue exists in repo
- First Trivy scan completes; Discord receives summary
- Manually introducing an old
nginx:1.16produces a CRITICAL alert in next nightly scan
Cost impact
0 €. Renovate is free on GitHub.
Back-out plan
Remove renovate.json, .github/dependabot.yml, trivy-scan.yml. Tags remain pinned (which is fine).
Risks / open questions
- Risk: Renovate PR flood overwhelms. Mitigation: configure
prHourlyLimit: 2, group minor/patch updates, schedule for Sundays. - Q: Use Trivy or Grype? A: Trivy — better integrated with GH Action ecosystem, comparable DB quality.