Skip to content

Release: keep a rejected image out of the public package #337

Closed

Description

@samuelmbabhazi

What happens

Since #336, release.yml pushes the control plane image by digest, scans it for both platforms, signs it, and only then moves the version tags. If the scan finds a vulnerability or a secret, no tag moves and nothing is signed, but the rejected image stays in the public ghcr.io/shipkeepdev/shipkeep package, untagged, and anyone who knows the digest can pull it.

For vulnerabilities this does not matter much: the image is not tagged, signed or named in a bundle. For a secret it does: a credential found in a layer would already be public.

Today the build receives no secret (no secret build arguments, no secret mounts), and every pull request scans the image built from the same Dockerfile for secrets, so a secret would most likely be caught before a release. This issue closes the remaining window.

Possible fix

Build the multi-platform image into an OCI layout (--output type=oci,dest=...), scan that layout for both platforms (trivy image --input), and only then push that exact layout to GHCR (with oras, crane or regctl, pinned by digest), so that the pushed digest is the scanned one. Keep the read-back of the tags.

Alternatively, push the candidate to a separate private package, scan it there, and copy it to the public package once it passes.

Acceptance

  • A release whose image fails the scan pushes nothing to the public package.
  • The digest that is signed and tagged is the digest that was scanned.
  • A dry run still builds and pushes nothing.

Raised in the review of #336.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions