Uploaded image for project: 'RHEL'
  1. RHEL
  2. RHEL-1142

Please explain the idea behing xccdf_org.ssgproject.content_rule_configure_bashrc_tmux rule ("Support session locking with tmux (not enforcing)")

Linking RHIVOS CVEs to...Migration: Automation ...Sync from "Extern...XMLWordPrintable

    • None
    • Moderate
    • rhel-security-compliance
    • ssg_security
    • None
    • False
    • False
    • Hide

      None

      Show
      None
    • No
    • None
    • None
    • None
    • If docs needed, set a value
    • None
    • 57,005

      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.

              vpolasek@redhat.com Vojtech Polasek
              rhn-support-rmetrich Renaud Métrich
              Vojtech Polasek Vojtech Polasek
              SSG Security QE SSG Security QE
              Votes:
              0 Vote for this issue
              Watchers:
              9 Start watching this issue

                Created:
                Updated:
                Resolved: