Skip to content

Commit fa397ea

Browse files
authored
Merge pull request #30197 from bergerhoffer/BZ-1931838
BZ-1931838: Removing the ALL option and additional clarification
2 parents 1db8e88 + be61d0c commit fa397ea

File tree

2 files changed

+25
-27
lines changed

2 files changed

+25
-27
lines changed

modules/security-context-constraints-about.adoc

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,6 @@ If you have `cluster-admin` privileges, you can adjust the default SCC policies
3131
be more permissive.
3232
////
3333

34-
Docker has a
35-
link:https://docs.docker.com/engine/reference/run/#runtime-privilege-and-linux-capabilities[default list of capabilities]
36-
that are allowed for each container of a pod. The
37-
containers use the capabilities from this default list, but pod manifest authors
38-
can alter it by requesting additional capabilities or removing some of the
39-
default behaviors. Use the `allowedCapabilities`, `defaultAddCapabilities`, and
40-
`requiredDropCapabilities` parameters to control such requests from the
41-
pods and to dictate which capabilities can be requested, which ones must be
42-
added to each container, and which ones must be forbidden.
43-
4434
The cluster contains eight default SCCs:
4535

4636
* `anyuid`
@@ -123,6 +113,20 @@ values.
123113

124114
|===
125115

116+
CRI-O has the following default list of capabilities that are allowed for each container of a pod:
117+
118+
* `CHOWN`
119+
* `DAC_OVERRIDE`
120+
* `FSETID`
121+
* `FOWNER`
122+
* `SETGID`
123+
* `SETUID`
124+
* `SETPCAP`
125+
* `NET_BIND_SERVICE`
126+
* `KILL`
127+
128+
The containers use the capabilities from this default list, but pod manifest authors can alter it by requesting additional capabilities or removing some of the default behaviors. Use the `allowedCapabilities`, `defaultAddCapabilities`, and `requiredDropCapabilities` parameters to control such requests from the pods and to dictate which capabilities can be requested, which ones must be added to each container, and which ones must be forbidden.
129+
126130
[id="authorization-SCC-strategies_{context}"]
127131
== SCC Strategies
128132

modules/security-context-constraints-creating.adoc

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,16 @@
55
[id="security-context-constraints-creating_{context}"]
66
= Creating security context constraints
77

8-
You can create security context constraints (SCCs) by using the CLI.
8+
You can create security context constraints (SCCs) by using the OpenShift CLI (`oc`).
99

1010
.Prerequisites
1111

12-
* You must install the `oc` command line.
13-
* Your account must have `cluster-admin` privileges to create SCCs.
12+
* Install the OpenShift CLI (`oc`).
13+
* Log in to the cluster as a user with the `cluster-admin` role.
1414

1515
.Procedure
1616

17-
. Define the SCC in a JSON or YAML file:
17+
. Define the SCC in a YAML file named `scc_admin.yaml`:
1818
+
1919
.`SecurityContextConstraints` object definition
2020
[source,yaml]
@@ -38,9 +38,9 @@ groups:
3838
- my-admin-group
3939
----
4040
+
41-
Optionally, you can add drop capabilities to an SCC by setting the
41+
Optionally, you can specify drop capabilities for an SCC by setting the
4242
`requiredDropCapabilities` field with the desired values. Any specified
43-
capabilities will be dropped from the container. For example, to create an SCC
43+
capabilities are dropped from the container. For example, to create an SCC
4444
with the `KILL`, `MKNOD`, and `SYS_CHROOT` required drop capabilities, add
4545
the following to the SCC object:
4646
+
@@ -52,17 +52,9 @@ requiredDropCapabilities:
5252
- SYS_CHROOT
5353
----
5454
+
55-
You can see the list of possible values in the
56-
link:https://docs.docker.com/engine/reference/run/#runtime-privilege-and-linux-capabilities[Docker
57-
documentation].
58-
+
59-
[TIP]
60-
====
61-
Because capabilities are passed to the Docker, you can use a special `ALL` value
62-
to drop all possible capabilities.
63-
====
55+
CRI-O supports the same list of capability values that are found in the link:https://docs.docker.com/engine/reference/run/#runtime-privilege-and-linux-capabilities[Docker documentation].
6456

65-
. Then, run `oc create` passing the file to create it:
57+
. Create the SCC by passing in the file:
6658
+
6759
[source,terminal]
6860
----
@@ -75,7 +67,9 @@ $ oc create -f scc_admin.yaml
7567
securitycontextconstraints "scc-admin" created
7668
----
7769

78-
. Verify that the SCC was created:
70+
.Verification
71+
72+
* Verify that the SCC was created:
7973
+
8074
[source,terminal]
8175
----

0 commit comments

Comments
 (0)