Skip to content

Commit 31ff60f

Browse files
committed
Replaced SELinux disabling example with setting permissive mode
1 parent 2ed5ffa commit 31ff60f

File tree

1 file changed

+14
-12
lines changed

1 file changed

+14
-12
lines changed

modules/nodes-nodes-kernel-arguments.adoc

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,11 @@ Improper use of kernel arguments can result in your systems becoming unbootable.
1818

1919
Examples of kernel arguments you could set include:
2020

21-
* **selinux=0**: Disables Security Enhanced Linux (SELinux).
22-
While not recommended for production, disabling SELinux can
23-
improve performance by 2% - 3%.
21+
* **enforcing=0**: Configures Security Enhanced Linux (SELinux) to run in permissive mode.
22+
In permissive mode, the system acts as if SELinux is enforcing the loaded security policy,
23+
including labeling objects and emitting access denial entries in the logs,
24+
but it does not actually deny any operations. While not recommended for production systems,
25+
permissive mode can be helpful for debugging.
2426

2527
* **nosmt**: Disables symmetric multithreading (SMT) in the kernel.
2628
Multithreading allows multiple logical threads for each CPU.
@@ -68,7 +70,7 @@ rendered-master-23e785de7587df95a4b517e0647e5ab7 52dd3ba6a9a527fc3ab42afac8d12
6870
rendered-worker-5d596d9293ca3ea80c896a1191735bb1 52dd3ba6a9a527fc3ab42afac8d12b693534c8c9 3.2.0 33m
6971
----
7072

71-
. Create a `MachineConfig` object file that identifies the kernel argument (for example, `05-worker-kernelarg-selinuxoff.yaml`)
73+
. Create a `MachineConfig` object file that identifies the kernel argument (for example, `05-worker-kernelarg-selinuxpermissive.yaml`)
7274
+
7375
[source,yaml]
7476
----
@@ -77,25 +79,25 @@ kind: MachineConfig
7779
metadata:
7880
labels:
7981
machineconfiguration.openshift.io/role: worker<1>
80-
name: 05-worker-kernelarg-selinuxoff<2>
82+
name: 05-worker-kernelarg-selinuxpermissive<2>
8183
spec:
8284
config:
8385
ignition:
8486
version: 3.1.0
8587
kernelArguments:
86-
- selinux=0<3>
88+
- enforcing=0<3>
8789
----
8890
+
8991
<1> Applies the new kernel argument only to worker nodes.
9092
<2> Named to identify where it fits among the machine configs (05) and what it does (adds
91-
a kernel argument to turn off SELinux).
92-
<3> Identifies the exact kernel argument as `selinux=0`.
93+
a kernel argument to configure SELinux permissive mode).
94+
<3> Identifies the exact kernel argument as `enforcing=0`.
9395

9496
. Create the new machine config:
9597
+
9698
[source,terminal]
9799
----
98-
$ oc create -f 05-worker-kernelarg-selinuxoff.yaml
100+
$ oc create -f 05-worker-kernelarg-selinuxpermissive.yaml
99101
----
100102

101103
. Check the machine configs to see that the new one was added:
@@ -116,7 +118,7 @@ NAME GENERATEDBYCONTROLLER
116118
01-worker-container-runtime 52dd3ba6a9a527fc3ab42afac8d12b693534c8c9 3.2.0 33m
117119
01-worker-kubelet 52dd3ba6a9a527fc3ab42afac8d12b693534c8c9 3.2.0 33m
118120
119-
05-worker-kernelarg-selinuxoff 3.1.0 105s
121+
05-worker-kernelarg-selinuxpermissive 3.1.0 105s
120122
121123
99-master-generated-registries 52dd3ba6a9a527fc3ab42afac8d12b693534c8c9 3.2.0 33m
122124
99-master-ssh 3.1.0 40m
@@ -164,9 +166,9 @@ To use host binaries, run `chroot /host`
164166
sh-4.2# cat /host/proc/cmdline
165167
BOOT_IMAGE=/ostree/rhcos-... console=tty0 console=ttyS0,115200n8
166168
rootflags=defaults,prjquota rw root=UUID=fd0... ostree=/ostree/boot.0/rhcos/16...
167-
coreos.oem.id=qemu coreos.oem.id=ec2 ignition.platform.id=ec2 selinux=0
169+
coreos.oem.id=qemu coreos.oem.id=ec2 ignition.platform.id=ec2 enforcing=0
168170
169171
sh-4.2# exit
170172
----
171173
+
172-
You should see the `selinux=0` argument added to the other kernel arguments.
174+
You should see the `enforcing=0` argument added to the other kernel arguments.

0 commit comments

Comments
 (0)