content icon indicating copy to clipboard operation
content copied to clipboard

Add Amazon Linux 2 support

Open 0intro opened this issue 1 year ago • 8 comments

Description:

This PR adds Amazon Linux 2 support.

This series of changes is based on the Amazon Linux 2 support, available as part of the scap-security-guide-0.1.40-12.amzn2.0.1.1.src.rpm package (2019-04-19), distributed as part of Amazon Linux 2.

  1. The first two commits are the changes done by Amazon themselves, as part of the scap-security-guide-0.1.40-12.amzn2.0.1.1.src.rpm package, but rebased on the current version of ComplianceAsCode:
  • 0001-Add-Amazon-Linux-2-derivative.patch
  • 0001-Add-cpe-definitions-and-oval-checks-for-AMZN2.patch
  1. The third commit is a changes to the enable_derivatives.py script to use the same profiles as RHEL 7, since Amazon Linux 2 is very close to RHEL 7. For example the CIS_Amazon_Linux_2_Benchmark_v3.0.0.pdf document is an extract subset of the CIS_Red_Hat_Enterprise_Linux_7_Benchmark_v3.1.1.pdf document.

The Amazon Linux 2 support was originally based on ComplianceAsCode 0.1.40 (2018-07-25), but the changes have been rebased on the current version of ComplianceAsCode.

Rationale:

This PR adds supports for Amazon Linux 2, a Linux distribution, rebranded from Red Hat Linux 7, which is widely used on AWS.

The approach I chose was to implement Amazon Linux 2 as a derivative of RHEL 7, since the systems are very close. For example, the CIS Amazon Linux 2 Benchmark is a subset of CIS Red Hat Linux 7 Benchmark.

0intro avatar Jun 24 '24 12:06 0intro

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.

openshift-ci[bot] avatar Jun 24 '24 12:06 openshift-ci[bot]

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

Fedora Environment Open in Gitpod

Oracle Linux 8 Environment Open in Gitpod

github-actions[bot] avatar Jun 24 '24 12:06 github-actions[bot]

:robot: A k8s content image for this PR is available at: ghcr.io/complianceascode/k8scontent:12087 This image was built from commit: c483d4a692c0d2040905feb7d2db117fb0ee911a

Click here to see how to deploy it

If you alread have Compliance Operator deployed: utils/build_ds_container.py -i ghcr.io/complianceascode/k8scontent:12087

Otherwise deploy the content and operator together by checking out ComplianceAsCode/compliance-operator and: CONTENT_IMAGE=ghcr.io/complianceascode/k8scontent:12087 make deploy-local

github-actions[bot] avatar Jun 24 '24 12:06 github-actions[bot]

Code Climate has analyzed commit c483d4a6 and detected 2 issues on this pull request.

Here's the issue category breakdown:

Category Count
Style 1
Complexity 1

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 59.4% (0.0% change).

View more on Code Climate.

qlty-cloud-legacy[bot] avatar Jun 24 '24 12:06 qlty-cloud-legacy[bot]

I think that creating a new derivative out of RHEL 7 content would be problematic because RHEL 7 is approaching end of maintenance this week and there is a request to remove RHEL 7 content from this project soon, see https://github.com/ComplianceAsCode/content/issues/12044.

I think that a better approach would be to create a new standalone product. That would avoid the collision with the planned RHEL 7 removal.

jan-cerny avatar Jun 25 '24 13:06 jan-cerny

PR needs rebase.

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.

openshift-merge-robot avatar Jun 27 '24 22:06 openshift-merge-robot

With RHEL 7 being removed this PR will need to be rewritten to make Amazon Linux 2 as a standalone product.

Mab879 avatar Jul 17 '24 19:07 Mab879

ping

jan-cerny avatar Aug 02 '24 05:08 jan-cerny

Thanks for opening this PR.

I believe that opening a new PR and adding Amazon Linux 2 as a standalone product would better than reusing this PR.

Please reach in the discussions here on GitHub or Gitter if have any questions.

Mab879 avatar Aug 30 '24 17:08 Mab879