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

Remove check of /var/log/dmesg from OVAL #10145

Merged
merged 1 commit into from
Jan 31, 2023

Conversation

matejak
Copy link
Member

@matejak matejak commented Jan 31, 2023

Description:

Don't check /var/log/dmesg using OVAL, because it may legitimately fail.

However, the rule has a STIG ID, so I guess that modifying its check isn't so simple - whoever understands this, please clarify.

Rationale:

Unlike the output of the dmesg command, the corresponding file may be binary, and therefore unsuitable to be examined by the textfilecontent OVAL test, as that one assumes that the file is encoded in UTF-8.

Moreover, the removed checking regex was quite fragile, which was probably caused by the NX feature having different name on different platforms and the corresponding log entry not being designed as machine-readable.

Unlike the output of the dmesg command, the corresponding file may be
binary, and therefore unsuitable to be examined by the textfilecontent
OVAL test, as that one assumes that the file is encoded in UTF-8.

Moreover, the removed checking regex was quite fragile, which was
probably caused by the NX feature having different name on different
platforms and the corresponding log entry not being designed as
machine-readable.
@matejak matejak added this to the 0.1.67 milestone Jan 31, 2023
@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
OVAL for rule 'xccdf_org.ssgproject.content_rule_bios_enable_execution_restrictions' differs.
--- oval:ssg-bios_enable_execution_restrictions:def:1
+++ oval:ssg-bios_enable_execution_restrictions:def:1
@@ -1,4 +1,3 @@
 criteria AND
 criterion oval:ssg-test_NX_cpu_support:tst:1
-criterion oval:ssg-test_messages_nx_active:tst:1
 criterion oval:ssg-test_noexec_cmd_line:tst:1

@codeclimate
Copy link

codeclimate bot commented Jan 31, 2023

Code Climate has analyzed commit 8063e6a 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.

@Mab879 Mab879 self-assigned this Jan 31, 2023
@Mab879 Mab879 added STIG STIG Benchmark related. OVAL OVAL update. Related to the systems assessments. labels Jan 31, 2023
@Mab879
Copy link
Member

Mab879 commented Jan 31, 2023

At least in RHEL 8 STIG reads as follows

 If "dmesg" does not show "NX (Execute Disable) protection" active, check the cpuinfo settings with the following command: 
$ sudo less /proc/cpuinfo | grep -i flags

So I'm okay with removing this.

@Mab879 Mab879 merged commit 9c62f4e 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
OVAL OVAL update. Related to the systems assessments. STIG STIG Benchmark related.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rule bios_enable_execution_restrictions is reporting error
2 participants