Roadmap 1.4: Trivy scan gate and auto-merge for Renovate PRs #20

Open
opened 2026-12-03 04:39:32 +01:00 by claude-bot · 0 comments

Why

Automatic updates are only safe if a new version is checked before it is deployed. Renovate PRs should be scanned, merged automatically when low risk and clean, and deployed by the existing pipeline. Major versions still get a human review.

Enterprise practice: automated security gates in CI, auto-merge only for low-risk changes that pass all required checks.

Depends on kasun/homelab-ansible#19.

Steps

  • PR workflow on runner-vm: for every image changed in the PR run trivy image --severity HIGH,CRITICAL --ignore-unfixed --exit-code 1 <image@digest>
  • Cache the Trivy DB so scans are fast (job containers are thrown away after each job, so use actions/cache)
  • .trivyignore for accepted findings, each with a reason and an expiry date
  • Make the scan a required status check on main (branch protection)
  • Renovate packageRules: automerge: true + platformAutomerge: true for minor, patch and digest; majors need review; minimumReleaseAge: "3 days" so freshly published (possibly compromised) releases are not adopted immediately
  • After merge, the existing deploy workflow / Ansible rolls out the new pinned digest
  • Nightly trivy image against all deployed images, so new CVEs in unchanged images are reported too

Tools

Trivy, Renovate, Gitea branch protection, Ansible.

Done when

  • A Renovate PR that introduces a fixable HIGH/CRITICAL CVE is blocked
  • A clean patch update is merged and deployed without manual steps

Portfolio evidence

  • Screenshot of a blocked PR (failed Trivy check) and an auto-merged PR
  • Diagram of the flow: Renovate → Trivy → auto-merge → Ansible deploy

Part of the security roadmap. Keep the evidence below for the write-up (README / blog post).

## Why Automatic updates are only safe if a new version is checked before it is deployed. Renovate PRs should be scanned, merged automatically when low risk and clean, and deployed by the existing pipeline. Major versions still get a human review. **Enterprise practice:** automated security gates in CI, auto-merge only for low-risk changes that pass all required checks. Depends on kasun/homelab-ansible#19. ## Steps - [ ] PR workflow on `runner-vm`: for every image changed in the PR run `trivy image --severity HIGH,CRITICAL --ignore-unfixed --exit-code 1 <image@digest>` - [ ] Cache the Trivy DB so scans are fast (job containers are thrown away after each job, so use `actions/cache`) - [ ] `.trivyignore` for accepted findings, each with a reason and an expiry date - [ ] Make the scan a **required status check** on `main` (branch protection) - [ ] Renovate `packageRules`: `automerge: true` + `platformAutomerge: true` for `minor`, `patch` and `digest`; majors need review; `minimumReleaseAge: "3 days"` so freshly published (possibly compromised) releases are not adopted immediately - [ ] After merge, the existing deploy workflow / Ansible rolls out the new pinned digest - [ ] Nightly `trivy image` against all deployed images, so new CVEs in unchanged images are reported too ## Tools Trivy, Renovate, Gitea branch protection, Ansible. ## Done when - A Renovate PR that introduces a fixable HIGH/CRITICAL CVE is blocked - A clean patch update is merged and deployed without manual steps ## Portfolio evidence - [ ] Screenshot of a blocked PR (failed Trivy check) and an auto-merged PR - [ ] Diagram of the flow: Renovate → Trivy → auto-merge → Ansible deploy --- _Part of the security roadmap. Keep the evidence below for the write-up (README / blog post)._
claude-bot Bot added this to the Security Roadmap 1: Secure container supply chain milestone 2026-12-03 04:39:32 +01:00
claude-bot Bot added the security-roadmap label 2026-12-03 04:39:32 +01:00
claude-bot Bot added this to the Security Roadmap project 2026-12-03 04:39:39 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: kasun/homelab-ansible#20