This bug has been migrated to another issue tracking site. It has been closed here and may no longer be being monitored.

If you would like to get updates for this issue, or to participate in it, you may do so at Red Hat Issue Tracker .
Bug 2193120 - Please explain the idea behing xccdf_org.ssgproject.content_rule_configure_bashrc_tmux rule ("Support session locking with tmux (not enforcing)")
Summary: Please explain the idea behing xccdf_org.ssgproject.content_rule_configure_ba...
Keywords:
Status: CLOSED MIGRATED
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: scap-security-guide
Version: 8.7
Hardware: All
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Vojtech Polasek
QA Contact: BaseOS QE Security Team
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-05-04 11:40 UTC by Renaud Métrich
Modified: 2023-08-10 13:47 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-08-10 13:47:17 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker   RHEL-1142 0 None Migrated None 2023-08-10 13:47:08 UTC
Red Hat Issue Tracker RHELPLAN-156403 0 None None None 2023-05-04 11:43:31 UTC

Description Renaud Métrich 2023-05-04 11:40:26 UTC
Description of problem:

With scap-security-guide, we ship 2 "similar" rules:

- xccdf_org.ssgproject.content_rule_configure_bashrc_tmux ("Support session locking with tmux (not enforcing)")

  which ships the following snippet:
  -------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------
  if [ "$PS1" ]; then
   parent=$(ps -o ppid= -p $$)
   name=$(ps -o comm= -p $parent)
   case "$name" in (sshd|login) tmux ;; esac
  fi
  -------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------

- xccdf_org.ssgproject.content_rule_configure_bashrc_exec_tmux ("Support session locking with tmux")

  which ships the following snippet:
  -------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------
  if [ "$PS1" ]; then
   parent=$(ps -o ppid= -p $$)
   name=$(ps -o comm= -p $parent)
   case "$name" in (sshd|login) exec tmux ;; esac
  fi
  -------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------

The difference being "exec tmux" in second rule, compared to just "tmux" in first rule.

Please explain why we ship xccdf_org.ssgproject.content_rule_configure_bashrc_tmux ("Support session locking with tmux (not enforcing)") at all, implementing this rule leads to non-sense when logging in, as shown in the example below:

1. ssh to the system

  --> tmux started and "tmux prompt" is displayed

2. exit from tmux

  --> initial "ssh" shell prompt is displayed


In a nutshell, once you do "ssh" on the system, you need to exit TWICE to get out of ssh. This is because it spawns "tmux" instead of "exec tmux" in first rule.
This doesn't make any sense to me.

Version-Release number of selected component (if applicable):

scap-security-guide

How reproducible:

Always, see above.

Comment 1 Watson Yuuma Sato 2023-05-04 15:43:15 UTC
Hi Renaud,

Thank you for the feedback.
The rule configure_bashrc_tmux was created to align with a change in RHEL-08-020041 RHEL8 STIG V1R9.
For reference: https://stigaview.com/products/rhel8/v1r9/RHEL-08-020041/

At the time of development we note the described behavior and briefly discussed the scope and impact of the change with DISA.
But as a STIG update is in effect the moment it is released, we opted to keep the profile aligned with the STIG guidance.

To minimize the impact of the change, we added a warning about this to the rule description:
"This rule configures Tmux to be executed in a way that exiting Tmux drops the user into a regular shell instead of logging them out, therefore the session locking mechanism is not enforced on the user."

We will get back with DISA to discuss RHEL-08-020041.

Comment 4 Renaud Métrich 2023-05-09 12:14:11 UTC
Thanks Watson for the explanation and reporting to DISA.

Comment 6 RHEL Program Management 2023-08-10 13:47:17 UTC
This BZ has been automatically migrated to the issues.redhat.com Red Hat Issue Tracker. All future work related to this report will be managed there.

To find the migrated issue, look in the "Links" section for a direct link to the new issue location. The issue key will have an icon of 2 footprints next to it, and begin with "RHEL-" followed by an integer.  You can also find this issue by visiting https://issues.redhat.com/issues/?jql= and searching the "Bugzilla Bug" field for this BZ's number, e.g. a search like:

"Bugzilla Bug" = 1234567

In the event you have trouble locating or viewing this issue, you can file an issue by sending mail to rh-issues.


Note You need to log in before you can comment on or make changes to this bug.