Skip to contentSkip to conversation

Update manpages to reflect that runtime SELinux disable is deprecated

PATCH In review Ondrej Mosnacek 2 participants 6 messages Nov 11, 2020 – Nov 12, 2020 SELinux security module

lore
Share & tools
lore
#0 lore raw

v2 cover Update manpages to reflect that runtime SELinux disable is deprecated

SSIA

Ondrej Mosnacek (3):
selinux(8): mark up SELINUX values
selinux(8): explain that runtime disable is deprecated selinux_config(5): add a note that runtime disable is deprecated

 libselinux/man/man8/selinux.8             | 42 ++++++++++++++++-------
 policycoreutils/man/man5/selinux_config.5 |  2 +-
 2 files changed, 31 insertions(+), 13 deletions(-)
Signature · 1 line
2.26.2
#1 lore raw

PATCH v2 1/3 selinux(8): mark up SELINUX values

Mark up the possible values of SELINUX (disabled, permissive, enforcing) for better readability.

---
 libselinux/man/man8/selinux.8 | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)
libselinux/man/man8/selinux.8 +12 -12
index 31364271..2afe6d3d 100644
@@ -19,18 +19,18 @@ enabled or disabled, and if enabled, whether SELinux operates in
 permissive mode or enforcing mode.  The
 .B SELINUX
 variable may be set to
-any one of disabled, permissive, or enforcing to select one of these
-options.  The disabled option completely disables the SELinux kernel
-and application code, leaving the system running without any SELinux
-protection.  The permissive option enables the SELinux code, but
-causes it to operate in a mode where accesses that would be denied by
-policy are permitted but audited.  The enforcing option enables the
-SELinux code and causes it to enforce access denials as well as
-auditing them.  Permissive mode may yield a different set of denials
-than enforcing mode, both because enforcing mode will prevent an
-operation from proceeding past the first denial and because some
-application code will fall back to a less privileged mode of operation
-if denied access.
+any one of \fIdisabled\fR, \fIpermissive\fR, or \fIenforcing\fR to
+select one of these options.  The \fIdisabled\fR option completely
+disables the SELinux kernel and application code, leaving the system
+running without any SELinux protection.  The \fIpermissive\fR option
+enables the SELinux code, but causes it to operate in a mode where
+accesses that would be denied by policy are permitted but audited.  The
+\fIenforcing\fR option enables the SELinux code and causes it to enforce
+access denials as well as auditing them.  \fIpermissive\fR mode may
+yield a different set of denials than enforcing mode, both because
+enforcing mode will prevent an operation from proceeding past the first
+denial and because some application code will fall back to a less
+privileged mode of operation if denied access.
 
 The
 .I /etc/selinux/config
Signature · 1 line
2.26.2
#2 lore raw

PATCH v2 2/3 selinux(8): explain that runtime disable is deprecated

In reply to Ondrej Mosnacek

Update the main SELinux manpage to explain that runtime disable (i.e. disabling SELinux using SELINUX=Disabled) is deprecated and recommend disabling SELinux only via the kernel boot parameter.

---
 libselinux/man/man8/selinux.8 | 22 ++++++++++++++++++++--
 1 file changed, 20 insertions(+), 2 deletions(-)
libselinux/man/man8/selinux.8 +20 -2
index 2afe6d3d..0ef01460 100644
@@ -20,8 +20,8 @@ permissive mode or enforcing mode.  The
 .B SELINUX
 variable may be set to
 any one of \fIdisabled\fR, \fIpermissive\fR, or \fIenforcing\fR to
-select one of these options.  The \fIdisabled\fR option completely
-disables the SELinux kernel and application code, leaving the system
+select one of these options.  The \fIdisabled\fR disables most of the
+SELinux kernel and application code, leaving the system
 running without any SELinux protection.  The \fIpermissive\fR option
 enables the SELinux code, but causes it to operate in a mode where
 accesses that would be denied by policy are permitted but audited.  The
@@ -32,6 +32,24 @@ enforcing mode will prevent an operation from proceeding past the first
 denial and because some application code will fall back to a less
 privileged mode of operation if denied access.
 
+.B NOTE:
+Disabling SELinux by setting
+.B SELINUX=disabled
+in
+.I /etc/selinux/config
+is deprecated and depending on kernel version and configuration it might
+not lead to SELinux being completely disabled.  Specifically, the
+SELinux hooks will still be executed internally, but the SELinux policy
+will not be loaded and no operation will be denied.  In such state, the
+system will act as if SELinux was disabled, although some operations
+might behave slightly differently.  To properly disable SELinux, it is
+recommended to use the
+.B selinux=0
+kernel boot option instead.  In that case SELinux will be disabled
+regardless of what is set in the
+.I /etc/selinux/config
+file.
+
 The
 .I /etc/selinux/config
 configuration file also controls what policy
Signature · 1 line
2.26.2
#3 lore raw

PATCH v2 3/3 selinux_config(5): add a note that runtime disable is deprecated

In reply to Ondrej Mosnacek

...and refer to selinux(8), which explains it further.

---
 policycoreutils/man/man5/selinux_config.5 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
policycoreutils/man/man5/selinux_config.5 +1 -1
index 1ffade15..8d56a559 100644
@@ -48,7 +48,7 @@ SELinux security policy is enforced.
 .IP \fIpermissive\fR 4
 SELinux security policy is not enforced but logs the warnings (i.e. the action is allowed to proceed).
 .IP \fIdisabled\fR
-SELinux is disabled and no policy is loaded.
+No SELinux policy is loaded.  This option was used to disable SELinux completely, which is now deprected.  Use the \fBselinux=0\fR kernel boot option instead (see \fBselinux\fR(8)).
 .RE
 .sp
 The entry can be determined using the \fBsestatus\fR(8) command or \fBselinux_getenforcemode\fR(3).
Signature · 1 line
2.26.2
Acked-by on v2 3/3
#4 lore raw

Re: [PATCH userspace v2 3/3] selinux_config(5): add a note that runtime disable is deprecated

Quoted 13 lines · Ondrej Mosnacek

...and refer to selinux(8), which explains it further.

---
 policycoreutils/man/man5/selinux_config.5 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
policycoreutils/man/man5/selinux_config.5 +0 -0
index 1ffade15..8d56a559 100644

policycoreutils/man/man5/selinux_config.5 SELinux security policy is enforced. · line 51

Quoted 5 lines
policycoreutils/man/man5/selinux_config.5 +1 -1
@@ -48,7 +48,7 @@ SELinux security policy is enforced.
 .IP \fIpermissive\fR 4
 SELinux security policy is not enforced but logs the warnings (i.e. the action is allowed to proceed).
 .IP \fIdisabled\fR
-SELinux is disabled and no policy is loaded.
+No SELinux policy is loaded.  This option was used to disable SELinux completely, which is now deprected.  Use the \fBselinux=0\fR kernel boot option instead (see \fBselinux\fR(8)).

Hi, there is a misspelling here: deprected -> deprecated. Otherwise the 3 patches look good to me, thanks!

Nicolas

#5 lore raw

Re: [PATCH userspace v2 3/3] selinux_config(5): add a note that runtime disable is deprecated

Quoted 24 lines · Nicolas Iooss
Quoted 13 lines · Ondrej Mosnacek

...and refer to selinux(8), which explains it further.

---
 policycoreutils/man/man5/selinux_config.5 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
policycoreutils/man/man5/selinux_config.5 +0 -0
index 1ffade15..8d56a559 100644

policycoreutils/man/man5/selinux_config.5 SELinux security policy is enforced. · line 51

Quoted 5 lines
policycoreutils/man/man5/selinux_config.5 +1 -1
@@ -48,7 +48,7 @@ SELinux security policy is enforced.
 .IP \fIpermissive\fR 4
 SELinux security policy is not enforced but logs the warnings (i.e. the action is allowed to proceed).
 .IP \fIdisabled\fR
-SELinux is disabled and no policy is loaded.
+No SELinux policy is loaded.  This option was used to disable SELinux completely, which is now deprected.  Use the \fBselinux=0\fR kernel boot option instead (see \fBselinux\fR(8)).

Hi, there is a misspelling here: deprected -> deprecated. Otherwise the 3 patches look good to me, thanks!

Quoted 1 line

Merged.

Thanks,
Nicolas