Skip to content

Commit c2791dc

Browse files
authored
Merge pull request #34585 from mburke5678/BZ-1928021
BZ#1928021: Restricting container registries in Configuring image settings
2 parents 6c75b2f + ae9a147 commit c2791dc

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

modules/images-configuration-file.adoc

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// * post_installation_configuration/preparing-for-users.adoc
55

66
[id="images-configuration-file_{context}"]
7-
= Configuring image settings
7+
= Configuring image registry settings
88

99
You can configure image registry settings by editing the `image.config.openshift.io/cluster` custom resource (CR). The Machine Config Operator (MCO) watches the `image.config.openshift.io/cluster` CR for any changes to the registries and reboots the nodes when it detects changes.
1010

@@ -44,6 +44,7 @@ spec:
4444
- quay.io
4545
- registry.redhat.io
4646
- image-registry.openshift-image-registry.svc:5000
47+
- reg1.io/myrepo/myapp:latest
4748
insecureRegistries:
4849
- insecure.com
4950
status:
@@ -52,11 +53,15 @@ status:
5253
<1> `Image`: Holds cluster-wide information about how to handle images. The canonical, and only valid name is `cluster`.
5354
<2> `allowedRegistriesForImport`: Limits the container image registries from which normal users may import images. Set this list to the registries that you trust to contain valid images, and that you want applications to be able to import from. Users with permission to create images or `ImageStreamMappings` from the API are not affected by this policy. Typically only cluster administrators have the appropriate permissions.
5455
<3> `additionalTrustedCA`: A reference to a config map containing additional certificate authorities (CA) that are trusted during image stream import, pod image pull, `openshift-image-registry` pullthrough, and builds. The namespace for this config map is `openshift-config`. The format of the config map is to use the registry hostname as the key, and the PEM certificate as the value, for each additional registry CA to trust.
55-
<4> `registrySources`: Contains configuration that determines how the container runtime should treat individual registries when accessing images for builds and pods. For instance, whether or not to allow insecure access. It does not contain configuration for the internal cluster registry. This example lists `allowedRegistries`, which defines the registries that are allowed to be used. One of the registries listed is insecure.
56+
<4> `registrySources`: Contains configuration that determines whether the container runtime allows or blocks individual registries when accessing images for builds and pods. Either the `allowedRegistries` parameter or the `blockedRegistries` parameter can be set, but not both. You can also define whether or not to allow access to insecure registries or registries that allow registries that use image short names. This example uses the `allowedRegistries` parameter, which defines the registries that are allowed to be used. The insecure registry `insecure.com` is also allowed. The `registrySources` paramter does not contain configuration for the internal cluster registry.
5657
+
5758
[NOTE]
5859
====
60+
When the `allowedRegistries` parameter is defined, all registries, including the registry.redhat.io and quay.io registries and the default internal image registry, are blocked unless explicitly listed. If you use the parameter, to prevent pod failure, you must add the `registry.redhat.io` and `quay.io` registries and the `internalRegistryHostname` to the `allowedRegistries` list, as they are required by payload images within your environment. Do not add the `registry.redhat.io` and `quay.io` registries to the `blockedRegistries` list.
61+
5962
When using the `allowedRegistries`, `blockedRegistries`, or `insecureRegistries` parameter, you can specify an individual repository within a registry. For example: `reg1.io/myrepo/myapp:latest`.
63+
64+
Insecure external registries should be avoided to reduce possible security risks.
6065
====
6166

6267
. To check that the changes are applied, list your nodes:

post_installation_configuration/preparing-for-users.adoc

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -118,18 +118,16 @@ include::modules/authentication-kubeadmin.adoc[leveloffset=+1]
118118
include::modules/authentication-remove-kubeadmin.adoc[leveloffset=+2]
119119

120120
[id="post-install-image-configuration-resources"]
121-
== Image configuration resources
121+
== Image configuration
122122
Understand and configure image registry settings.
123123

124124
include::modules/images-configuration-parameters.adoc[leveloffset=+2]
125125

126126
include::modules/images-configuration-file.adoc[leveloffset=+2]
127127

128-
include::modules/images-configuration-cas.adoc[leveloffset=+3]
129-
130-
include::modules/images-configuration-insecure.adoc[leveloffset=+3]
128+
For more information on the allowed, blocked, and insecure registry parameters, see xref:../openshift_images/image-configuration.adoc#images-configuration-file_image-configuration[Configuring image registry settings].
131129

132-
include::modules/images-configuration-shortname.adoc[leveloffset=+3]
130+
include::modules/images-configuration-cas.adoc[leveloffset=+3]
133131

134132
include::modules/images-configuration-registry-mirror.adoc[leveloffset=+3]
135133

0 commit comments

Comments
 (0)