Skip to content
Release Verification

Release Verification

Release images are signed with cosign using keyless signing with the GitLab OIDC identity of the release pipeline. Each image also carries a CycloneDX SBOM, generated with Syft and attached as a signed cosign attestation.

Only release tags (v0.1.0, or a pre-release such as v0.1.0-rc.1) publish a release. For each image, the tag pipeline resolves the digest the build pushed, then scans, describes and signs exactly that digest:

  1. digest:images records the digest.
  2. scan:images fails on any fixable CRITICAL vulnerability (Trivy).
  3. sbom:images generates the SBOM (Syft); the files are kept as job artifacts.
  4. sign:images signs the digest and attaches the SBOM, once the scan passed.
  5. release:gitlab creates the GitLab release, listing each image with its digest.

Signed images:

ImageReference
Operatorregistry.gitlab.com/kornercloud.dev/kornercode/kornercode-controller:v<x.y.z>
Gatewayregistry.gitlab.com/kornercloud.dev/kornercode/kornercode-gateway:v<x.y.z>

The commands below require cosign 2.0 or later, where keyless verification is the default.

Verify an image signature

Accept only signatures made by a release-tag pipeline of this project. The certificate identity names the project, its pipeline definition and the Git ref, so match all of it; a looser pattern, such as one with unescaped dots, also accepts lookalike projects anyone can create.

identity='^https://gitlab\.com/kornercloud\.dev/kornercode//\.gitlab-ci\.yml@refs/tags/v[0-9]+\.[0-9]+\.[0-9]+(-[0-9A-Za-z.]+)?$'
image=registry.gitlab.com/kornercloud.dev/kornercode/kornercode-controller:v<x.y.z>

cosign verify --certificate-identity-regexp "$identity" \
  --certificate-oidc-issuer https://gitlab.com "$image"

Repeat with the gateway image. A successful verification prints the verified signature payload and confirms that the image was signed by a release-tag pipeline of the kornercloud.dev/kornercode project and recorded in the Sigstore transparency log.

To accept one release only, pass its exact identity instead:

--certificate-identity 'https://gitlab.com/kornercloud.dev/kornercode//.gitlab-ci.yml@refs/tags/v<x.y.z>'

Inspect the SBOM

cosign verify-attestation --type cyclonedx --certificate-identity-regexp "$identity" \
  --certificate-oidc-issuer https://gitlab.com "$image" \
  | jq -r '.payload | @base64d | fromjson | .predicate' > sbom.json

sbom.json is a CycloneDX document that you can feed to an SBOM consumer such as Dependency-Track, GUAC or Trivy. The release pipeline also keeps kornercode-controller-sbom.json and kornercode-gateway-sbom.json as job artifacts.

Enforce signatures at admission

To admit only signed kornercode images, configure an admission policy (for example Kyverno or the Sigstore Policy Controller) that requires a cosign signature whose certificate identity matches the pattern above and whose issuer is https://gitlab.com.

Example Kyverno policy:

apiVersion: kyverno.io/v1
kind: ClusterPolicy
metadata:
  name: require-kornercode-signed-images
spec:
  validationFailureAction: Enforce
  rules:
    - name: verify-signature
      match:
        any:
          - resources:
              kinds: [Pod]
              namespaces: [kornercode]     # the namespaces running the operator and the gateway
      verifyImages:
        - imageReferences:
            - "registry.gitlab.com/kornercloud.dev/kornercode/*"
          attestors:
            - entries:
                - keyless:
                    subjectRegExp: '^https://gitlab\.com/kornercloud\.dev/kornercode//\.gitlab-ci\.yml@refs/tags/v[0-9]+\.[0-9]+\.[0-9]+(-[0-9A-Za-z.]+)?$'
                    issuer: "https://gitlab.com"

To require the SBOM as well, add an attestation check for the CycloneDX predicate type (https://cyclonedx.org/bom) to the same rule; see the verifyImages documentation of your Kyverno version.

Workspace pods run images from WorkspaceProfiles and the Envoy sidecar image; they are not part of these releases and are not covered by this signature.