Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 1359674 - [infrastructure_public_278]SCC rules can't apply to init containers
Summary: [infrastructure_public_278]SCC rules can't apply to init containers
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Pod
Version: 3.3.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: ---
Assignee: Andy Goldstein
QA Contact: DeShuai Ma
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-07-25 09:38 UTC by DeShuai Ma
Modified: 2016-09-19 14:29 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-09-19 14:29:51 UTC


Attachments (Terms of Use)


Links
System 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 13:24:36 UTC

Description DeShuai Ma 2016-07-25 09:38:01 UTC
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-26 01:44:19 UTC
Fixed in https://github.com/openshift/origin/pull/9973

Comment 2 Weihua Meng 2016-07-28 06:45:43 UTC
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.