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

grub2_vsyscall_argument should only be applicable to x86_64 #12408

Merged
merged 1 commit into from
Sep 19, 2024

Conversation

matusmarhefka
Copy link
Member

The vsyscall emulation is only available on x86_64 architecture (CONFIG_X86_VSYSCALL_EMULATION) making this rule not applicable to other CPU architectures.

The vsyscall emulation is only available on x86_64 architecture
(`CONFIG_X86_VSYSCALL_EMULATION`) making this rule not applicable
to other CPU architectures.
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

Copy link

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

Click here to see the full diff
New content has different text for rule 'xccdf_org.ssgproject.content_rule_grub2_vsyscall_argument'.
--- xccdf_org.ssgproject.content_rule_grub2_vsyscall_argument
+++ xccdf_org.ssgproject.content_rule_grub2_vsyscall_argument
@@ -12,6 +12,11 @@
 /etc/default/grub as shown below:
 GRUB_CMDLINE_LINUX="... vsyscall=none ..."
 Run the following command to update command line for already installed kernels:# grubby --update-kernel=ALL --args="vsyscall=none"
+
+[warning]:
+The vsyscall emulation is only available on x86_64 architecture
+(CONFIG_X86_VSYSCALL_EMULATION) making this rule not applicable
+to other CPU architectures.
 
 [reference]:
 CCI-001084

bash remediation for rule 'xccdf_org.ssgproject.content_rule_grub2_vsyscall_argument' differs.
--- xccdf_org.ssgproject.content_rule_grub2_vsyscall_argument
+++ xccdf_org.ssgproject.content_rule_grub2_vsyscall_argument
@@ -1,5 +1,5 @@
 # Remediation is applicable only in certain platforms
-if rpm --quiet -q grub2-common && { [ ! -f /.dockerenv ] && [ ! -f /run/.containerenv ]; }; then
+if rpm --quiet -q grub2-common && { ( [ ! -f /.dockerenv ] && [ ! -f /run/.containerenv ] && grep -q x86_64 /proc/sys/kernel/osrelease ); }; then
 
 grubby --update-kernel=ALL --args=vsyscall=none --env=/boot/grub2/grubenv
 

ansible remediation for rule 'xccdf_org.ssgproject.content_rule_grub2_vsyscall_argument' differs.
--- xccdf_org.ssgproject.content_rule_grub2_vsyscall_argument
+++ xccdf_org.ssgproject.content_rule_grub2_vsyscall_argument
@@ -16,7 +16,8 @@
   command: /sbin/grubby --update-kernel=ALL --args="vsyscall=none"
   when:
   - '"grub2-common" in ansible_facts.packages'
-  - ansible_virtualization_type not in ["docker", "lxc", "openvz", "podman", "container"]
+  - ( ansible_virtualization_type not in ["docker", "lxc", "openvz", "podman", "container"]
+    and ansible_architecture == "x86_64" )
   tags:
   - CCE-80946-7
   - DISA-STIG-RHEL-08-010422

Platform has been changed for rule 'xccdf_org.ssgproject.content_rule_grub2_vsyscall_argument'
--- xccdf_org.ssgproject.content_rule_grub2_vsyscall_argument
+++ xccdf_org.ssgproject.content_rule_grub2_vsyscall_argument
@@ -1 +1,2 @@
 oval:ssg-installed_env_is_a_machine:def:1
+oval:ssg-proc_sys_kernel_osrelease_arch_x86_64:def:1

Copy link

🤖 A k8s content image for this PR is available at:
ghcr.io/complianceascode/k8scontent:12408
This image was built from commit: 7099fce

Click here to see how to deploy it

If you alread have Compliance Operator deployed:
utils/build_ds_container.py -i ghcr.io/complianceascode/k8scontent:12408

Otherwise deploy the content and operator together by checking out ComplianceAsCode/compliance-operator and:
CONTENT_IMAGE=ghcr.io/complianceascode/k8scontent:12408 make deploy-local

Copy link

codeclimate bot commented Sep 19, 2024

Code Climate has analyzed commit 7099fce 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 59.5% (0.0% change).

View more on Code Climate.

@Mab879 Mab879 self-assigned this Sep 19, 2024
@Mab879 Mab879 added this to the 0.1.75 milestone Sep 19, 2024
@Mab879
Copy link
Member

Mab879 commented Sep 19, 2024

Waving Automatus tests as they pass locally.

@Mab879 Mab879 added the Update Rule Issues or pull requests related to Rules updates. label Sep 19, 2024
Copy link
Member

@Mab879 Mab879 left a comment

Choose a reason for hiding this comment

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

Thanks!

@Mab879 Mab879 merged commit 3789390 into ComplianceAsCode:master Sep 19, 2024
96 of 100 checks passed
@matusmarhefka matusmarhefka deleted the vsyscall_x86_only branch September 20, 2024 06:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Update Rule Issues or pull requests related to Rules updates.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants