Update RHEL 9 STIG to V1R2#11479
Merged
Merged
Conversation
|
This datastream diff is auto generated by the check Click here to see the full diffOCIL for rule 'xccdf_org.ssgproject.content_rule_aide_check_audit_tools' differs.
--- ocil:ssg-aide_check_audit_tools_ocil:questionnaire:1
+++ ocil:ssg-aide_check_audit_tools_ocil:questionnaire:1
@@ -10,7 +10,6 @@
/usr/sbin/autrace p+i+n+u+g+s+b+acl+xattrs+sha512
-
/usr/sbin/augenrules p+i+n+u+g+s+b+acl+xattrs+sha512
OCIL 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) exec tmux ;; esac
+/etc/profile.d/tmux.sh: case "$name" in (sshd|login) 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) exec tmux ;; esac
+case "$name" in (sshd|login) 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) exec tmux ;; esac' /etc/bashrc; then
+if ! grep -x ' case "$name" in sshd|login) 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) exec tmux ;; esac
+ case "$name" in sshd|login) 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\) exec tmux ;; esac.*
+ contains: .*case "$name" in sshd|login\) 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\) exec tmux ;; esac.*
+ contains: .*case "$name" in sshd|login\) 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) exec tmux ;; esac
+ case "$name" in sshd|login) tmux ;; esac
fi
create: true
when: |
jan-cerny
requested changes
Jan 25, 2024
Collaborator
jan-cerny
left a comment
There was a problem hiding this comment.
The tests pass locally:
jcerny@fedora:~/work/git/scap-security-guide (pr/11479)$ python3 tests/automatus.py rule --libvirt qemu:///system ssgts_rhel9 configure_bashrc_exec_tmux
Setting console output to log level INFO
INFO - The base image option has not been specified, choosing libvirt-based test environment.
INFO - Logging into /home/jcerny/work/git/scap-security-guide/logs/rule-custom-2024-01-25-1006/test_suite.log
INFO - xccdf_org.ssgproject.content_rule_configure_bashrc_exec_tmux
INFO - Script wrong_value.fail.sh using profile (all) OK
INFO - Script correct_value.pass.sh using profile (all) OK
INFO - Script correct_value_d_directory.pass.sh using profile (all) OK
INFO - Script duplicate_value_multiple_files.pass.sh using profile (all) OK
jcerny@fedora:~/work/git/scap-security-guide (pr/11479)$ python3 tests/automatus.py rule --libvirt qemu:///system ssgts_rhel9 --remediate-using ansible configure_bashrc_exec_tmux
Setting console output to log level INFO
INFO - The base image option has not been specified, choosing libvirt-based test environment.
INFO - Logging into /home/jcerny/work/git/scap-security-guide/logs/rule-custom-2024-01-25-1010/test_suite.log
INFO - xccdf_org.ssgproject.content_rule_configure_bashrc_exec_tmux
INFO - Script wrong_value.fail.sh using profile (all) OK
INFO - Script correct_value.pass.sh using profile (all) OK
INFO - Script correct_value_d_directory.pass.sh using profile (all) OK
INFO - Script duplicate_value_multiple_files.pass.sh using profile (all) OK
5ec1dfa to
5dbd892
Compare
5dbd892 to
7a27f80
Compare
|
Code Climate has analyzed commit 7a27f80 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.5% (0.0% change). View more on Code Climate. |
Collaborator
|
/packit retest-failed |
jan-cerny
approved these changes
Jan 26, 2024
Collaborator
|
/packit retest-failed |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description:
Rationale:
Keep the STIG up-to-date.