Skip to content

Commit 98f1ae5

Browse files
authored
Merge pull request #48451 from pneedle-rh/osdocs-3196-updating-scc-content
OSDOCS-3196 - Updating SCC content for OSD and ROSA
2 parents 8ec28c7 + bbecb04 commit 98f1ae5

File tree

4 files changed

+93
-30
lines changed

4 files changed

+93
-30
lines changed

authentication/managing-security-context-constraints.adoc

Lines changed: 41 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,50 @@ include::_attributes/common-attributes.adoc[]
66

77
toc::[]
88

9+
In {product-title}, you can use security context constraints (SCCs) to control permissions for the pods in your cluster.
10+
11+
Default SCCs are created during installation and when you install some Operators or other components. As a cluster administrator, you can also create your own SCCs by using the OpenShift CLI (`oc`).
12+
13+
[IMPORTANT]
14+
====
15+
Do not modify the default SCCs. Customizing the default SCCs can lead to issues when some of the platform pods deploy or
16+
ifndef::openshift-rosa[]
17+
{product-title}
18+
endif::[]
19+
ifdef::openshift-rosa[]
20+
ROSA
21+
endif::openshift-rosa[]
22+
is upgraded. Additionally, the default SCC values are reset to the defaults during some cluster upgrades, which discards all customizations to those SCCs.
23+
ifdef::openshift-origin,openshift-enterprise,openshift-webscale,openshift-dedicated,openshift-rosa[]
24+
25+
Instead of modifying the default SCCs, create and modify your own SCCs as needed. For detailed steps, see xref:../authentication/managing-security-context-constraints.adoc#security-context-constraints-creating_configuring-internal-oauth[Creating security context constraints].
26+
endif::[]
27+
====
28+
29+
ifdef::openshift-dedicated[]
30+
[NOTE]
31+
====
32+
In {product-title} deployments, you can create your own SCCs only for clusters that use the Customer Cloud Subscription (CCS) model. You cannot create SCCs for {product-title} clusters that use a Red Hat cloud account, because SCC resource creation requires `cluster-admin` privileges.
33+
====
34+
endif::openshift-dedicated[]
35+
936
include::modules/security-context-constraints-about.adoc[leveloffset=+1]
1037
include::modules/security-context-constraints-pre-allocated-values.adoc[leveloffset=+1]
1138
include::modules/security-context-constraints-example.adoc[leveloffset=+1]
12-
13-
// This section shouldn't show on OSD
14-
ifndef::openshift-dedicated[]
1539
include::modules/security-context-constraints-creating.adoc[leveloffset=+1]
16-
endif::[]
17-
// End Exclusion
18-
1940
include::modules/security-context-constraints-rbac.adoc[leveloffset=+1]
2041
include::modules/security-context-constraints-command-reference.adoc[leveloffset=+1]
42+
43+
[role="_additional-resources"]
44+
[id="additional-resources_configuring-internal-oauth"]
45+
== Additional resources
46+
47+
ifndef::openshift-dedicated,openshift-rosa[]
48+
* xref:../support/getting-support.adoc#getting-support[Getting support]
49+
endif::[]
50+
ifdef::openshift-dedicated[]
51+
* xref:../osd_architecture/osd-support.adoc#osd-getting-support[Getting support]
52+
endif::[]
53+
ifdef::openshift-rosa[]
54+
* xref:../rosa_architecture/rosa-getting-support.adoc#rosa-getting-support[Getting support]
55+
endif::[]

modules/security-context-constraints-about.adoc

Lines changed: 27 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@
66
[id="security-context-constraints-about_{context}"]
77
= About security context constraints
88

9-
Similar to the way that RBAC resources control user access, administrators can use _security context constraints_ (SCCs) to control permissions for pods. These permissions include actions that a pod can perform and what resources it can access. You can use SCCs to define a set of conditions that a pod must run with to be accepted into the system.
9+
Similar to the way that RBAC resources control user access, administrators can use security context constraints (SCCs) to control permissions for pods. These permissions determine the actions that a pod can perform and what resources it can access. You can use SCCs to define a set of conditions that a pod must run with to be accepted into the system.
1010

1111
Security context constraints allow an administrator to control:
1212

13-
* Whether a pod can run privileged containers with the `allowPrivilegedContainer` flag.
14-
* Whether a pod is constrained with the `allowPrivilegeEscalation` flag.
13+
* Whether a pod can run privileged containers with the `allowPrivilegedContainer` flag
14+
* Whether a pod is constrained with the `allowPrivilegeEscalation` flag
1515
* The capabilities that a container can request
1616
* The use of host directories as volumes
1717
* The SELinux context of the container
@@ -35,10 +35,17 @@ The cluster contains several default security context constraints (SCCs) as desc
3535

3636
[IMPORTANT]
3737
====
38-
Do not modify the default SCCs. Customizing the default SCCs can lead to issues when some of the platform pods deploy or {product-title} is upgraded. During upgrades between some versions of {product-title}, the values of the default SCCs are reset to the default values, which discards all customizations to those SCCs.
38+
Do not modify the default SCCs. Customizing the default SCCs can lead to issues when some of the platform pods deploy or
39+
ifndef::openshift-rosa[]
40+
{product-title}
41+
endif::[]
42+
ifdef::openshift-rosa[]
43+
ROSA
44+
endif::openshift-rosa[]
45+
is upgraded. Additionally, the default SCC values are reset to the defaults during some cluster upgrades, which discards all customizations to those SCCs.
46+
ifdef::openshift-origin,openshift-enterprise,openshift-webscale,openshift-dedicated,openshift-rosa[]
3947
40-
ifdef::openshift-origin,openshift-enterprise,openshift-webscale[]
41-
Instead, create new SCCs as needed.
48+
Instead of modifying the default SCCs, create and modify your own SCCs as needed. For detailed steps, see _Creating security context constraints_.
4249
endif::[]
4350
====
4451

@@ -293,12 +300,22 @@ pre-allocated values. Uses the minimum value of the first range as the default.
293300
Validates against the first ID in the first range.
294301
* `RunAsAny` - No default provided. Allows any `fsGroup` ID to be specified.
295302

296-
ifndef::openshift-dedicated[]
297303
[id="authorization-controlling-volumes_{context}"]
304+
ifndef::openshift-dedicated[]
298305
== Controlling volumes
299-
300-
The usage of specific volume types can be controlled by setting the `volumes`
301-
field of the SCC. The allowable values of this field correspond to the volume
306+
endif::openshift-dedicated[]
307+
ifdef::openshift-dedicated[]
308+
== Controlling volumes for CCS clusters
309+
endif::openshift-dedicated[]
310+
311+
The usage of specific volume types
312+
ifdef::openshift-dedicated[]
313+
for {product-title} with Customer Cloud Subscription (CCS) clusters
314+
endif::openshift-dedicated[]
315+
can be controlled by setting the `volumes`
316+
field of the SCC.
317+
318+
The allowable values of this field correspond to the volume
302319
sources that are defined when creating a volume:
303320

304321
* link:https://kubernetes.io/docs/concepts/storage/volumes/#awselasticblockstore[`awsElasticBlockStore`]
@@ -347,8 +364,6 @@ settings in the `volumes` field. For example, if `allowHostDirVolumePlugin`
347364
is set to false but allowed in the `volumes` field, then the `hostPath`
348365
value will be removed from `volumes`.
349366
====
350-
endif::[]
351-
352367

353368
[id="admission_{context}"]
354369
== Admission control

modules/security-context-constraints-creating.adoc

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,36 @@
44

55
:_content-type: PROCEDURE
66
[id="security-context-constraints-creating_{context}"]
7+
ifndef::openshift-dedicated[]
78
= Creating security context constraints
9+
endif::[]
10+
ifdef::openshift-dedicated[]
11+
= Creating security context constraints for CCS clusters
12+
endif::[]
813

914
You can create security context constraints (SCCs) by using the OpenShift CLI (`oc`).
1015

16+
[IMPORTANT]
17+
====
18+
Creating and modifying your own SCCs are advanced operations that might cause instability to your cluster. If you have questions about using your own SCCs, contact Red Hat Support. For information about contacting Red Hat support, see _Getting support_.
19+
====
20+
21+
ifdef::openshift-dedicated[]
22+
[NOTE]
23+
====
24+
In {product-title} deployments, you can create your own SCCs only for clusters that use the Customer Cloud Subscription (CCS) model. You cannot create SCCs for {product-title} clusters that use a Red Hat cloud account, because SCC resource creation requires `cluster-admin` privileges.
25+
====
26+
endif::openshift-dedicated[]
27+
1128
.Prerequisites
1229

1330
* Install the OpenShift CLI (`oc`).
1431
* Log in to the cluster as a user with the `cluster-admin` role.
1532
1633
.Procedure
1734

18-
. Define the SCC in a YAML file named `scc_admin.yaml`:
35+
. Define the SCC in a YAML file named `scc-admin.yaml`:
1936
+
20-
.`SecurityContextConstraints` object definition
2137
[source,yaml]
2238
----
2339
kind: SecurityContextConstraints
@@ -39,11 +55,7 @@ groups:
3955
- my-admin-group
4056
----
4157
+
42-
Optionally, you can drop specific capabilities for an SCC by setting the
43-
`requiredDropCapabilities` field with the desired values. Any specified
44-
capabilities are dropped from the container. To drop all capabilities, specify `ALL`. For example, to create an SCC
45-
that drops the `KILL`, `MKNOD`, and `SYS_CHROOT` capabilities, add
46-
the following to the SCC object:
58+
Optionally, you can drop specific capabilities for an SCC by setting the `requiredDropCapabilities` field with the desired values. Any specified capabilities are dropped from the container. To drop all capabilities, specify `ALL`. For example, to create an SCC that drops the `KILL`, `MKNOD`, and `SYS_CHROOT` capabilities, add the following to the SCC object:
4759
+
4860
[source,yaml]
4961
----
@@ -65,7 +77,7 @@ CRI-O supports the same list of capability values that are found in the link:htt
6577
+
6678
[source,terminal]
6779
----
68-
$ oc create -f scc_admin.yaml
80+
$ oc create -f scc-admin.yaml
6981
----
7082
+
7183
.Example output

modules/security-context-constraints-example.adoc

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ users: <9>
5454
- system:serviceaccount:default:registry
5555
- system:serviceaccount:default:router
5656
- system:serviceaccount:openshift-infra:build-controller
57-
volumes:
57+
volumes: <10>
5858
- '*'
5959
----
6060

@@ -68,13 +68,14 @@ security context.
6868
<5> A list of capabilities to drop from a pod. Or, specify `ALL` to drop all
6969
capabilities.
7070
<6> The `runAsUser` strategy type, which dictates the allowable values for the
71-
Security Context.
71+
security context.
7272
//could use the available strategies
7373
<7> The `seLinuxContext` strategy type, which dictates the allowable values for
74-
the Security Context.
74+
the security context.
7575
<8> The `supplementalGroups` strategy, which dictates the allowable supplemental
76-
groups for the Security Context.
76+
groups for the security context.
7777
<9> The users who can access this SCC.
78+
<10> The allowable volume types for the security context. In the example, `*` allows the use of all volume types.
7879

7980
The `users` and `groups` fields on the SCC control which users can access the
8081
SCC.

0 commit comments

Comments
 (0)