Skip to content

Commit 218c97c

Browse files
committed
scc: create nested-container
Signed-off-by: Peter Hunt <[email protected]>
1 parent f460dc8 commit 218c97c

File tree

2 files changed

+79
-0
lines changed

2 files changed

+79
-0
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
apiVersion: rbac.authorization.k8s.io/v1
2+
kind: ClusterRole
3+
metadata:
4+
annotations:
5+
include.release.openshift.io/ibm-cloud-managed: "true"
6+
include.release.openshift.io/self-managed-high-availability: "true"
7+
include.release.openshift.io/single-node-developer: "true"
8+
rbac.authorization.kubernetes.io/autoupdate: "true"
9+
name: system:openshift:scc:nested-container
10+
rules:
11+
- apiGroups:
12+
- security.openshift.io
13+
resourceNames:
14+
- nested-container
15+
resources:
16+
- securitycontextconstraints
17+
verbs:
18+
- use
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
allowHostDirVolumePlugin: false
2+
allowHostIPC: false
3+
allowHostNetwork: false
4+
allowHostPID: false
5+
allowHostPorts: false
6+
allowPrivilegeEscalation: true
7+
allowPrivilegedContainer: false
8+
allowedCapabilities:
9+
- SETUID
10+
- SETGID
11+
apiVersion: security.openshift.io/v1
12+
defaultAddCapabilities:
13+
fsGroup:
14+
type: MustRunAs
15+
ranges:
16+
- min: 0
17+
max: 65534
18+
groups: []
19+
kind: SecurityContextConstraints
20+
metadata:
21+
annotations:
22+
include.release.openshift.io/ibm-cloud-managed: "true"
23+
include.release.openshift.io/self-managed-high-availability: "true"
24+
include.release.openshift.io/single-node-developer: "true"
25+
kubernetes.io/description: 'nested-container is specially tailored for running nested containers.
26+
It balances a tight security profile, while remaining loose enough to be useful to run nested containers in.
27+
In addition to requiring pods run with a user namespace, it allows SETUID and SETGID capabilities, requires the "container_engine_t" SELinux type,
28+
allows any users within the range of 0-65534, allows privilege escalation (to allow a container engine to run new{uid/gid}map), and allows any seccomp profile.
29+
Since any pods running within this SCC must use a user namespace ("hostUsers: false"), their actual UID/GID on the host will be
30+
allocated by the kubelet to be unprivileged, and any capabilities the pod is granted will not apply outside of the pods user namespace.'
31+
name: nested-container
32+
priority:
33+
readOnlyRootFilesystem: false
34+
requiredDropCapabilities:
35+
runAsUser:
36+
type: MustRunAsRange
37+
ranges:
38+
- min: 0
39+
max: 65534
40+
seLinuxContext:
41+
type: MustRunAs
42+
seLinuxOptions:
43+
type: container_engine_t
44+
seccompProfiles:
45+
- "*"
46+
supplementalGroups:
47+
type: MustRunAs
48+
ranges:
49+
- min: 0
50+
max: 65534
51+
users: []
52+
userNamespaceLevel: RequirePodLevel
53+
volumes:
54+
- configMap
55+
- csi
56+
- downwardAPI
57+
- emptyDir
58+
- ephemeral
59+
- persistentVolumeClaim
60+
- projected
61+
- secret

0 commit comments

Comments
 (0)