Skip to content

[pod-reloader] Scan only the real release line and scan every release tag - #32

Open
Glitchy-Sheep wants to merge 3 commits into
mainfrom
chore/cve-scan-single-release-line
Open

Glitchy-Sheep wants to merge 3 commits into
mainfrom
chore/cve-scan-single-release-line

Conversation

@Glitchy-Sheep

@Glitchy-Sheep Glitchy-Sheep commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

Description

.github/workflows/trivy_image_check.yaml:

  • Regular scan: latest_releases_amount default 3 -> 1. A comment says when to raise it.
  • Release scan: the workflow also runs after "Build and push for prod" succeeds. It scans the tag that was just built and nothing else.
  • Job name stays static. GitHub shows an expression in a job name unevaluated when the job is skipped.

PR scans, schedule, secrets and the action version stay as in #30.

Why do we need it, and what problem does it solve?

Regular scan is red on every run

  • The script scans the latest patch of the N newest major.minor lines found in the prod registry.
  • pod-reloader has one line, 1.0. All five release channels point to v1.0.14.
  • The registry also has tags v0.1.0 and v0.2.0. Both point to one image from July 2025 with 59 open CVEs.
  • That image was never a release: no git tag, no channel.
  • With N=3 the script scans it and exits 1. main and v1.0.14 are clean (runs 35092061032, 35209203758).
  • With N=1 the scan covers what customers can run. The regulation leaves N to the module team (sections 2.6 and 6.1; three is required only for DKP itself).
  • Rule from the comment: raise N when a new minor ships while the old one is still on a channel.

New release tags are not scanned

  • Regulation section 6.1 asks for a scan when a release tag is created.
  • Until now a new tag waited for the next scheduled run, up to three days.
  • A push: tags trigger would race the prod build, which takes about 15 minutes. So the scan waits for that workflow to finish instead.

Checklist

  • The code is covered by unit tests.
  • e2e tests passed.
  • Documentation updated according to the changes.
  • Changes were tested in the Kubernetes cluster manually.

CI-only change. Verified on the branch: PR scan and a manual regular scan are green, Tags to check in registry: main v1.0.14 (see the comment below). The release scan cannot run before merge: workflow_run fires from the default branch only. First real run is the next release tag.

The regular scan takes the latest patch of the N newest release lines
(major.minor) from the prod registry. The module has one line, 1.0, on
every release channel, but the registry also holds v0.1.0 and v0.2.0:
one image from July 2025 that is not a release and carries 59 open CVEs.
With N=3 the scan picks it up, and every scheduled run and push to main
ends red while main and v1.0.14 are clean.

Set N to 1 and document when to raise it.

Signed-off-by: Roman Berezkin <roman.berezkin@flant.com>
@Glitchy-Sheep Glitchy-Sheep added the enhancement New feature or request label Sep 17, 2026
@Glitchy-Sheep Glitchy-Sheep self-assigned this Sep 17, 2026
@Glitchy-Sheep

Copy link
Copy Markdown
Contributor Author

Verified on this branch:

For comparison, the last regular scan on main with N=3 (https://github.com/deckhouse/pod-reloader/actions/runs/35209203758) scanned main v0.1.0 v0.2.0 v1.0.14 and failed on the v0.x image.

The vulnerability remediation regulation (section 6.1) requires a scan
when a release tag is created. The scan workflow now also runs when
"Build and push for prod" finishes successfully, takes the built tag as
source_tag and scans only that tag. Waiting for the build instead of the
tag push keeps the scan from starting before the image reaches the prod
registry: the build takes about 15 minutes.

Signed-off-by: Roman Berezkin <roman.berezkin@flant.com>
@Glitchy-Sheep Glitchy-Sheep changed the title [pod-reloader] Scan only the real release line in the regular CVE scan [pod-reloader] Scan only the real release line and scan every release tag Sep 17, 2026
GitHub renders an expression in a job name unevaluated when the job is
skipped, so PR check lists showed the raw expression. The release scan is
told apart by its workflow_run event instead.

Signed-off-by: Roman Berezkin <roman.berezkin@flant.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant