Skip to content
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

Update tmux rules and add them to OL8 STIG profiles #10124

Merged
merged 3 commits into from
Jan 31, 2023

Conversation

Xeicker
Copy link
Contributor

@Xeicker Xeicker commented Jan 25, 2023

Description:

  • Update configure_tmux_lock_keybinding to allow any key, add to it the OL8 STIG id reference
  • Add the OL8 stig id reference to configure_bashrc_tmux
  • Add the 2 mentioned rules to OL8 STIG profiles

Rationale:

  • This is to make OL8 STIG profile comply with DISA's STIG requirements

Review Hints:

  • The only change in behavior is in configure_tmux_lock_keybinding. This was covered in tests

@Xeicker Xeicker requested a review from a team as a code owner January 25, 2023 17:18
@openshift-ci openshift-ci bot added the needs-ok-to-test Used by openshift-ci bot. label Jan 25, 2023
@openshift-ci
Copy link

openshift-ci bot commented Jan 25, 2023

Hi @Xeicker. Thanks for your PR.

I'm waiting for a ComplianceAsCode member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Copy link
Contributor

@freddieRv freddieRv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks for the update, @Xeicker

@github-actions
Copy link

Start a new ephemeral environment with changes proposed in this pull request:

rhel8 (from CTF) Environment (using Fedora as testing environment)
Open in Gitpod

Fedora Testing Environment
Open in Gitpod

Oracle Linux 8 Environment
Open in Gitpod

@github-actions
Copy link

This datastream diff is auto generated by the check Compare DS/Generate Diff

Click here to see the full diff
OCIL for rule 'xccdf_org.ssgproject.content_rule_configure_tmux_lock_keybinding' differs.
--- ocil:ssg-configure_tmux_lock_keybinding_ocil:questionnaire:1
+++ ocil:ssg-configure_tmux_lock_keybinding_ocil:questionnaire:1
@@ -1,11 +1,11 @@
 Verify Red Hat Enterprise Linux 8 enables the user to initiate a session lock trhough key bindings with the following commands:
 
-$ grep "bind X lock-session" /etc/tmux.conf
+$ grep "lock-session" /etc/tmux.conf
 
 bind X lock-session
 
 Then, verify that the /etc/tmux.conf file can be read by other users than root:
 
 $ sudo ls -al /etc/tmux.conf
- Is it the case that the "lock-session" is not bound to the X key?
+ Is it the case that the "lock-session" is not bound to a specific key?
 
bash remediation for rule 'xccdf_org.ssgproject.content_rule_configure_tmux_lock_keybinding' differs.
--- xccdf_org.ssgproject.content_rule_configure_tmux_lock_keybinding
+++ xccdf_org.ssgproject.content_rule_configure_tmux_lock_keybinding
@@ -3,9 +3,7 @@
 
 tmux_conf="/etc/tmux.conf"
 
-if grep -qP '^\s*bind\s+\w\s+lock-session' "$tmux_conf" ; then
- sed -i 's/\s*bind\s\+\w\s\+lock-session.*$/bind X lock-session/' "$tmux_conf"
-else
+if ! grep -qP '^\s*bind\s+\w\s+lock-session' "$tmux_conf" ; then
 echo "bind X lock-session" >> "$tmux_conf"
 fi
 chmod 0644 "$tmux_conf"

@Mab879 Mab879 added this to the 0.1.67 milestone Jan 25, 2023
@Mab879 Mab879 added OVAL OVAL update. Related to the systems assessments. Oracle Linux Oracle Linux product related. Update Profile Issues or pull requests related to Profiles updates. labels Jan 25, 2023
Signed-off-by: Edgar Aguilar <edgar.aguilar@oracle.com>
Allow any letter to bound instead of only X. Also add the rule to OL8
STIG

Signed-off-by: Edgar Aguilar <edgar.aguilar@oracle.com>
Signed-off-by: Edgar Aguilar <edgar.aguilar@oracle.com>
@codeclimate
Copy link

codeclimate bot commented Jan 25, 2023

Code Climate has analyzed commit 9593cb2 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 49.5% (0.0% change).

View more on Code Climate.

Copy link
Member

@marcusburghardt marcusburghardt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks

@marcusburghardt marcusburghardt added STIG STIG Benchmark related. RHEL8 Red Hat Enterprise Linux 8 product related. labels Jan 31, 2023
@marcusburghardt
Copy link
Member

FYI @Mab879 , @yuumasato , @ggbecker

@marcusburghardt marcusburghardt merged commit 3872db0 into ComplianceAsCode:master Jan 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-ok-to-test Used by openshift-ci bot. Oracle Linux Oracle Linux product related. OVAL OVAL update. Related to the systems assessments. RHEL8 Red Hat Enterprise Linux 8 product related. STIG STIG Benchmark related. Update Profile Issues or pull requests related to Profiles updates.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants