Skip to content

Verify signatures & provenance

Every image on registry.kaloracloud.eu is signed with the Kalora cosign key and carries signed attestations: SPDX SBOM, OpenVEX and SLSA v1 provenance, plus a CSAF 2.0 advisory when the digest has findings. Formats and CRA mapping: CRA & NIS2 feeds.

You need cosign v2, crane, jq, and optionally oras v1.2+.

Always get the key from the registry, and check it against the published checksum:

Terminal window
curl -fsSLO https://registry.kaloracloud.eu/cosign.pub
curl -fsSLO https://registry.kaloracloud.eu/cosign.pub.sha256
sha256sum -c cosign.pub.sha256 # macOS: shasum -a 256 -c cosign.pub.sha256
cosign.pub: OK

cosign.pub.sha256 holds a single <hash> cosign.pub line. Pass that file to -c, not the key itself. If the check fails, don’t use the key:

cosign.pub: FAILED
sha256sum: WARNING: 1 computed checksum did NOT match

Kalora signs with a keyed pair and does not upload to Rekor, so pass --insecure-ignore-tlog=true. The signature is still checked against the key.

Signatures are bound to the digest. Tags are mutable, so resolve the digest first, then verify and deploy that digest:

Terminal window
IMAGE=registry.kaloracloud.eu/kalora/python-hardened
DIGEST=$(crane digest "${IMAGE}:3.12")
cosign verify --key cosign.pub --insecure-ignore-tlog=true "${IMAGE}@${DIGEST}"

Example output for the current python-hardened image:

$ cosign verify --key cosign.pub --insecure-ignore-tlog=true \
registry.kaloracloud.eu/kalora/python-hardened@sha256:a68b17c92979d47c1322204f666dc0954d42395a189347960fc84b66a3b27c34
Verification for registry.kaloracloud.eu/kalora/python-hardened@sha256:a68b17c9... --
The following checks were performed on each of these signatures:
- The cosign claims were validated
- The signatures were verified against the specified public key
Attestation --type predicateType
SPDX SBOM spdxjson https://spdx.dev/Document
OpenVEX openvex https://openvex.dev/ns
CSAF 2.0 https://csaf.io/schema/csaf/2.0 https://csaf.io/schema/csaf/2.0
SLSA v1 provenance slsaprovenance1 https://slsa.dev/provenance/v1

Each command prints DSSE envelopes. The predicate is base64-encoded in .payload:

Terminal window
verify_att() {
cosign verify-attestation --key cosign.pub --insecure-ignore-tlog=true \
--type "$1" "${IMAGE}@${DIGEST}" \
| jq '.payload | @base64d | fromjson | .predicate'
}
verify_att spdxjson > sbom.spdx.json
verify_att openvex | jq '.statements[] | {cve: .vulnerability.name, status, justification}'
verify_att https://csaf.io/schema/csaf/2.0 > csaf.json # only on digests with findings
verify_att slsaprovenance1 | jq '{buildType: .buildDefinition.buildType, builder: .runDetails.builder.id}'

The provenance has buildType https://kaloracloud.eu/slsa/buildtypes/argo-apko/v1 and builder.id https://kaloracloud.eu/argo-workflows/image-factory-pipeline. The first entry in resolvedDependencies is the source commit.

The CycloneDX SBOM and the HTML security report are OCI referrers, not cosign attestations:

Terminal window
oras discover "${IMAGE}@${DIGEST}" --format tree
ref() { oras discover "${IMAGE}@${DIGEST}" --artifact-type "$1" --format json | jq -r '.referrers[0].digest // .manifests[0].digest'; }
oras pull "${IMAGE}@$(ref application/vnd.cyclonedx+json)" -o ./cyclonedx
oras pull "${IMAGE}@$(ref application/vnd.kalora.security-report+html)" -o ./report

Paste the contents of https://registry.kaloracloud.eu/cosign.pub where marked.

apiVersion: kyverno.io/v1
kind: ClusterPolicy
metadata:
name: verify-kalora-images
spec:
validationFailureAction: Enforce
background: false
webhookTimeoutSeconds: 30
rules:
- name: verify-kalora-signature
match:
any:
- resources:
kinds: [Pod]
verifyImages:
- imageReferences:
- "registry.kaloracloud.eu/kalora/*"
mutateDigest: true
verifyDigest: true
required: true
attestors:
- entries:
- keys:
publicKeys: |-
-----BEGIN PUBLIC KEY-----
<contents of cosign.pub>
-----END PUBLIC KEY-----
rekor:
ignoreTlog: true
ctlog:
ignoreSCT: true
attestations:
- type: https://slsa.dev/provenance/v1
attestors:
- entries:
- keys:
publicKeys: |-
-----BEGIN PUBLIC KEY-----
<contents of cosign.pub>
-----END PUBLIC KEY-----
rekor:
ignoreTlog: true
ctlog:
ignoreSCT: true
conditions:
- all:
- key: "{{ runDetails.builder.id }}"
operator: Equals
value: "https://kaloracloud.eu/argo-workflows/image-factory-pipeline"
apiVersion: policy.sigstore.dev/v1beta1
kind: ClusterImagePolicy
metadata:
name: kalora-images
spec:
images:
- glob: "registry.kaloracloud.eu/kalora/**"
authorities:
- name: kalora-key
key:
hashAlgorithm: sha256
data: |
-----BEGIN PUBLIC KEY-----
<contents of cosign.pub>
-----END PUBLIC KEY-----
# No ctlog: Kalora signatures are not in Rekor.
attestations:
- name: slsa-provenance
predicateType: slsaprovenance1
- name: spdx-sbom
predicateType: spdxjson

Opt namespaces in with kubectl label namespace my-app policy.sigstore.dev/include=true.

Gatekeeper evaluates Rego, not signatures. Use it to allow only Kalora repositories and require digest pins, then add Ratify as a Gatekeeper external data provider with a cosign verifier and the Kalora public key for the signature check.

apiVersion: templates.gatekeeper.sh/v1
kind: ConstraintTemplate
metadata:
name: k8skaloraimages
spec:
crd:
spec:
names:
kind: K8sKaloraImages
validation:
openAPIV3Schema:
type: object
properties:
repos:
type: array
items:
type: string
targets:
- target: admission.k8s.gatekeeper.sh
rego: |
package k8skaloraimages
import rego.v1
containers contains c if { some c in input.review.object.spec.containers }
containers contains c if { some c in input.review.object.spec.initContainers }
containers contains c if { some c in input.review.object.spec.ephemeralContainers }
allowed(image) if {
some repo in input.parameters.repos
startswith(image, repo)
}
violation contains {"msg": msg} if {
some c in containers
not allowed(c.image)
msg := sprintf("%v: %v is not from an allowed repository", [c.name, c.image])
}
violation contains {"msg": msg} if {
some c in containers
not contains(c.image, "@sha256:")
msg := sprintf("%v: %v must be pinned by digest", [c.name, c.image])
}
---
apiVersion: constraints.gatekeeper.sh/v1beta1
kind: K8sKaloraImages
metadata:
name: kalora-images-by-digest
spec:
match:
kinds:
- apiGroups: [""]
kinds: [Pod]
namespaces: [my-app]
parameters:
repos:
- registry.kaloracloud.eu/kalora/
- registry.kaloracloud.eu/private/
apiVersion: v1
kind: Pod
metadata:
name: kalora-python-check
namespace: my-app
spec:
restartPolicy: Never
securityContext:
runAsNonRoot: true
containers:
- name: python
image: registry.kaloracloud.eu/kalora/python-hardened@sha256:a68b17c92979d47c1322204f666dc0954d42395a189347960fc84b66a3b27c34
command: ["python", "-c", "print('verified')"]
resources:
requests:
cpu: "50m"
memory: "64Mi"
limits:
cpu: "200m"
memory: "128Mi"
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop: ["ALL"]

Tag vs digest. If you verify a tag, cosign resolves it at that moment, and the tag may point somewhere else by the time you deploy. Verify and deploy by digest. In Kyverno, mutateDigest: true pins the digest for you.

Private images. The kalora project is public. The private project needs credentials for cosign as well as for pulls:

Terminal window
cosign login registry.kaloracloud.eu -u <user> -p <token> # or docker login

Without credentials you get 401 Unauthorized. Admission controllers need the pull secret too (Kyverno: imageRegistryCredentials.secrets).

Failed verification.

Error Cause
no matching signatures: invalid signature when validating ASN.1 encoded signature Wrong key, or the image was not signed by Kalora
no signatures found Unsigned digest, e.g. your own image built FROM a Kalora base. Verify the base digest, and sign your own image yourself
transparency log / bundle not found Missing --insecure-ignore-tlog=true
none of the attestations matched the predicate type: ... Wrong --type. CSAF needs the full URI

All of these exit non-zero, so cosign verify can gate CI directly.