Blame SOURCES/scap-security-guide-0.1.50-fix_sysctl_rules_description.patch

247868
From 99ad87babd43c95dc2787ba7e0301b3d2b650ab9 Mon Sep 17 00:00:00 2001
247868
From: =?UTF-8?q?Mat=C4=9Bj=20T=C3=BD=C4=8D?= <matyc@redhat.com>
247868
Date: Tue, 10 Mar 2020 13:44:23 +0100
247868
Subject: [PATCH 1/3] Fix description of sysctl rules.
247868
247868
As there is no way how to make the project aware of sysctl parameter defaults
247868
in Linux upstream kernel or in specific Linux distributions,
247868
the parameter has to be explicitly specified in a config file.
247868
---
247868
 shared/macros.jinja | 4 ++--
247868
 1 file changed, 2 insertions(+), 2 deletions(-)
247868
247868
diff --git a/shared/macros.jinja b/shared/macros.jinja
247868
index 8a25acc937..ce27536dc2 100644
247868
--- a/shared/macros.jinja
247868
+++ b/shared/macros.jinja
247868
@@ -602,8 +602,8 @@ ocil_clause: "the correct value is not returned"
247868
     run the following command:
247868
     
$ sudo sysctl -w {{{ sysctl }}}={{{ value }}}
247868
 
247868
-    If this is not the system default value, add the following line to a file in the
247868
-    directory <tt>/etc/sysctl.d</tt>:
247868
+    To make sure that the setting is persistent,
247868
+    add the following line to a file in the directory <tt>/etc/sysctl.d</tt>:
247868
     
{{{ sysctl }}} = {{{ value }}}
247868
 {{%- endmacro %}}
247868
 
247868
247868
From 5bffa9dc3d62f67364abb034b7da877935156764 Mon Sep 17 00:00:00 2001
247868
From: =?UTF-8?q?Mat=C4=9Bj=20T=C3=BD=C4=8D?= <matyc@redhat.com>
247868
Date: Wed, 11 Mar 2020 16:14:13 +0100
247868
Subject: [PATCH 2/3] Improved the OCIL entry for sysctl rules.
247868
247868
---
247868
 shared/macros.jinja | 19 +++++++++++--------
247868
 1 file changed, 11 insertions(+), 8 deletions(-)
247868
247868
diff --git a/shared/macros.jinja b/shared/macros.jinja
247868
index ce27536dc2..f81dbc7de6 100644
247868
--- a/shared/macros.jinja
247868
+++ b/shared/macros.jinja
247868
@@ -577,15 +577,18 @@ ocil_clause: "{{{ sebool }}} is not enabled"
247868
 
247868
 
247868
 {{% macro ocil_sysctl_option_value(sysctl, value) -%}}
247868
-    The status of the {{{ sysctl }}} kernel parameter can be queried
247868
-    by running the following command:
247868
-    
$ sysctl {{{ sysctl }}}
247868
-    The output of the command should indicate a value of {{{ value }}}.
247868
-    If this value is not the default value, investigate how it could have been
247868
-    adjusted at runtime, and verify it is not set improperly. This has to be checked
247868
-    in all files in the <tt>/etc/sysctl.d</tt> directory and the deprecated
247868
-    /etc/sysctl.conf. You can verify this by running the following command:
247868
+    The persistent kernel parameter configuration is performed by specifying the appropriate
247868
+    assignment in any file located in the 
/etc/sysctl.d
directory.
247868
+    Verify that there is not any existing incorrect configuration by executing the following command:
247868
+    
$ grep -r '^\s*{{{ sysctl }}}\s*=' /etc/sysctl.conf /etc/sysctl.d
247868
+    If any other assignments that 
247868
+    
{{{ sysctl }}} = {{{ value }}}
247868
+    are found, or the correct assignment is duplicated, remove those offending lines from respective files,
247868
+    and make sure that exactly one file in 
247868
+    /etc/sysctl.d contains {{{ sysctl }}} = {{{ value }}}, and that one assignment
247868
+    is returned when 
247868
     
$ grep -r {{{ sysctl }}} /etc/sysctl.conf /etc/sysctl.d
247868
+    is executed.
247868
 {{%- endmacro %}}
247868
 
247868
 
247868
247868
From 5b5edc64773be690e4046dc88de9407d7c470702 Mon Sep 17 00:00:00 2001
247868
From: =?UTF-8?q?Mat=C4=9Bj=20T=C3=BD=C4=8D?= <matyc@redhat.com>
247868
Date: Thu, 12 Mar 2020 15:27:26 +0100
247868
Subject: [PATCH 3/3] Improved the text based on the reviewer feedback.
247868
247868
---
247868
 shared/macros.jinja | 9 ++++++++-
247868
 1 file changed, 8 insertions(+), 1 deletion(-)
247868
247868
diff --git a/shared/macros.jinja b/shared/macros.jinja
247868
index f81dbc7de6..edbaeeb56c 100644
247868
--- a/shared/macros.jinja
247868
+++ b/shared/macros.jinja
247868
@@ -577,11 +577,18 @@ ocil_clause: "{{{ sebool }}} is not enabled"
247868
 
247868
 
247868
 {{% macro ocil_sysctl_option_value(sysctl, value) -%}}
247868
+    The runtime status of the {{{ sysctl }}} kernel parameter can be queried
247868
+    by running the following command:
247868
+    
$ sysctl {{{ sysctl }}}
247868
+    The output of the command should indicate a value of {{{ value }}}.
247868
+    The preferable way how to assure the runtime compliance is to have
247868
+    correct persistent configuration, and rebooting the system.
247868
+
247868
     The persistent kernel parameter configuration is performed by specifying the appropriate
247868
     assignment in any file located in the 
/etc/sysctl.d
directory.
247868
     Verify that there is not any existing incorrect configuration by executing the following command:
247868
     
$ grep -r '^\s*{{{ sysctl }}}\s*=' /etc/sysctl.conf /etc/sysctl.d
247868
-    If any other assignments that 
247868
+    If any assignments other than
247868
     
{{{ sysctl }}} = {{{ value }}}
247868
     are found, or the correct assignment is duplicated, remove those offending lines from respective files,
247868
     and make sure that exactly one file in