Bug 2120979 - PodSecurity violation error on OCP 4.12
Summary: PodSecurity violation error on OCP 4.12
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: OpenShift Developer Tools and Services
Classification: Red Hat
Component: Source-To-Image
Version: 4.12
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ---
: 4.11
Assignee: Corey Daley
QA Contact: Pavel Macik
Preeti Chandrashekar
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-08-24 08:36 UTC by Daniel Čihák
Modified: 2023-04-03 02:14 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-02-22 18:09:46 UTC
Target Upstream Version:
Embargoed:
cdaley: needinfo-
cdaley: needinfo-
cdaley: needinfo-


Attachments (Terms of Use)
Complete logs of the test run (1.14 MB, application/zip)
2022-08-24 08:36 UTC, Daniel Čihák
no flags Details
BuildConfig for HttpNodePortTest#nodePortTest (1.65 KB, application/octet-stream)
2022-09-05 11:02 UTC, Daniel Čihák
no flags Details
BuildConfig (1.65 KB, application/octet-stream)
2022-09-06 14:16 UTC, Daniel Čihák
no flags Details

Description Daniel Čihák 2022-08-24 08:36:16 UTC
Created attachment 1907330 [details]
Complete logs of the test run

Description of problem:

HttpNodePortTest#nodePortTest and HttpsNodePortTest#nodePortTest (https://gitlab.hosts.mwqe.eng.bos.redhat.com/jbossqe-eap/openshift-eap-tests/-/blob/7.4.x/test-eap/src/test/java/com/redhat/xpaas/eap/nodeport/HttpNodePortTest.java) are tests in the OpenShift test suite testing building and deploying simple application using S2I.

On OCP 4.12 this test started to fail with the error message

Invoking command: curl -k http://192.169.3.127:32736 on node sdntmvxd-nfnkk-worker-0-qtndd failed.
 Error output is: error: PodSecurity violation error:
Ensure the target namespace has the appropriate security level set or consider creating a dedicated privileged namespace using:
 "oc create ns <namespace> -o yaml | oc label -f - pod-security.kubernetes.io/enforce=privileged pod-security.kubernetes.io/audit=privileged pod-security.kubernetes.io/warn=privileged".

Original error:
pods "sdntmvxd-nfnkk-worker-0-qtndd-debug" is forbidden: violates PodSecurity "restricted:v1.24": host namespaces (hostNetwork=true, hostPID=true, hostIPC=true), privileged (container "container-00" must not set securityContext.privileged=true), allowPrivilegeEscalation != false (container "container-00" must set securityContext.allowPrivilegeEscalation=false), unrestricted capabilities (container "container-00" must set securityContext.capabilities.drop=["ALL"]), restricted volume types (volume "host" uses restricted volume type "hostPath"), runAsNonRoot != true (pod or container "container-00" must set securityContext.runAsNonRoot=true), runAsUser=0 (container "container-00" must not set runAsUser=0), seccompProfile (pod or container "container-00" must set securityContext.seccompProfile.type to "RuntimeDefault" or "Localhost")

Complete tes logs and pod logs are attached.

Steps to Reproduce:
1. git clone git.mwqe.eng.bos.redhat.com:jbossqe-eap/openshift-eap-tests.git
2. cd openshift-eap-tests
3. mvn clean test -P74-openjdk11,eap-pit-xp3 -Dtest=HttpNodePortTest#nodePortTest

Additional info:

Issue occured on the OCP PIT test environment: https://main-jenkins-csb-interopqe.apps.ocp-c1.prod.psi.redhat.com/job/OpenShiftIntegratedProducts/job/jbosseap-7.4-openshift-4/65/

According to the error message pod security changes on OCP might be possible cause of this issue: https://connect.redhat.com/blog/important-openshift-changes-pod-security-standards

Comment 1 Daniel Čihák 2022-08-31 08:03:49 UTC
Hello, is there any progress with this? Thanks.

Comment 2 Divyanshu Agrawal 2022-09-02 08:09:19 UTC
@dcihak Can you please share the buildConfig? It would help us to understand the problem better. Thanks.

Comment 3 Daniel Čihák 2022-09-05 11:02:05 UTC
Created attachment 1909603 [details]
BuildConfig for HttpNodePortTest#nodePortTest

Hello, attached BuildConfig used when running HttpNodePortTest#nodePortTest on OCP 4.12 (https://api.cpqe412-5-nyej.eapqe.psi.redhat.com:6443).

Comment 4 Daniel Čihák 2022-09-06 13:17:41 UTC
@diagrawa Required buildConfig was attached, if you need anything else from us, don't hesitate to ask.

Comment 5 Divyanshu Agrawal 2022-09-06 14:05:24 UTC
Hi, seems like I don't have access to view the attachment. Can you please check again?

Comment 6 Daniel Čihák 2022-09-06 14:16:20 UTC
Created attachment 1909804 [details]
BuildConfig

Comment 7 Daniel Čihák 2022-09-06 14:19:19 UTC
@Divyanshu Agrawal Sorry, I made the file private accidentally, it should work now.

Comment 8 Daniel Čihák 2022-09-13 07:23:45 UTC
@diagrawa Hello, is there any progress with this issue? If you need any cooperation from us please don't hesitate to ask. Thanks.

Comment 9 Divyanshu Agrawal 2022-09-19 07:38:15 UTC
Hi, we started looking into the issue. Will post an update as soon as possible. Thanks!

Comment 10 Daniel Čihák 2022-10-10 08:19:18 UTC
@diagrawa Hello, do you have any update for this issue? Thanks.

Comment 12 Daniel Čihák 2023-02-23 07:56:35 UTC
@cdaley ok, thanks for the explanation.


Note You need to log in before you can comment on or make changes to this bug.