Description of problem:
With the introduction of the Pod Security Adminssion, the recommended best practice is to enforce the `restricted` policy of admission. However, if the user creates the CatalogSource in the namespace running with `restricted` policy, the CatalogSource Pod fails to be created. This is because when the `.spec.grpcPodConfig.securityContextConfig` is NOT SET in the CatalogSource, OLM treats the value's default as "legacy", which means that the Catalog Pod does NOT set the `restricted` securityContext, meaning that a Catalog pod will fail to run.
Version-Release number of selected component (if applicable):
4.15
How reproducible:
100%
Steps to Reproduce:
1. On a OCP 4.15 cluster, create a custom CatalogSource object without `.spec.grpcPodConfig.securityContextConfig` being specified 2. See if the CatalogSource Pod started successfully without errors.
Actual results:
1. the CatalogSource Pod fails to be created with the error like:
status: message: >- couldn't ensure registry server - error ensuring pod: : error creating new pod: foobar-: pods "foobar-6ttkb" is forbidden: violates PodSecurity "restricted:v1.24": allowPrivilegeEscalation != false (container "registry-server" must set securityContext.allowPrivilegeEscalation=false), unrestricted capabilities (container "registry-server" must set securityContext.capabilities.drop=["ALL"]), runAsNonRoot != true (pod or container "registry-server" must set securityContext.runAsNonRoot=true), seccompProfile (pod or container "registry-server" must set securityContext.seccompProfile.type to "RuntimeDefault" or "Localhost") reason: RegistryServerError
Expected results:
The CatalogSource Pod started successfully by default without specifying `.spec.grpcPodConfig.securityContextConfig` as `restricted`
Additional info:
- clones
-
OCPBUGS-29729 OLM - Set default CatalogSource pod SecurityContext as `restricted`
- Closed
- depends on
-
OCPBUGS-29729 OLM - Set default CatalogSource pod SecurityContext as `restricted`
- Closed
- is related to
-
RFE-5122 Update OLM to set default CatalogSource pod SecurityContext based on Namespace PSA Labels
- Accepted
-
OCPBUGS-5473 [4.13] Default CatalogSource aren't created in restricted mode
- Closed
- links to
-
RHBA-2024:4469 OpenShift Container Platform 4.16.z bug fix update