-
As per title I'm not able to properly verify the signature of a container image by Nvidia. As per Nvidia documentation they use Sigstore's Cosign for container image signature verification. Therefore I expect I'm on RHEL9.3 (podman version 4.6.1) and following this document here. Following the setup instruction I have the following: File docker:
nvcr.io:
use-sigstore-attachments: true I set the default policy with:
While "transports": {
"docker": {
"nvcr.io/nvidia/deepstream": [
{
"type": "sigstoreSigned",
"keyPath": "/path/to/nvidia-key.pub"
}
],
... Complete policy file{
"default": [
{
"type": "reject"
}
],
"transports": {
"docker": {
"nvcr.io/nvidia/deepstream": [
{
"type": "sigstoreSigned",
"keyPath": "/home/rhel9/Desktop/nvidia-key.pub",
"signedIdentity": {"type":"matchRepoDigestOrExact"}
}
],
"registry.access.redhat.com": [
{
"type": "signedBy",
"keyType": "GPGKeys",
"keyPaths": [
"/etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release",
"/etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-beta"
]
}
],
"registry.redhat.io": [
{
"type": "signedBy",
"keyType": "GPGKeys",
"keyPaths": [
"/etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release",
"/etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-beta"
]
}
]
},
"docker-daemon": {
"": [
{
"type": "insecureAcceptAnything"
}
]
}
}
} Where wget https://api.ngc.nvidia.com/v2/catalog/containers/public-key -O nvidia-key.pub The link is https://api.ngc.nvidia.com/v2/catalog/containers/public-key When I try to pull unsigned images I get the expected output: [rhel9@localhost Desktop]$ podman pull nvcr.io/nvidia/deepstream:6.2-iot
Trying to pull nvcr.io/nvidia/deepstream:6.2-iot...
Error: Source image rejected: A signature was required, but no signature exists ... but when I try to pull the signed image I get: [rhel9@localhost Desktop]$ podman pull nvcr.io/nvidia/deepstream:6.3-samples
Trying to pull nvcr.io/nvidia/deepstream:6.3-samples...
Error: Source image rejected: None of the signatures were accepted, reasons: Signature for identity canary.nvcr.io/nvidia/deepstream is not accepted; Signature for identity canary.nvcr.io/nvidia/deepstream is not accepted; Signature for identity canary.nvcr.io/nvidia/deepstream is not accepted; Signature for identity canary.nvcr.io/nvidia/deepstream is not accepted Full debug log[rhel9@localhost Desktop]$ podman pull nvcr.io/nvidia/deepstream:6.3-samples
Error: invalid policy in "/etc/containers/policy.json": invalid character '{' looking for beginning of object key string
[rhel9@localhost Desktop]$ podman pull nvcr.io/nvidia/deepstream:6.3-samples
Trying to pull nvcr.io/nvidia/deepstream:6.3-samples...
Error: Source image rejected: None of the signatures were accepted, reasons: Signature for identity canary.nvcr.io/nvidia/deepstream is not accepted; Signature for identity canary.nvcr.io/nvidia/deepstream is not accepted; Signature for identity canary.nvcr.io/nvidia/deepstream is not accepted; Signature for identity canary.nvcr.io/nvidia/deepstream is not accepted
[rhel9@localhost Desktop]$ podman pull nvcr.io/nvidia/deepstream:6.3-samples
Trying to pull nvcr.io/nvidia/deepstream:6.3-samples...
Error: Source image rejected: reading signature from https://canary.nvcr.io/nvidia/deepstream/nvidia/deepstream@sha256=702912b959b8905a5632f6b0b9676e1dcecdfcd478e7fffb04138a6f9798f102/signature-1: status 401 (Unauthorized)
[rhel9@localhost Desktop]$ podman pull nvcr.io/nvidia/deepstream:6.3-samples
Trying to pull nvcr.io/nvidia/deepstream:6.3-samples...
Error: Source image rejected: reading signature from https://nvcr.io/nvidia/deepstream/nvidia/deepstream@sha256=702912b959b8905a5632f6b0b9676e1dcecdfcd478e7fffb04138a6f9798f102/signature-1: status 401 (Unauthorized)
[rhel9@localhost Desktop]$ podman --log-level debug pull nvcr.io/nvidia/deepstream:6.3-samples
INFO[0000] podman filtering at log level debug
DEBU[0000] Called pull.PersistentPreRunE(podman --log-level debug pull nvcr.io/nvidia/deepstream:6.3-samples)
DEBU[0000] Using conmon: "/usr/bin/conmon"
DEBU[0000] Initializing boltdb state at /home/rhel9/.local/share/containers/storage/libpod/bolt_state.db
DEBU[0000] Using graph driver overlay
DEBU[0000] Using graph root /home/rhel9/.local/share/containers/storage
DEBU[0000] Using run root /run/user/1000/containers
DEBU[0000] Using static dir /home/rhel9/.local/share/containers/storage/libpod
DEBU[0000] Using tmp dir /run/user/1000/libpod/tmp
DEBU[0000] Using volume path /home/rhel9/.local/share/containers/storage/volumes
DEBU[0000] Using transient store: false
DEBU[0000] [graphdriver] trying provided driver "overlay"
DEBU[0000] Cached value indicated that overlay is supported
DEBU[0000] Cached value indicated that overlay is supported
DEBU[0000] Cached value indicated that metacopy is not being used
DEBU[0000] Cached value indicated that native-diff is usable
DEBU[0000] backingFs=xfs, projectQuotaSupported=false, useNativeDiff=true, usingMetacopy=false
DEBU[0000] Initializing event backend journald
DEBU[0000] Configured OCI runtime kata initialization failed: no valid executable found for OCI runtime kata: invalid argument
DEBU[0000] Configured OCI runtime krun initialization failed: no valid executable found for OCI runtime krun: invalid argument
DEBU[0000] Configured OCI runtime crun-wasm initialization failed: no valid executable found for OCI runtime crun-wasm: invalid argument
DEBU[0000] Configured OCI runtime runc initialization failed: no valid executable found for OCI runtime runc: invalid argument
DEBU[0000] Configured OCI runtime runj initialization failed: no valid executable found for OCI runtime runj: invalid argument
DEBU[0000] Configured OCI runtime ocijail initialization failed: no valid executable found for OCI runtime ocijail: invalid argument
DEBU[0000] Configured OCI runtime runsc initialization failed: no valid executable found for OCI runtime runsc: invalid argument
DEBU[0000] Configured OCI runtime youki initialization failed: no valid executable found for OCI runtime youki: invalid argument
DEBU[0000] Using OCI runtime "/usr/bin/crun"
INFO[0000] Setting parallel job count to 7
DEBU[0000] Pulling image nvcr.io/nvidia/deepstream:6.3-samples (policy: always)
DEBU[0000] Looking up image "nvcr.io/nvidia/deepstream:6.3-samples" in local containers storage
DEBU[0000] Normalized platform linux/amd64 to {amd64 linux [] }
DEBU[0000] Trying "nvcr.io/nvidia/deepstream:6.3-samples" ...
DEBU[0000] reference "[overlay@/home/rhel9/.local/share/containers/storage+/run/user/1000/containers]nvcr.io/nvidia/deepstream:6.3-samples" does not resolve to an image ID
DEBU[0000] Trying "nvcr.io/nvidia/deepstream:6.3-samples" ...
DEBU[0000] reference "[overlay@/home/rhel9/.local/share/containers/storage+/run/user/1000/containers]nvcr.io/nvidia/deepstream:6.3-samples" does not resolve to an image ID
DEBU[0000] Trying "nvcr.io/nvidia/deepstream:6.3-samples" ...
DEBU[0000] Loading registries configuration "/etc/containers/registries.conf"
DEBU[0000] Loading registries configuration "/etc/containers/registries.conf.d/000-shortnames.conf"
DEBU[0000] Loading registries configuration "/etc/containers/registries.conf.d/001-rhel-shortnames.conf"
DEBU[0000] Loading registries configuration "/etc/containers/registries.conf.d/002-rhel-shortnames-overrides.conf"
DEBU[0000] Normalized platform linux/amd64 to {amd64 linux [] }
DEBU[0000] Attempting to pull candidate nvcr.io/nvidia/deepstream:6.3-samples for nvcr.io/nvidia/deepstream:6.3-samples
DEBU[0000] parsed reference into "[overlay@/home/rhel9/.local/share/containers/storage+/run/user/1000/containers]nvcr.io/nvidia/deepstream:6.3-samples"
Trying to pull nvcr.io/nvidia/deepstream:6.3-samples...
DEBU[0000] Copying source image //nvcr.io/nvidia/deepstream:6.3-samples to destination image [overlay@/home/rhel9/.local/share/containers/storage+/run/user/1000/containers]nvcr.io/nvidia/deepstream:6.3-samples
DEBU[0000] Using registries.d directory /etc/containers/registries.d
DEBU[0000] Trying to access "nvcr.io/nvidia/deepstream:6.3-samples"
DEBU[0000] No credentials matching nvcr.io/nvidia/deepstream found in /run/user/1000/containers/auth.json
DEBU[0000] No credentials matching nvcr.io/nvidia/deepstream found in /home/rhel9/.config/containers/auth.json
DEBU[0000] No credentials matching nvcr.io/nvidia/deepstream found in /home/rhel9/.docker/config.json
DEBU[0000] No credentials matching nvcr.io/nvidia/deepstream found in /home/rhel9/.dockercfg
DEBU[0000] No credentials for nvcr.io/nvidia/deepstream found
DEBU[0000] Lookaside configuration: using "docker" namespace nvcr.io
DEBU[0000] No signature storage configuration found for nvcr.io/nvidia/deepstream:6.3-samples, using built-in default file:///home/rhel9/.local/share/containers/sigstore
DEBU[0000] Looking for TLS certificates and private keys in /etc/docker/certs.d/nvcr.io
DEBU[0000] Sigstore attachments: using "docker" namespace nvcr.io
DEBU[0000] GET https://nvcr.io/v2/
DEBU[0000] Ping https://nvcr.io/v2/ status 401
DEBU[0000] GET https://nvcr.io/proxy_auth?scope=repository%3Anvidia%2Fdeepstream%3Apull
DEBU[0001] GET https://nvcr.io/v2/nvidia/deepstream/manifests/6.3-samples
DEBU[0001] Content-Type from manifest GET is "application/vnd.docker.distribution.manifest.v2+json"
DEBU[0001] Using blob info cache at /home/rhel9/.local/share/containers/cache/blob-info-cache-v1.boltdb
DEBU[0001] IsRunningImageAllowed for image docker:nvcr.io/nvidia/deepstream:6.3-samples
DEBU[0001] Using transport "docker" specific policy section nvcr.io/nvidia/deepstream
DEBU[0001] Reading /home/rhel9/.local/share/containers/sigstore/nvidia/deepstream@sha256=702912b959b8905a5632f6b0b9676e1dcecdfcd478e7fffb04138a6f9798f102/signature-1
DEBU[0001] Looking for sigstore attachments in nvcr.io/nvidia/deepstream:sha256-702912b959b8905a5632f6b0b9676e1dcecdfcd478e7fffb04138a6f9798f102.sig
DEBU[0001] GET https://nvcr.io/v2/nvidia/deepstream/manifests/sha256-702912b959b8905a5632f6b0b9676e1dcecdfcd478e7fffb04138a6f9798f102.sig
DEBU[0002] Content-Type from manifest GET is "application/vnd.oci.image.manifest.v1+json"
DEBU[0002] Found a sigstore attachment manifest with 4 layers
DEBU[0002] Fetching sigstore attachment 1/4: sha256:107ee1d7adfd79c69466a0cc22003753dcd9bed0a4e2e55b9f535f317cfc18b0
DEBU[0002] Downloading /v2/nvidia/deepstream/blobs/sha256:107ee1d7adfd79c69466a0cc22003753dcd9bed0a4e2e55b9f535f317cfc18b0
DEBU[0002] GET https://nvcr.io/v2/nvidia/deepstream/blobs/sha256:107ee1d7adfd79c69466a0cc22003753dcd9bed0a4e2e55b9f535f317cfc18b0
DEBU[0002] Fetching sigstore attachment 2/4: sha256:107ee1d7adfd79c69466a0cc22003753dcd9bed0a4e2e55b9f535f317cfc18b0
DEBU[0002] Downloading /v2/nvidia/deepstream/blobs/sha256:107ee1d7adfd79c69466a0cc22003753dcd9bed0a4e2e55b9f535f317cfc18b0
DEBU[0002] GET https://nvcr.io/v2/nvidia/deepstream/blobs/sha256:107ee1d7adfd79c69466a0cc22003753dcd9bed0a4e2e55b9f535f317cfc18b0
DEBU[0002] Fetching sigstore attachment 3/4: sha256:107ee1d7adfd79c69466a0cc22003753dcd9bed0a4e2e55b9f535f317cfc18b0
DEBU[0002] Downloading /v2/nvidia/deepstream/blobs/sha256:107ee1d7adfd79c69466a0cc22003753dcd9bed0a4e2e55b9f535f317cfc18b0
DEBU[0002] GET https://nvcr.io/v2/nvidia/deepstream/blobs/sha256:107ee1d7adfd79c69466a0cc22003753dcd9bed0a4e2e55b9f535f317cfc18b0
DEBU[0003] Fetching sigstore attachment 4/4: sha256:107ee1d7adfd79c69466a0cc22003753dcd9bed0a4e2e55b9f535f317cfc18b0
DEBU[0003] Downloading /v2/nvidia/deepstream/blobs/sha256:107ee1d7adfd79c69466a0cc22003753dcd9bed0a4e2e55b9f535f317cfc18b0
DEBU[0003] GET https://nvcr.io/v2/nvidia/deepstream/blobs/sha256:107ee1d7adfd79c69466a0cc22003753dcd9bed0a4e2e55b9f535f317cfc18b0
DEBU[0003] Requirement 0: denied, done
DEBU[0003] Error pulling candidate nvcr.io/nvidia/deepstream:6.3-samples: Source image rejected: None of the signatures were accepted, reasons: Signature for identity canary.nvcr.io/nvidia/deepstream is not accepted; Signature for identity canary.nvcr.io/nvidia/deepstream is not accepted; Signature for identity canary.nvcr.io/nvidia/deepstream is not accepted; Signature for identity canary.nvcr.io/nvidia/deepstream is not accepted
Error: Source image rejected: None of the signatures were accepted, reasons: Signature for identity canary.nvcr.io/nvidia/deepstream is not accepted; Signature for identity canary.nvcr.io/nvidia/deepstream is not accepted; Signature for identity canary.nvcr.io/nvidia/deepstream is not accepted; Signature for identity canary.nvcr.io/nvidia/deepstream is not accepted
DEBU[0003] Shutting down engines Is there anything wrong with my setup? Am I missing something (for example in my assumption of this being supposed to work?). Is the output a symptom of a mirror? I tried following the containers-policy.json documentation for handling mirrors but without success... For context here's the Cosign debug log (please take note of the ./cosign-linux-amd64 verify --insecure-ignore-tlog --key https://api.ngc.nvidia.com/v2/catalog/containers/public-key nvcr.io/nvidia/deepstream:6.3-samples Cosign debug log
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Apparently it was a configuration issue on my end. The correct "nvcr.io/nvidia/deepstream": [
{
"type": "sigstoreSigned",
"keyPath": "/path/to/nvidia-key.pub",
"signedIdentity": {
"type":"exactRepository",
"dockerRepository": "canary.nvcr.io/nvidia/deepstream"
}
}
], I admit I only partially understand what happened here (looks like Nvidia is using a different identity for signing? Feel free to correct me on this) but everything is working as expected: Unsigned image [rhel9@localhost Desktop]$ podman pull nvcr.io/nvidia/deepstream:6.2-iot
Trying to pull nvcr.io/nvidia/deepstream:6.2-iot...
Error: Source image rejected: A signature was required, but no signature exists Signed image
|
Beta Was this translation helpful? Give feedback.
Apparently it was a configuration issue on my end. The correct
/etc/containers/policy.json
file is:I admit I only partially understand what happened here (looks like Nvidia is using a different identity for signing? Feel free to correct me on this) but everything is working as expected:
Unsigned image