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

Add AlmaLinux 9 support #12757

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

0intro
Copy link
Contributor

@0intro 0intro commented Dec 20, 2024

Description:

This PR adds AlmaLinux 9 support.

The AlmaLinux 9 support has been implemented as a derivative of RHEL 9, since AlmaLinux 9 is a clone of RHEL 9 and the CIS Benchmarks are pretty much identical.

Rationale:

AlmaLinux is a community-supported clone of Red Hat Enterprise Linux. CIS Benchmark for AlmaLinux has been firstly published in November 2021.

The AlmaLinux 9 support has been implemented as a derivative
of RHEL 9, since AlmaLinux 9 is a clone of RHEL 9 and the
CIS Benchmarks are pretty much identical.
@0intro 0intro requested a review from a team as a code owner December 20, 2024 09:07
@openshift-ci openshift-ci bot added the needs-ok-to-test Used by openshift-ci bot. label Dec 20, 2024
Copy link

openshift-ci bot commented Dec 20, 2024

Hi @0intro. Thanks for your PR.

I'm waiting for a ComplianceAsCode member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

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

codeclimate bot commented Dec 20, 2024

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

View more on Code Climate.

@Mab879 Mab879 self-assigned this Dec 20, 2024
@Mab879
Copy link
Member

Mab879 commented Dec 20, 2024

/ok-to-test

@openshift-ci openshift-ci bot added ok-to-test Used by openshift-ci bot. and removed needs-ok-to-test Used by openshift-ci bot. labels Dec 20, 2024
@Mab879 Mab879 added this to the 0.1.76 milestone Dec 20, 2024
@Mab879
Copy link
Member

Mab879 commented Dec 20, 2024

The static test failures are due to Wavier needing to be added. I can propose a PR to Contest later today.

@Mab879
Copy link
Member

Mab879 commented Dec 20, 2024

The static test failures are due to Wavier needing to be added. I can propose a PR to Contest later today.

RHSecurityCompliance/contest#296 should fix it.

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.

I think these changes are looking fairly good overall.

Due to the Contest PR needed for the tests to pass this PR will most likely get merged in January once the team gets back from the Holiday break. Once those are merged we can move this PR forward.

@sej7278
Copy link

sej7278 commented Dec 20, 2024

CIS is a great start, as we develop the F34-based benchmarks together it would be great to see AlmaLinux added to CaC.

I've got some automation for the AlmaLinux OS 9 STIG that needs updating now the STIG is final, but maybe we should concentrate on adding it to CaC instead?
https://github.com/sej7278/virt-installs/tree/master/alma9_stig_ansible

"<i>AlmaLinux</i> does not inherit " \
"certifications or evaluations from <i>Red Hat Enterprise Linux</i>. As " \
"such, some configuration rules (such as those requiring " \
"<i>FIPS 140-2</i> encryption) will continue to fail on <i>AlmaLinux</i>.</li>\n" \
Copy link

Choose a reason for hiding this comment

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

I wonder if we should add a note about the FIPS 140-3 modules from https://docs.tuxcare.com/enterprise-support-for-almalinux/fips/ ?

@Mab879
Copy link
Member

Mab879 commented Dec 20, 2024

CIS is a great start, as we develop the F34-based benchmarks together it would be great to see AlmaLinux added to CaC.

I've got some automation for the AlmaLinux OS 9 STIG that needs updating now the STIG is final, but maybe we should concentrate on adding it to CaC instead? https://github.com/sej7278/virt-installs/tree/master/alma9_stig_ansible

If you looking to add different profiles then what is is in RHEL I would suggest creating a new product that isn't a derivative of RHEL. By merging this pull request all of the profiles will be what is in RHEL.

See #12611 as a recent example of how. We also have some docs as well. As always if need any help please let us know.

@sej7278
Copy link

sej7278 commented Dec 20, 2024

That's where I've always got stuck before. The CIS benchmarks are largely the same, but the STIG is more different - requires a license, different repos, specific FIPS packages, certain minor versions aren't supported etc.

@Mab879
Copy link
Member

Mab879 commented Dec 20, 2024

That's where I've always got stuck before. The CIS benchmarks are largely the same, but the STIG is more different - requires a license, different repos, specific FIPS packages, certain minor versions aren't supported etc.

In that case a different product might be best. The control files can be leveraged to reduce the workload on maintaining Alma profiles.

@sej7278
Copy link

sej7278 commented Dec 21, 2024

In that case a different product might be best. The control files can be leveraged to reduce the workload on maintaining Alma profiles.

Yes, with the mix of commercial and community, I think products make sense looking at how Ubuntu does it e.g.

  • almalinux9 - community, just major version for e.g. CIS benchmarks
  • almalinux92esu - commercial from TuxCare, specific minor version with FIPS for e.g. STIG

They have different OVAL/repo's and such too. I'm going to have a look at the example product in a bit.

How does this affect this PR though - is it worth merging to get things started, and then once we have products setup, revert the changes?

Update: made a start on a new product https://github.com/sej7278/cac-content/tree/add-alma9

I think we could use the control files for the commercial STIG, rather than another product, as the STIG itself contains minor version, repo, FIPS package checks etc.

jacky9813 added a commit to jacky9813/complianceAsCode that referenced this pull request Dec 25, 2024
@Mab879
Copy link
Member

Mab879 commented Jan 6, 2025

How does this affect this PR though - is it worth merging to get things started, and then once we have products setup, revert the changes?

If you looking to add AlmaLinux as it own separate product it might be best to close this pull request and just add the product.

I think we could use the control files for the commercial STIG, rather than another product, as the STIG itself contains minor version, repo, FIPS package checks etc.

I don't believe we can just substitute in one profile (i.e. the STIG profile from RHEL control file to the Alma control file) when a product is a derivative.

@sej7278
Copy link

sej7278 commented Jan 7, 2025

Hmm maybe, although I don't want to hold things up whilst we work on a product, that looks like it could take a long time?

As for the STIG, i had hoped we could have an almalinux9 community product, and then just use a control file to add the commercial (TuxCare) STIG+FIPS content, not re-using RHEL or anything.

@0intro
Copy link
Contributor Author

0intro commented Jan 8, 2025

Would it make sense to push this change as is, so the Alma Linux 9 support would be available for release 0.1.76. Then, the support could be moved to its own product, once the STIG profiles would be written out?

@Mab879
Copy link
Member

Mab879 commented Jan 8, 2025

Hmm maybe, although I don't want to hold things up whilst we work on a product, that looks like it could take a long time?

We can start out simple with just one profile.

Would it make sense to push this change as is, so the Alma Linux 9 support would be available for release 0.1.76. Then, the support could be moved to its own product, once the STIG profiles would be written out?

This is something that we can do.

We should able to get this PR merged quickly. Once it ready we can convert AlmaLinux to a full product. Does that work for you both?

@sej7278
Copy link

sej7278 commented Jan 8, 2025

What would be involved in making a product if this derivative exists? Would we have to revert these changes - I assume you can't have a derivative and product both called almalinux9 ?

CIS shouldn't take too long as it's very similar to rhel being based on the same f34 source, but STIG will take longer.

I'd like to understand what's involved just to get the CIS profile enabled for a new product, as that's the main one i assume @0intro is interested in.

@Mab879
Copy link
Member

Mab879 commented Jan 8, 2025

What would be involved in making a product if this derivative exists? Would we have to revert these changes - I assume you can't have a derivative and product both called almalinux9 ?

Correct, you would have to revert these changes. Then create a almalinux9 product.

I'd like to understand what's involved just to get the CIS profile enabled for a new product, as that's the main one i assume @0intro is interested in.

You might be able to use RHEL 9 CIS control file as a starting point to create profiles like RHEL 9 CIS Level 2. The control file makes easy to create the 4 profiles needed for CIS.

@sej7278
Copy link

sej7278 commented Jan 8, 2025

That seems to have worked, using https://github.com/sej7278/cac-content/tree/add-alma9 i now have:

cis_screenshot

@sej7278
Copy link

sej7278 commented Jan 10, 2025

Made a product-based PR as #12808 for comment/review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ok-to-test Used by openshift-ci bot.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants