vlock_installed: apply only to platform machine - #10307
Conversation
The 'Check that vlock is installed to allow session locking' rule should not apply to containers. Signed-off-by: Craig Andrews <candrews@integralblue.com>
|
Hi @candrews. 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 Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions 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. |
|
This datastream diff is auto generated by the check Click here to see the full diffbash remediation for rule 'xccdf_org.ssgproject.content_rule_vlock_installed' differs.
--- xccdf_org.ssgproject.content_rule_vlock_installed
+++ xccdf_org.ssgproject.content_rule_vlock_installed
@@ -1,4 +1,10 @@
+# Remediation is applicable only in certain platforms
+if [ ! -f /.dockerenv ] && [ ! -f /run/.containerenv ]; then
if ! rpm -q --quiet "kbd" ; then
yum install -y "kbd"
fi
+
+else
+ >&2 echo 'Remediation is not applicable, nothing was done'
+fi
ansible remediation for rule 'xccdf_org.ssgproject.content_rule_vlock_installed' differs.
--- xccdf_org.ssgproject.content_rule_vlock_installed
+++ xccdf_org.ssgproject.content_rule_vlock_installed
@@ -2,6 +2,7 @@
package:
name: kbd
state: present
+ when: ansible_virtualization_type not in ["docker", "lxc", "openvz", "podman", "container"]
tags:
- DISA-STIG-OL08-00-020043
- enable_strategy
Platform has been changed for rule 'xccdf_org.ssgproject.content_rule_vlock_installed'
--- xccdf_org.ssgproject.content_rule_vlock_installed
+++ xccdf_org.ssgproject.content_rule_vlock_installed
@@ -1 +1 @@
-
+cpe:/a:machine |
|
Code Climate has analyzed commit 6f25143 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 51.7% (0.0% change). View more on Code Climate. |
jan-cerny
left a comment
There was a problem hiding this comment.
The Automatus's bot CI job fail is expected because the rule vlock_installed ins't a part of RHEL 8 and RHEL 9 benchmarks (prodtype: ol8,sle12,sle15,ubuntu2004).
Description:
vlock_installed: apply only to platform machine
Rationale:
The 'Check that vlock is installed to allow session locking' rule should not apply to containers.
Review Hints:
With this change applied,
oscap-podman ubuntu:20.04 xccdf eval --report report.html --profile xccdf_org.ssgproject.content_profile_stig /usr/share/xml/scap/ssg/content/ssg-ubuntu2004-ds.xmlshould yield a report indicating that the "Check that vlock is installed to allow session locking" rule is "Not Applicable"