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 Amazon Linux 2 support #12087

Closed
wants to merge 3 commits into from
Closed

Conversation

0intro
Copy link
Contributor

@0intro 0intro commented Jun 24, 2024

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.

This changes applies 0001-Add-Amazon-Linux-2-derivative.patch.

This patch was extracted from the following package,
distributed as part of Amazon Linux 2:

scap-security-guide-0.1.40-12.amzn2.0.1.1.src.rpm
This changes applies 0001-Add-cpe-definitions-and-oval-checks-for-AMZN2.patch.

This patch was extracted from the following package,
distributed as part of Amazon Linux 2:

scap-security-guide-0.1.40-12.amzn2.0.1.1.src.rpm
@openshift-ci openshift-ci bot added the needs-ok-to-test Used by openshift-ci bot. label Jun 24, 2024
Copy link

openshift-ci bot commented Jun 24, 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:

Fedora Environment
Open in Gitpod

Oracle Linux 8 Environment
Open in Gitpod

Copy link

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

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

Copy link

codeclimate bot commented Jun 24, 2024

Code Climate has analyzed commit c483d4a 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.

@Mab879 Mab879 added the New Product Issues or pull requests related to new Products. label Jun 24, 2024
@jan-cerny
Copy link
Collaborator

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 #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.

@openshift-merge-robot openshift-merge-robot added the needs-rebase Used by openshift-ci bot. label Jun 27, 2024
@openshift-merge-robot
Copy link
Collaborator

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.

@Mab879
Copy link
Member

Mab879 commented Jul 17, 2024

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

@jan-cerny
Copy link
Collaborator

ping

@Mab879
Copy link
Member

Mab879 commented Aug 30, 2024

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 Mab879 closed this Aug 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-ok-to-test Used by openshift-ci bot. needs-rebase Used by openshift-ci bot. New Product Issues or pull requests related to new Products.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants