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

Improve Benchmark detection in Automatus #12554

Merged
merged 1 commit into from
Nov 4, 2024

Conversation

jan-cerny
Copy link
Collaborator

The SCE checks are inserted to SCAP source data stream in a form of extended-component element, each SCE check as a separate extended-component element. We shouldn't treat these extended component as XCCDF Benchmarks. Instead, when resolving a component reference we should check if the reference really points to an XCCDF Benchmark.

This fix will remove these annoying messages from automatus output:

INFO - The data stream contains 132 Benchmarks
INFO - 0 - scap_org.open-scap_cref_ssg-rhel9-xccdf.xml
INFO - 1 - scap_org.open-scap_cref_rhel9-checks-sce-timer_dnf-automatic_enabled.sh
INFO - 2 - scap_org.open-scap_cref_rhel9-checks-sce-service_debug-shell_disabled.sh
INFO - 3 - scap_org.open-scap_cref_rhel9-checks-sce-service_pcscd_enabled.sh
...

Review Hints:

  1. Build a product using build_product of a product where SCE checks are now enabled by default, eg. rhel9.
  2. Run automatus tests of your favourite rule.
  3. Compare automatus output with and without this patch.

The SCE checks are inserted to SCAP source data stream in a form of
`extended-component` element, each SCE check as a separate
`extended-component` element. We shouldn't treat these extended
component as XCCDF Benchmarks. Instead, when resolving a component
reference we should check if the reference really points to an XCCDF
Benchmark.

This fix will remove these annoying messages from automatus output:

```
INFO - The data stream contains 132 Benchmarks
INFO - 0 - scap_org.open-scap_cref_ssg-rhel9-xccdf.xml
INFO - 1 - scap_org.open-scap_cref_rhel9-checks-sce-timer_dnf-automatic_enabled.sh
INFO - 2 - scap_org.open-scap_cref_rhel9-checks-sce-service_debug-shell_disabled.sh
INFO - 3 - scap_org.open-scap_cref_rhel9-checks-sce-service_pcscd_enabled.sh
...
```
@jan-cerny jan-cerny added the Test Suite Update in Test Suite. label Oct 30, 2024
@jan-cerny jan-cerny added this to the 0.1.75 milestone Oct 30, 2024
Copy link

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

Fedora Environment
Open in Gitpod

Oracle Linux 8 Environment
Open in Gitpod

Copy link

codeclimate bot commented Oct 30, 2024

Code Climate has analyzed commit fce616a 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 60.9% (0.0% change).

View more on Code Climate.

@jan-cerny
Copy link
Collaborator Author

/packit build

1 similar comment
@jan-cerny
Copy link
Collaborator Author

/packit build

@Mab879 Mab879 self-assigned this Oct 31, 2024
@Mab879
Copy link
Member

Mab879 commented Oct 31, 2024

/packit build

@Mab879
Copy link
Member

Mab879 commented Nov 1, 2024

/pakcit build

@Mab879
Copy link
Member

Mab879 commented Nov 1, 2024

/packit build

@Mab879 Mab879 merged commit 24d7ff3 into ComplianceAsCode:master Nov 4, 2024
103 of 104 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Test Suite Update in Test Suite.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants