This documentation is for a release that is no longer maintained
See documentation for the latest supported version 3 or the latest supported version 4.1.4. Container image signatures
Red Hat delivers signatures for the images in the Red Hat Container Registries. Those signatures can be automatically verified when being pulled to OpenShift Container Platform 4 clusters by using the Machine Config Operator (MCO).
Quay.io serves most of the images that make up OpenShift Container Platform, and only the release image is signed. Release images refer to the approved OpenShift Container Platform images, offering a degree of protection against supply chain attacks. However, some extensions to OpenShift Container Platform, such as logging, monitoring, and service mesh, are shipped as Operators from the Operator Lifecycle Manager (OLM). Those images ship from the Red Hat Ecosystem Catalog Container images registry.
To verify the integrity of those images between Red Hat registries and your infrastructure, enable signature verification.
Enabling container signature validation requires files that link the registry URLs to the sigstore and then specifies the keys which verify the images.
Procedure
Create the files that link the registry URLs to the sigstore and that specifies the key to verify the image.
Create the
policy.json
file:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Create the
registry.access.redhat.com.yaml
file:cat <<EOF > registry.access.redhat.com.yaml docker: registry.access.redhat.com: sigstore: https://access.redhat.com/webassets/docker/content/sigstore EOF
$ cat <<EOF > registry.access.redhat.com.yaml docker: registry.access.redhat.com: sigstore: https://access.redhat.com/webassets/docker/content/sigstore EOF
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Create the
registry.redhat.io.yaml
file:cat <<EOF > registry.redhat.io.yaml docker: registry.redhat.io: sigstore: https://registry.redhat.io/containers/sigstore EOF
$ cat <<EOF > registry.redhat.io.yaml docker: registry.redhat.io: sigstore: https://registry.redhat.io/containers/sigstore EOF
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Set the files with a
base64
encode format that will be used for the machine config template:export ARC_REG=$( cat registry.access.redhat.com.yaml | base64 -w0 ) export RIO_REG=$( cat registry.redhat.io.yaml | base64 -w0 ) export POLICY_CONFIG=$( cat policy.json | base64 -w0 )
$ export ARC_REG=$( cat registry.access.redhat.com.yaml | base64 -w0 ) $ export RIO_REG=$( cat registry.redhat.io.yaml | base64 -w0 ) $ export POLICY_CONFIG=$( cat policy.json | base64 -w0 )
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Create a machine config that writes the exported files to disk on the worker nodes:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Apply the created machine config:
oc apply -f 51-worker-rh-registry-trust.yaml
$ oc apply -f 51-worker-rh-registry-trust.yaml
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Create a machine config, which writes the exported files to disk on the master nodes:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Apply the master machine config changes to the cluster:
oc apply -f 51-master-rh-registry-trust.yaml
$ oc apply -f 51-master-rh-registry-trust.yaml
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
After you apply the machine configs to the cluster, the Machine Config Controller detects the new MachineConfig
object and generates a new rendered-worker-<hash>
version.
Prerequisites
- You enabled signature verification by using a machine config file.
Procedure
On the command line, run the following command to display information about a desired worker:
oc describe machineconfigpool/worker
$ oc describe machineconfigpool/worker
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Copy to Clipboard Copied! Toggle word wrap Toggle overflow Run the
oc describe
command again:oc describe machineconfigpool/worker
$ oc describe machineconfigpool/worker
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Copy to Clipboard Copied! Toggle word wrap Toggle overflow 注意The
Observed Generation
parameter shows an increased count based on the generation of the controller-produced configuration. This controller updates this value even if it fails to process the specification and generate a revision. TheConfiguration Source
value points to the51-worker-rh-registry-trust
configuration.Confirm that the
policy.json
file exists with the following command:oc debug node/<node> -- chroot /host cat /etc/containers/policy.json
$ oc debug node/<node> -- chroot /host cat /etc/containers/policy.json
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Copy to Clipboard Copied! Toggle word wrap Toggle overflow Confirm that the
registry.redhat.io.yaml
file exists with the following command:oc debug node/<node> -- chroot /host cat /etc/containers/registries.d/registry.redhat.io.yaml
$ oc debug node/<node> -- chroot /host cat /etc/containers/registries.d/registry.redhat.io.yaml
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Starting pod/<node>-debug ... To use host binaries, run `chroot /host` docker: registry.redhat.io: sigstore: https://registry.redhat.io/containers/sigstore
Starting pod/<node>-debug ... To use host binaries, run `chroot /host` docker: registry.redhat.io: sigstore: https://registry.redhat.io/containers/sigstore
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Confirm that the
registry.access.redhat.com.yaml
file exists with the following command:oc debug node/<node> -- chroot /host cat /etc/containers/registries.d/registry.access.redhat.com.yaml
$ oc debug node/<node> -- chroot /host cat /etc/containers/registries.d/registry.access.redhat.com.yaml
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Starting pod/<node>-debug ... To use host binaries, run `chroot /host` docker: registry.access.redhat.com: sigstore: https://access.redhat.com/webassets/docker/content/sigstore
Starting pod/<node>-debug ... To use host binaries, run `chroot /host` docker: registry.access.redhat.com: sigstore: https://access.redhat.com/webassets/docker/content/sigstore
Copy to Clipboard Copied! Toggle word wrap Toggle overflow