A security engineer is troubleshooting why signature verification fails when pulling an image from a trusted registry. The policy file (/etc/containers/policy.json) specifies 'signedBy' using a GPG key, but the transport uses 'dir://'. Where must the public GPG key be imported for Podman to successfully verify the signature?
Trap 1: Into ~/.config/containers/policy.d/keys/
Podman reads signature verification keys from the GPG keyring configured in policy.json, not from a policy.d keys directory, which is not a recognised lookup path. A per-user policy.d location is tempting because policy.json itself lives under /etc/containers, suggesting sibling directories hold related configuration.
Trap 2: Into /etc/containers/certs.d/keys/
/etc/containers/certs.d/ holds registry TLS certificate authorities for transport trust, not GPG keys for image signature verification. It is tempting because both directories sit under /etc/containers and both concern trusting a registry, but certs.d governs TLS, not signedBy.
Trap 3: Into /var/lib/containers/sigstore/
/var/lib/containers/sigstore/ stores signature and identity data for sigstore-based verification, not the GPG public keys referenced by signedBy. It is tempting because sigstore is a genuine container-signing mechanism, and would be the correct location when policy.json uses sigstore rather than GPG signedBy.
- A
Into the local GnuPG keyring using 'gpg --import'
For dir:// transports, Podman verifies signatures against keys in the local GnuPG keyring, so the public key must be imported there with gpg --import. Registry-scoped key files or policy entries alone do not satisfy verification for a directory transport.
- B
Into ~/.config/containers/policy.d/keys/
Why it fails: Podman reads signature verification keys from the GPG keyring configured in policy.json, not from a policy.d keys directory, which is not a recognised lookup path. A per-user policy.d location is tempting because policy.json itself lives under /etc/containers, suggesting sibling directories hold related configuration.
- C
Into /etc/containers/certs.d/keys/
Why it fails: /etc/containers/certs.d/ holds registry TLS certificate authorities for transport trust, not GPG keys for image signature verification. It is tempting because both directories sit under /etc/containers and both concern trusting a registry, but certs.d governs TLS, not signedBy.
- D
Into /var/lib/containers/sigstore/
Why it fails: /var/lib/containers/sigstore/ stores signature and identity data for sigstore-based verification, not the GPG public keys referenced by signedBy. It is tempting because sigstore is a genuine container-signing mechanism, and would be the correct location when policy.json uses sigstore rather than GPG signedBy.