-
Notifications
You must be signed in to change notification settings - Fork 706
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
put exec back to configure_bashrc_exec_tmux #11561
put exec back to configure_bashrc_exec_tmux #11561
Conversation
This reverts commit 0acdf79.
…_tmux it corresponds to the policy
This datastream diff is auto generated by the check Click here to see the full diffOCIL for rule 'xccdf_org.ssgproject.content_rule_configure_bashrc_exec_tmux' differs.
--- ocil:ssg-configure_bashrc_exec_tmux_ocil:questionnaire:1
+++ ocil:ssg-configure_bashrc_exec_tmux_ocil:questionnaire:1
@@ -4,7 +4,7 @@
$ sudo grep tmux /etc/bashrc /etc/profile.d/*
-/etc/profile.d/tmux.sh: case "$name" in (sshd|login) tmux ;; esac
+/etc/profile.d/tmux.sh: case "$name" in (sshd|login) exec tmux ;; esac
Review the tmux script by using the following example:
@@ -13,7 +13,7 @@
if [ "$PS1" ]; then
parent=$(ps -o ppid= -p $$)
name=$(ps -o comm= -p $parent)
-case "$name" in (sshd|login) tmux ;; esac
+case "$name" in (sshd|login) exec tmux ;; esac
fi
If the shell file is not configured as the example above, is commented out, or is missing, this is a finding.
bash remediation for rule 'xccdf_org.ssgproject.content_rule_configure_bashrc_exec_tmux' differs.
--- xccdf_org.ssgproject.content_rule_configure_bashrc_exec_tmux
+++ xccdf_org.ssgproject.content_rule_configure_bashrc_exec_tmux
@@ -1,12 +1,12 @@
# Remediation is applicable only in certain platforms
if [ ! -f /.dockerenv ] && [ ! -f /run/.containerenv ] && { rpm --quiet -q tmux; }; then
-if ! grep -x ' case "$name" in sshd|login) tmux ;; esac' /etc/bashrc; then
+if ! grep -x ' case "$name" in sshd|login) exec tmux ;; esac' /etc/bashrc; then
cat >> /etc/profile.d/tmux.sh <<'EOF'
if [ "$PS1" ]; then
parent=$(ps -o ppid= -p $$)
name=$(ps -o comm= -p $parent)
- case "$name" in sshd|login) tmux ;; esac
+ case "$name" in sshd|login) exec tmux ;; esac
fi
EOF
chmod 0644 /etc/profile.d/tmux.sh
ansible remediation for rule 'xccdf_org.ssgproject.content_rule_configure_bashrc_exec_tmux' differs.
--- xccdf_org.ssgproject.content_rule_configure_bashrc_exec_tmux
+++ xccdf_org.ssgproject.content_rule_configure_bashrc_exec_tmux
@@ -15,7 +15,7 @@
ansible.builtin.find:
paths: /etc
patterns: bashrc
- contains: .*case "$name" in sshd|login\) tmux ;; esac.*
+ contains: .*case "$name" in sshd|login\) exec tmux ;; esac.*
register: tmux_in_bashrc
when:
- ansible_virtualization_type not in ["docker", "lxc", "openvz", "podman", "container"]
@@ -34,7 +34,7 @@
ansible.builtin.find:
paths: /etc/profile.d
patterns: '*.sh'
- contains: .*case "$name" in sshd|login\) tmux ;; esac.*
+ contains: .*case "$name" in sshd|login\) exec tmux ;; esac.*
register: tmux_in_profile_d
when:
- ansible_virtualization_type not in ["docker", "lxc", "openvz", "podman", "container"]
@@ -55,7 +55,7 @@
if [ "$PS1" ]; then
parent=$(ps -o ppid= -p $$)
name=$(ps -o comm= -p $parent)
- case "$name" in sshd|login) tmux ;; esac
+ case "$name" in sshd|login) exec tmux ;; esac
fi
create: true
when: |
Code Climate has analyzed commit ee739c5 and detected 0 issues on this pull request. The test coverage on the diff in this pull request is 100.0% (50% is the threshold). This pull request will bring the total coverage in the repository to 58.4% (0.0% change). View more on Code Climate. |
/retest-required |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Thanks!
Waving Automatus for SLE15 as it appears not be applicable for the platform. |
After merging ComplianceAsCode/content#11561, the rule configure_bashrc_tmux is included in RHEL 9 STIG, therefore, the waiver applicability should be extended to RHEL 9. This problem has been reported by: ComplianceAsCode/content#11569
After merging ComplianceAsCode/content#11561, the rule configure_bashrc_tmux is included in RHEL 9 STIG, therefore, the waiver applicability should be extended to RHEL 9. This problem has been reported by: ComplianceAsCode/content#11569
Description:
Rationale: