Skip to content

Commit 411487b

Browse files
authored
Merge pull request #64230 from kelbrown20/create-new-docs-for-authentication-on-ms
OSDOCS#5491: Creating authentication docs for MicroShift
2 parents dce4488 + 1c39a13 commit 411487b

File tree

5 files changed

+112
-0
lines changed

5 files changed

+112
-0
lines changed

_topic_maps/_topic_map_ms.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -432,6 +432,8 @@ Topics:
432432
File: microshift-operators
433433
- Name: Greenboot workload health check scripts
434434
File: microshift-greenboot-workload-scripts
435+
- Name: Pod security authentication and authorization
436+
File: microshift-authentication
435437
---
436438
Name: Backup and restore
437439
Dir: microshift_backup_and_restore
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
:_content-type: ASSEMBLY
2+
[id="authentication-with-microshift"]
3+
= Pod security authentication and authorization on {product-title}
4+
include::_attributes/attributes-microshift.adoc[]
5+
:context: authentication-microshift
6+
7+
== Understanding and managing pod security admission
8+
9+
Pod security admission is an implementation of the link:https://kubernetes.io/docs/concepts/security/pod-security-standards/[Kubernetes pod security standards]. Use pod security admission to restrict the behavior of pods.
10+
11+
include::modules/microshift-security-context-constraints.adoc[leveloffset=+1]
12+
13+
include::modules/microshift-viewing-security-context.adoc[leveloffset=+2]
14+
15+
include::modules/microshift-security-context-constraints-opting.adoc[leveloffset=+1]
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * microshift_running_apps/microshift-authentication.adoc
4+
5+
:_content-type: PROCEDURE
6+
[id="microshift-security-context-constraints-opting_{context}"]
7+
= Controlling pod security admission synchronization
8+
9+
You can enable or disable automatic pod security admission synchronization for most namespaces.
10+
11+
[IMPORTANT]
12+
====
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+
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`.
22+
23+
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.
24+
====
25+
26+
.Procedure
27+
28+
* For each namespace that you want to configure, set a value for the `security.openshift.io/scc.podSecurityLabelSync` label:
29+
** To disable pod security admission label synchronization in a namespace, set the value of the `security.openshift.io/scc.podSecurityLabelSync` label to `false`.
30+
+
31+
Run the following command:
32+
+
33+
[source,terminal]
34+
----
35+
$ oc label namespace <namespace> security.openshift.io/scc.podSecurityLabelSync=false
36+
----
37+
** To enable pod security admission label synchronization in a namespace, set the value of the `security.openshift.io/scc.podSecurityLabelSync` label to `true`.
38+
+
39+
Run the following command:
40+
+
41+
[source,terminal]
42+
----
43+
$ oc label namespace <namespace> security.openshift.io/scc.podSecurityLabelSync=true
44+
----
45+
46+
[NOTE]
47+
====
48+
You can use the --overwrite flag to reverse the effects of the pod security label synchronization in a namespace.
49+
====
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * microshift_running_apps/microshift-authentication.adoc
4+
5+
:_content-type: CONCEPT
6+
[id="microshift-security-context-constraints_{context}"]
7+
8+
= Security context constraint synchronization with pod security standards
9+
10+
{product-title} includes link:https://kubernetes.io/docs/concepts/security/pod-security-admission[Kubernetes pod security admission]. Globally, the `restricted` profile is enforced by default for {product-title}.
11+
12+
In addition to the global pod security admission control configuration, a controller exists that applies pod security admission control `warn` and `audit` labels to namespaces according to the security context constraint (SCC) permissions of the service accounts that are in a given namespace.
13+
14+
[IMPORTANT]
15+
====
16+
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.
17+
====
18+
19+
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 found in the namespace to prevent warnings and audit logging as pods are created.
20+
21+
Namespace labeling is based on consideration of namespace-local service account privileges.
22+
23+
Applying pods directly might use the SCC privileges of the user who runs the pod. However, user privileges are not considered during automatic labeling.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * microshift_running_apps/microshift-authentication.adoc
4+
5+
:_content-type: PROCEDURE
6+
[id="microshift-viewing-security-context_{context}"]
7+
= Viewing security context constraints in a namespace
8+
9+
MicroShift allows you to access the security context constraints (SCC) permissions in a given namespace.
10+
11+
.Prerequisites
12+
13+
* You have installed the OpenShift CLI (`oc`)
14+
15+
.Procedure
16+
17+
* To view the security context constraints in your namespace, run the following command:
18+
+
19+
[source,terminal]
20+
----
21+
oc get --show-labels namespace <namespace>
22+
----
23+

0 commit comments

Comments
 (0)