Bug 2117374
| Summary: | Improve Pod Admission failure for restricted-v2 denials that pass with restricted | ||
|---|---|---|---|
| Product: | OpenShift Container Platform | Reporter: | Chris Johnson <cdjohnson> |
| Component: | apiserver-auth | Assignee: | David Eads <deads> |
| Status: | CLOSED ERRATA | QA Contact: | zhou ying <yinzhou> |
| Severity: | urgent | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 4.11 | CC: | akashem, kangell, mfojtik, surbania |
| Target Milestone: | --- | ||
| Target Release: | 4.13.0 | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | If docs needed, set a value | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2023-05-17 22:46:56 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
|
Description
Chris Johnson
2022-08-10 19:42:38 UTC
checked with latest version , the issue has fixed:
[root@localhost tmp]# oc get clusterversion
NAME VERSION AVAILABLE PROGRESSING SINCE STATUS
version 4.13.0-0.nightly-2022-11-13-214426 True False 47m Cluster version is 4.13.0-0.nightly-2022-11-13-214426
Created deploy with following :
cat ddd.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
annotations:
labels:
app: hello-openshift
app.kubernetes.io/component: hello-openshift
app.kubernetes.io/instance: hello-openshift
name: hello-openshift
spec:
progressDeadlineSeconds: 600
replicas: 1
revisionHistoryLimit: 10
selector:
matchLabels:
deployment: hello-openshift
strategy:
rollingUpdate:
maxSurge: 25%
maxUnavailable: 25%
type: RollingUpdate
template:
metadata:
annotations:
openshift.io/generated-by: OpenShiftNewApp
creationTimestamp: null
labels:
deployment: hello-openshift
spec:
containers:
- image: openshift/hello-openshift@sha256:aaea76ff622d2f8bcb32e538e7b3cd0ef6d291953f3e7c9f556c1ba5baf47e2e
imagePullPolicy: IfNotPresent
name: hello-openshift
ports:
- containerPort: 8888
protocol: TCP
- containerPort: 8080
protocol: TCP
resources: {}
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
securityContext:
allowPrivilegeEscalation: true
dnsPolicy: ClusterFirst
restartPolicy: Always
schedulerName: default-scheduler
securityContext: {}
terminationGracePeriodSeconds: 30
the pod falied with events:
[root@localhost tmp]# oc get events
LAST SEEN TYPE REASON OBJECT MESSAGE
111s Warning FailedCreate replicaset/hello-openshift-58fd4d74c7 Error creating: pods "hello-openshift-58fd4d74c7-" is forbidden: unable to validate against any security context constraint: [provider "anyuid": Forbidden: not usable by user or serviceaccount, spec.containers[0].securityContext.allowPrivilegeEscalation: Invalid value: true: Allowing privilege escalation for containers is not allowed, provider "restricted": Forbidden: not usable by user or serviceaccount, provider "nonroot-v2": Forbidden: not usable by user or serviceaccount, provider "nonroot": Forbidden: not usable by user or serviceaccount, provider "hostmount-anyuid": Forbidden: not usable by user or serviceaccount, provider "machine-api-termination-handler": Forbidden: not usable by user or serviceaccount, provider "hostnetwork-v2": Forbidden: not usable by user or serviceaccount, provider "hostnetwork": Forbidden: not usable by user or serviceaccount, provider "hostaccess": Forbidden: not usable by user or serviceaccount, provider "node-exporter": Forbidden: not usable by user or serviceaccount, provider "privileged": Forbidden: not usable by user or serviceaccount, no access to scc/restricted: Forbidden: the pod fails to validate against the `restricted-v2` security context constraint, but would validate successfully against the `restricted` security context constraint]
8m5s Normal ScalingReplicaSet deployment/hello-openshift Scaled up replica set hello-openshift-58fd4d74c7 to 1
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory (Important: OpenShift Container Platform 4.13.0 security update), and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHSA-2023:1326 |