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

Enable service_nftables_enabled for RHEL7 and RHEL8 #10398

Conversation

marcusburghardt
Copy link
Member

Description:

The service_nftables_enabled rule satisfies CIS requirements for RHEL7 and RHEL8.
However, the benchmark allows to choose any of the options among firewalld, iptables and nftables.
This is outdated in the benchmark and should be changed soon.
Actually, iptables and nftables are possible backends for firewalld.

Rationale:

Better CIS coverage for RHEL7 and RHEL8.

@marcusburghardt marcusburghardt added RHEL7 Red Hat Enterprise Linux 7 product related. RHEL8 Red Hat Enterprise Linux 8 product related. CIS CIS Benchmark related. labels Mar 30, 2023
@marcusburghardt marcusburghardt added this to the 0.1.68 milestone Mar 30, 2023
@marcusburghardt marcusburghardt requested a review from a team as a code owner March 30, 2023 17:52
@github-actions
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

@marcusburghardt
Copy link
Member Author

The PR was rebased to resolve the conflict.

This rule satisfies CIS requirements for RHEL7 and RHEL8. However, the
benchmark allows to choose any of the options among firewalld, iptables
and nftables. This is outdated in the benchmark and should be changed
soon. Actually, iptables and nftables are possible backends for
firewalld.
@marcusburghardt marcusburghardt force-pushed the cis_nftables_service_rhel7_rhel8 branch from 9e7fff1 to 7a427ce Compare April 4, 2023 11:14
@marcusburghardt
Copy link
Member Author

Rebased to df63f7c

@jan-cerny jan-cerny self-assigned this Apr 4, 2023
Otherwise, it will conflict with firewalld service. The preferred service to manage firewall
rules is firewalld. In addition, the default backend in RHEL7 is iptables.
status: automated
related_rules:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why is it in related rules? Using related rules doesn't add the rule to the profile.

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks for asking @jan-cerny . It is intentional to not include this rule in the profile.

For context, in the current versions of CIS benchmarks for RHEL7 and RHEL8, the firewall related requirements are a little bit confusing. RHEL7 is the most outdated. RHEL8 last version is newer than RHEL7 last version and a little better regarding firewall requirements but still older than RHEL9 last version. In next versions it is expected they get more similar to RHEL9 approach.

But currently, there are conflicting requirements for iptables, nftables and firewalld. There is even a confusion about management tool (firewalld) and available back-ends (iptables or nftables). In RHEL the preferred management tool is always firewalld. Regarding the back-ends, in RHEL7 it is used iptables while in RHEL8 and RHEL9 the nftables is used. This is the reason to no include the service_nftables_enabled in the RHEL7 profile. It would mess the firewalld + iptables requirements and likely cause disruptions.

On the other hands, using the related_rules parameter, we make it clear for developers that there is a rule for the requirement. In this case, there is a short context in the notes.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Thanks for explanation!

@codeclimate
Copy link

codeclimate bot commented Apr 4, 2023

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

View more on Code Climate.

@jan-cerny jan-cerny merged commit 7a9bb5f into ComplianceAsCode:master Apr 5, 2023
29 checks passed
@marcusburghardt marcusburghardt deleted the cis_nftables_service_rhel7_rhel8 branch April 5, 2023 13:06
@jan-cerny jan-cerny added the Update Profile Issues or pull requests related to Profiles updates. label Jun 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CIS CIS Benchmark related. RHEL7 Red Hat Enterprise Linux 7 product related. RHEL8 Red Hat Enterprise Linux 8 product related. Update Profile Issues or pull requests related to Profiles updates.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CIS 3.4.3.7 Ensure nftables service is enabled (Scored)
2 participants