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

Use control files to generate references #11594

Merged
merged 5 commits into from
Feb 19, 2024

Conversation

jan-cerny
Copy link
Collaborator

Description:

We will use control files to automatically assign references to rules for these policies:

  • RHEL 9 CCN
  • RHEL 9 STIG
  • PCI-DSS v4 (all products)

Consequently, we will remove the test testing that the rule.yml files in git contain the references to these policies.

Rationale:

reduce data duplication, improve consistency

Review Hints:

Build rhel9 product, then review some of resolved rules and check if the references ccn, stigid and pcidss4 refer to the correct sections of respective control files.

@jan-cerny jan-cerny added enhancement General enhancements to the project. RHEL9 Red Hat Enterprise Linux 9 product related. STIG STIG Benchmark related. pci-dss CCN CCN Benchmark related. labels Feb 16, 2024
@jan-cerny jan-cerny added this to the 0.1.73 milestone Feb 16, 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

This test tests if a rule.yml contains the specific references.  We
started to generated these reference types from control files therefore
they stop being present in rule.ymls and we can't use this test.
Copy link

codeclimate bot commented Feb 16, 2024

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

View more on Code Climate.

@jan-cerny
Copy link
Collaborator Author

/packit retest-failed

1 similar comment
@jan-cerny
Copy link
Collaborator Author

/packit retest-failed

@Mab879 Mab879 self-assigned this Feb 16, 2024
@@ -22,8 +22,6 @@ severity: medium
identifiers:
cce@rhel7: CCE-80548-1

references:
stigid: WA00612
Copy link
Member

Choose a reason for hiding this comment

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

Do we want to remove these?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think yes, because they don't correspond to any of the STIG profiles that we have in our project.

Copy link
Member

Choose a reason for hiding this comment

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

I proposed a similar thing in 1ad84d6

@Mab879 Mab879 merged commit 39a59d3 into ComplianceAsCode:master Feb 19, 2024
44 checks passed
ssg_refcheck_test("rhel9" "ccn_basic" "ccn")
ssg_refcheck_test("rhel9" "ccn_advanced" "ccn")
# This exclude can be removed once enable_authselect has a stigid
ssg_refcheck_test("rhel9" "stig" "stigid" "enable_authselect")
Copy link
Member

Choose a reason for hiding this comment

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

Maybe it makes sense to start testing these references are in the final built data stream?

Copy link
Member

Choose a reason for hiding this comment

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

Sorry for the post merge comment, @jan-cerny @Mab879

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

For some products, there are CTest tests "verify-references-ssg-${PRODUCT}-ds.xml" and "missing-references-ssg-${PRODUCT}-ds.xml". I think we can extend them.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

see #11610

@Mab879 Mab879 added New Feature Issues or pull requests related to new Features. Infrastructure Our content build system labels May 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CCN CCN Benchmark related. enhancement General enhancements to the project. Infrastructure Our content build system New Feature Issues or pull requests related to new Features. pci-dss RHEL9 Red Hat Enterprise Linux 9 product related. STIG STIG Benchmark related.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants