Blame SOURCES/scap-security-guide-0.1.61-remove_tmux_process_running_check-PR_8246.patch

ff1465
commit e5b8b968d882aa8fa1795dcabf185781f59b5671
ff1465
Author: Watson Sato <wsato@redhat.com>
ff1465
Date:   Mon Feb 28 12:01:18 2022 +0100
ff1465
ff1465
    Manual edited patch scap-security-guide-0.1.61-remove_tmux_process_running_check-PR_8246.patch.
ff1465
ff1465
diff --git a/linux_os/guide/system/accounts/accounts-physical/screen_locking/console_screen_locking/configure_bashrc_exec_tmux/oval/shared.xml b/linux_os/guide/system/accounts/accounts-physical/screen_locking/console_screen_locking/configure_bashrc_exec_tmux/oval/shared.xml
ff1465
index 4cb2f9e..58f91ea 100644
ff1465
--- a/linux_os/guide/system/accounts/accounts-physical/screen_locking/console_screen_locking/configure_bashrc_exec_tmux/oval/shared.xml
ff1465
+++ b/linux_os/guide/system/accounts/accounts-physical/screen_locking/console_screen_locking/configure_bashrc_exec_tmux/oval/shared.xml
ff1465
@@ -4,7 +4,6 @@
ff1465
     <criteria comment="Check exec tmux configured at the end of bashrc" operator="AND">
ff1465
       
ff1465
         test_ref="test_configure_bashrc_exec_tmux" />
ff1465
-      <criterion comment="check tmux is running" test_ref="test_tmux_running"/>
ff1465
     </criteria>
ff1465
   </definition>
ff1465
   
ff1465
@@ -18,13 +17,4 @@
ff1465
     <ind:pattern operation="pattern match">if \[ "\$PS1" \]; then\n\s+parent=\$\(ps -o ppid= -p \$\$\)\n\s+name=\$\(ps -o comm= -p \$parent\)\n\s+case "\$name" in sshd\|login\) exec tmux ;; esac\nfi</ind:pattern>
ff1465
     <ind:instance datatype="int" operation="greater than or equal">1</ind:instance>
ff1465
   </ind:textfilecontent54_object>
ff1465
-
ff1465
-  <unix:process58_test check="all" id="test_tmux_running" comment="is tmux running" version="1">
ff1465
-      <unix:object object_ref="obj_tmux_running"/>
ff1465
-  </unix:process58_test>
ff1465
-
ff1465
-  <unix:process58_object id="obj_tmux_running" version="1">
ff1465
-      <unix:command_line operation="pattern match">^tmux(?:|[\s]+.*)$</unix:command_line>
ff1465
-      <unix:pid datatype="int" operation="greater than">0</unix:pid>
ff1465
-  </unix:process58_object>
ff1465
 </def-group>
ff1465
diff --git a/linux_os/guide/system/accounts/accounts-physical/screen_locking/console_screen_locking/configure_bashrc_exec_tmux/rule.yml b/linux_os/guide/system/accounts/accounts-physical/screen_locking/console_screen_locking/configure_bashrc_exec_tmux/rule.yml
ff1465
index 6be090b..0e4db6d 100644
ff1465
--- a/linux_os/guide/system/accounts/accounts-physical/screen_locking/console_screen_locking/configure_bashrc_exec_tmux/rule.yml
ff1465
+++ b/linux_os/guide/system/accounts/accounts-physical/screen_locking/console_screen_locking/configure_bashrc_exec_tmux/rule.yml
ff1465
@@ -8,19 +8,11 @@ description: |-
ff1465
     The <tt>tmux</tt> terminal multiplexer is used to implement
ff1465
     automatic session locking. It should be started from
ff1465
     <tt>/etc/bashrc</tt> or drop-in files within <tt>/etc/profile.d/</tt>.
ff1465
-    Additionally it must be ensured that the <tt>tmux</tt> process is running
ff1465
-    and it can be verified with the following command:
ff1465
-    
ps all | grep tmux | grep -v grep
ff1465
 
ff1465
 rationale: |-
ff1465
     Unlike <tt>bash</tt> itself, the <tt>tmux</tt> terminal multiplexer
ff1465
     provides a mechanism to lock sessions after period of inactivity.
ff1465
 
ff1465
-warnings:
ff1465
-  - general: |-
ff1465
-        The remediation does not start the tmux process, so it must be
ff1465
-        manually started or have the system rebooted after applying the fix.
ff1465
-
ff1465
 severity: medium
ff1465
 
ff1465
 identifiers:
ff1465
@@ -33,7 +25,7 @@ references:
ff1465
     srg: SRG-OS-000031-GPOS-00012,SRG-OS-000028-GPOS-00009
ff1465
     stigid@rhel8: RHEL-08-020041
ff1465
 
ff1465
-ocil_clause: 'exec tmux is not present at the end of bashrc or tmux process is not running'
ff1465
+ocil_clause: 'exec tmux is not present at the end of bashrc'
ff1465
 
ff1465
 ocil: |-
ff1465
     To verify that tmux is configured to execute,
ff1465
@@ -45,9 +37,5 @@ ocil: |-
ff1465
       name=$(ps -o comm= -p $parent)
ff1465
       case "$name" in sshd|login) exec tmux ;; esac
ff1465
     fi
ff1465
-    To verify that the tmux process is running,
ff1465
-    run the following command:
ff1465
-    
ps all | grep tmux | grep -v grep
ff1465
-    If the command does not produce output, this is a finding.
ff1465
 
ff1465
 platform: machine
ff1465
diff --git a/linux_os/guide/system/accounts/accounts-physical/screen_locking/console_screen_locking/configure_bashrc_exec_tmux/tests/correct_value.pass.sh b/linux_os/guide/system/accounts/accounts-physical/screen_locking/console_screen_locking/configure_bashrc_exec_tmux/tests/correct_value.pass.sh
ff1465
index 221c186..fbc7590 100644
ff1465
--- a/linux_os/guide/system/accounts/accounts-physical/screen_locking/console_screen_locking/configure_bashrc_exec_tmux/tests/correct_value.pass.sh
ff1465
+++ b/linux_os/guide/system/accounts/accounts-physical/screen_locking/console_screen_locking/configure_bashrc_exec_tmux/tests/correct_value.pass.sh
ff1465
@@ -9,4 +9,3 @@ if [ "$PS1" ]; then
ff1465
 fi
ff1465
 EOF
ff1465
 
ff1465
-tmux new-session -s root -d
ff1465
diff --git a/linux_os/guide/system/accounts/accounts-physical/screen_locking/console_screen_locking/configure_bashrc_exec_tmux/tests/correct_value_d_directory.pass.sh b/linux_os/guide/system/accounts/accounts-physical/screen_locking/console_screen_locking/configure_bashrc_exec_tmux/tests/correct_value_d_directory.pass.sh
ff1465
index 1702bb1..6107f86 100644
ff1465
--- a/linux_os/guide/system/accounts/accounts-physical/screen_locking/console_screen_locking/configure_bashrc_exec_tmux/tests/correct_value_d_directory.pass.sh
ff1465
+++ b/linux_os/guide/system/accounts/accounts-physical/screen_locking/console_screen_locking/configure_bashrc_exec_tmux/tests/correct_value_d_directory.pass.sh
ff1465
@@ -10,4 +10,3 @@ if [ "$PS1" ]; then
ff1465
 fi
ff1465
 EOF
ff1465
 
ff1465
-tmux new-session -s root -d
ff1465
diff --git a/linux_os/guide/system/accounts/accounts-physical/screen_locking/console_screen_locking/configure_bashrc_exec_tmux/tests/tmux_not_running.fail.sh b/linux_os/guide/system/accounts/accounts-physical/screen_locking/console_screen_locking/configure_bashrc_exec_tmux/tests/tmux_not_running.fail.sh
ff1465
deleted file mode 100644
ff1465
index 6cb9d83..0000000
ff1465
--- a/linux_os/guide/system/accounts/accounts-physical/screen_locking/console_screen_locking/configure_bashrc_exec_tmux/tests/tmux_not_running.fail.sh
ff1465
+++ /dev/null
ff1465
@@ -1,13 +0,0 @@
ff1465
-#!/bin/bash
ff1465
-# packages = tmux
ff1465
-# remediation = none
ff1465
-
ff1465
-cat >> /etc/bashrc <<'EOF'
ff1465
-if [ "$PS1" ]; then
ff1465
-  parent=$(ps -o ppid= -p $$)
ff1465
-  name=$(ps -o comm= -p $parent)
ff1465
-  case "$name" in sshd|login) exec tmux ;; esac
ff1465
-fi
ff1465
-EOF
ff1465
-
ff1465
-killall tmux || true
ff1465
diff --git a/linux_os/guide/system/accounts/accounts-physical/screen_locking/console_screen_locking/configure_bashrc_exec_tmux/tests/wrong_value.fail.sh b/linux_os/guide/system/accounts/accounts-physical/screen_locking/console_screen_locking/configure_bashrc_exec_tmux/tests/wrong_value.fail.sh
ff1465
index f13a8b0..9b46165 100644
ff1465
--- a/linux_os/guide/system/accounts/accounts-physical/screen_locking/console_screen_locking/configure_bashrc_exec_tmux/tests/wrong_value.fail.sh
ff1465
+++ b/linux_os/guide/system/accounts/accounts-physical/screen_locking/console_screen_locking/configure_bashrc_exec_tmux/tests/wrong_value.fail.sh
ff1465
@@ -101,5 +101,3 @@ if [ -z "$BASHRCSOURCED" ]; then
ff1465
 fi
ff1465
 # vim:ts=4:sw=4
ff1465
 EOF
ff1465
-
ff1465
-tmux new-session -s root -d