Skip to content

Improve Benchmark detection in Automatus#12554

Merged
Mab879 merged 1 commit into
ComplianceAsCode:masterfrom
jan-cerny:many_benchmarks
Nov 4, 2024
Merged

Improve Benchmark detection in Automatus#12554
Mab879 merged 1 commit into
ComplianceAsCode:masterfrom
jan-cerny:many_benchmarks

Conversation

@jan-cerny
Copy link
Copy Markdown
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
@github-actions
Copy link
Copy Markdown

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

Fedora Environment
Open in Gitpod

Oracle Linux 8 Environment
Open in Gitpod

@qlty-cloud-legacy
Copy link
Copy Markdown

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
Copy Markdown
Collaborator Author

/packit build

1 similar comment
@jan-cerny
Copy link
Copy Markdown
Collaborator Author

/packit build

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

Mab879 commented Oct 31, 2024

/packit build

@Mab879
Copy link
Copy Markdown
Member

Mab879 commented Nov 1, 2024

/pakcit build

@Mab879
Copy link
Copy Markdown
Member

Mab879 commented Nov 1, 2024

/packit build

@Mab879 Mab879 merged commit 24d7ff3 into ComplianceAsCode:master Nov 4, 2024
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