Skip to content

Commit ece3555

Browse files
authored
Merge pull request #64343 from bergerhoffer/OSDOCS-7528
OSDOCS#7528: Reorganizing namespace exclusions and disabling after mo…
2 parents f39867b + c4ca723 commit ece3555

5 files changed

+61
-20
lines changed

authentication/understanding-and-managing-pod-security-admission.adoc

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,19 @@ Pod security admission is an implementation of the link:https://kubernetes.io/do
1111
// About pod security admission
1212
include::modules/security-context-constraints-psa-about.adoc[leveloffset=+1]
1313

14-
// Security context constraint synchronization with pod security standards
14+
// About pod security admission synchronization
1515
include::modules/security-context-constraints-psa-synchronization.adoc[leveloffset=+1]
1616

17+
// Pod security admission synchronization namespace exclusions
18+
include::modules/security-context-constraints-psa-sync-exclusions.adoc[leveloffset=+2]
19+
1720
// Controlling pod security admission synchronization
1821
include::modules/security-context-constraints-psa-opting.adoc[leveloffset=+1]
1922

23+
.Additional resources
24+
25+
* xref:../authentication/understanding-and-managing-pod-security-admission.adoc#security-context-constraints-psa-sync-exclusions_understanding-and-managing-pod-security-admission[Pod security admission synchronization namespace exclusions]
26+
2027
// Configuring pod security admission for a namespace
2128
include::modules/security-context-constraints-psa-label.adoc[leveloffset=+1]
2229

modules/security-context-constraints-psa-opting.adoc

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,7 @@ You can enable or disable automatic pod security admission synchronization for m
1010

1111
[IMPORTANT]
1212
====
13-
Namespaces that are defined as part of the cluster payload have pod security admission synchronization disabled permanently. These namespaces include:
14-
15-
* `default`
16-
* `kube-node-lease`
17-
* `kube-system`
18-
* `kube-public`
19-
* `openshift`
20-
* All system-created namespaces that are prefixed with `openshift-`, except for `openshift-operators`
21-
22-
By default, all namespaces that have an `openshift-` prefix are not synchronized. You can enable synchronization for any user-created [x-]`openshift-*` namespaces. You cannot enable synchronization for any system-created [x-]`openshift-*` namespaces, except for `openshift-operators`.
23-
24-
If an Operator is installed in a user-created `openshift-*` namespace, synchronization is turned on by default after a cluster service version (CSV) is created in the namespace. The synchronized label inherits the permissions of the service accounts in the namespace.
13+
You cannot enable pod security admission synchronization on some system-created namespaces. For more information, see _Pod security admission synchronization namespace exclusions_.
2514
====
2615

2716
.Procedure
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * authentication/understanding-and-managing-pod-security-admission.adoc
4+
// * operators/operator_sdk/osdk-complying-with-psa.adoc
5+
6+
:_content-type: CONCEPT
7+
[id="security-context-constraints-psa-sync-exclusions_{context}"]
8+
= Pod security admission synchronization namespace exclusions
9+
10+
Pod security admission synchronization is permanently disabled on most system-created namespaces. Synchronization is also initially disabled on user-created `openshift-*` prefixed namespaces, but you can enable synchronization on them later.
11+
12+
[IMPORTANT]
13+
====
14+
If a pod security admission label (`pod-security.kubernetes.io/<mode>`) is manually modified from the automatically labeled value on a label-synchronized namespace, synchronization is disabled for that label.
15+
16+
If necessary, you can enable synchronization again by using one of the following methods:
17+
18+
* By removing the modified pod security admission label from the namespace
19+
* By setting the `security.openshift.io/scc.podSecurityLabelSync` label to `true`
20+
+
21+
If you force synchronization by adding this label, then any modified pod security admission labels will be overwritten.
22+
====
23+
24+
[discrete]
25+
== Permanently disabled namespaces
26+
27+
Namespaces that are defined as part of the cluster payload have pod security admission synchronization disabled permanently. The following namespaces are permanently disabled:
28+
29+
* `default`
30+
* `kube-node-lease`
31+
* `kube-system`
32+
* `kube-public`
33+
* `openshift`
34+
* All system-created namespaces that are prefixed with `openshift-`, except for `openshift-operators`
35+
36+
[discrete]
37+
== Initially disabled namespaces
38+
39+
By default, all namespaces that have an `openshift-` prefix have pod security admission synchronization disabled initially. You can enable synchronization for user-created [x-]`openshift-*` namespaces and for the `openshift-operators` namespace.
40+
41+
[NOTE]
42+
====
43+
You cannot enable synchronization for any system-created [x-]`openshift-*` namespaces, except for `openshift-operators`.
44+
====
45+
46+
If an Operator is installed in a user-created `openshift-*` namespace, synchronization is enabled automatically after a cluster service version (CSV) is created in the namespace. The synchronized label is derived from the permissions of the service accounts in the namespace.

modules/security-context-constraints-psa-synchronization.adoc

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,11 @@
55

66
:_content-type: CONCEPT
77
[id="security-context-constraints-psa-synchronization_{context}"]
8-
= Security context constraint synchronization with pod security standards
8+
= About pod security admission synchronization
99

1010
In addition to the global pod security admission control configuration, a controller applies pod security admission control `warn` and `audit` labels to namespaces according to the SCC permissions of the service accounts that are in a given namespace.
1111

12-
[IMPORTANT]
13-
====
14-
Namespaces that are defined as part of the cluster payload have pod security admission synchronization disabled permanently. You can enable pod security admission synchronization on other namespaces as necessary. If an Operator is installed in a user-created `openshift-*` namespace, synchronization is turned on by default after a cluster service version (CSV) is created in the namespace.
15-
====
16-
17-
The controller examines `ServiceAccount` object permissions to use security context constraints in each namespace. Security context constraints (SCCs) are mapped to pod security profiles based on their field values; the controller uses these translated profiles. Pod security admission `warn` and `audit` labels are set to the most privileged pod security profile in the namespace to prevent displaying warnings and logging audit events when pods are created.
12+
The controller examines `ServiceAccount` object permissions to use security context constraints in each namespace. Security context constraints (SCCs) are mapped to pod security profiles based on their field values; the controller uses these translated profiles. Pod security admission `warn` and `audit` labels are set to the most privileged pod security profile in the namespace to prevent displaying warnings and logging audit events when pods are created.
1813

1914
Namespace labeling is based on consideration of namespace-local service account privileges.
2015

operators/operator_sdk/osdk-complying-with-psa.adoc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ For more information, see xref:../../authentication/understanding-and-managing-p
2020
include::modules/security-context-constraints-psa-about.adoc[leveloffset=+1]
2121

2222
include::modules/security-context-constraints-psa-synchronization.adoc[leveloffset=+1]
23+
24+
// Pod security admission synchronization namespace exclusions
25+
include::modules/security-context-constraints-psa-sync-exclusions.adoc[leveloffset=+2]
26+
2327
include::modules/osdk-ensuring-operator-workloads-run-restricted-psa.adoc[leveloffset=+1]
2428

2529
[role="_additional-resources"]

0 commit comments

Comments
 (0)