Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1359674 - [infrastructure_public_278]SCC rules can't apply to init containers
[infrastructure_public_278]SCC rules can't apply to init containers
Status: CLOSED CURRENTRELEASE
Product: OpenShift Container Platform
Classification: Red Hat
Component: Pod (Show other bugs)
3.3.0
Unspecified Unspecified
medium Severity medium
: ---
: ---
Assigned To: Andy Goldstein
DeShuai Ma
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2016-07-25 05:38 EDT by DeShuai Ma
Modified: 2016-09-19 10:29 EDT (History)
6 users (show)

See Also:
Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-09-19 10:29:51 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2016:1933 normal SHIPPED_LIVE Red Hat OpenShift Container Platform 3.3 Release Advisory 2016-09-27 09:24:36 EDT

  None (edit)
Description DeShuai Ma 2016-07-25 05:38:01 EDT
Description of problem:
When use has restricted scc rule, it still can create privileged init container.

Version-Release number of selected component (if applicable):
openshift v3.3.0.9
kubernetes v1.3.0+57fb9ac
etcd 2.3.0+git

How reproducible:
Always

Steps to Reproduce:
1.Create a pod with privileged init container
$ oc create -f https://raw.githubusercontent.com/mdshuai/testfile-openshift/master/initContainer/init-containers-privilege.yaml

2.Check the pod scc rule and status
[root@dhcp-128-7 Desktop]# oc get pod hello-pod -o json | grep openshift.io/scc
            "openshift.io/scc": "restricted",
[root@dhcp-128-7 Desktop]# oc get pod
NAME        READY     STATUS    RESTARTS   AGE
hello-pod   1/1       Running   0          14m

Actual results:
2. The pod is running.

Expected results:
1. Should restrict to create privileged init container when user has no permission

Additional info:
restricted user can also exec to the privileged container.
Comment 1 Clayton Coleman 2016-07-25 21:44:19 EDT
Fixed in https://github.com/openshift/origin/pull/9973
Comment 2 Weihua Meng 2016-07-28 02:45:43 EDT
Fixed.
openshift v3.3.0.11
kubernetes v1.3.0+57fb9ac
etcd 2.3.0+git


# oc create -f https://raw.githubusercontent.com/mdshuai/testfile-openshift/master/initContainer/init-containers-privilege.yaml

Error from server: error when creating "https://raw.githubusercontent.com/mdshuai/testfile-openshift/master/initContainer/init-containers-privilege.yaml": pods "hello-pod" is forbidden: unable to validate against any security context constraint: [spec.initContainers[0].securityContext.privileged: Invalid value: true: Privileged containers are not allowed]

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