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

Added a new rule firewalld_service_disabled #9941

Merged

Conversation

rumch-se
Copy link
Contributor

@rumch-se rumch-se commented Dec 7, 2022

Description:

  • _A new SLE 15 rule as a part of CIS profile _

Rationale:

  • This rule covers CIS's requirements 3.5.2.2/3.5.3.1.3 Ensure firewalld is not installed or stopped and masked
    (Automated)

Review Hints:

  • Review hints here. Replace this text. Don't use the italics format!

  • Use this optional section to give any relevant information which could help the reviewer to more quickly and assertively understand and test the changes.

  • Good examples are useful commands, if it is better to review all commits together or in a suggested sequence, any relevant discussion in other PRs or issues, etc.

@openshift-ci
Copy link

openshift-ci bot commented Dec 7, 2022

Hi @rumch-se. 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/test-infra repository.

@openshift-ci openshift-ci bot added the needs-ok-to-test Used by openshift-ci bot. label Dec 7, 2022
@github-actions
Copy link

github-actions bot commented Dec 7, 2022

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

sle15 (from CTF) Environment (using Fedora as testing environment)
Open in Gitpod

Fedora Testing Environment
Open in Gitpod

Oracle Linux 8 Environment
Open in Gitpod

@Mab879 Mab879 added this to the 0.1.66 milestone Dec 7, 2022
@Mab879 Mab879 requested a review from a team December 7, 2022 16:03
@Mab879 Mab879 added SLES SUSE Linux Enterprise Server product related. New Rule Issues or pull requests related to new Rules. CIS CIS Benchmark related. labels Dec 7, 2022
@anivan-suse anivan-suse added the needs-rebase Used by openshift-ci bot. label Dec 7, 2022
@openshift-merge-robot openshift-merge-robot added needs-rebase Used by openshift-ci bot. and removed needs-rebase Used by openshift-ci bot. labels Dec 8, 2022
@vojtapolasek vojtapolasek self-assigned this Dec 14, 2022
@vojtapolasek
Copy link
Collaborator

@rumch-se please rebase.

@vojtapolasek
Copy link
Collaborator

Please rename the rule to
service_firewalld_disabled
We use this naming convention when utilizing the service_disabled template for rules.

Copy link
Collaborator

@vojtapolasek vojtapolasek left a comment

Choose a reason for hiding this comment

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

Thank you for the new rule. It needs just some small adjustments. Please see comments.

title: 'Verify firewalld service disabled'

description: |-
firewalld (Dynamic Firewall Manager) provides a dynamically managed firewall with
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
firewalld (Dynamic Firewall Manager) provides a dynamically managed firewall with
Firewalld (Dynamic Firewall Manager) provides a dynamically managed firewall with

{{{ describe_service_disable(service="firewalld") }}}

rationale: |-
Running both <b>nftables.service</b> and <b>firewalld.service</b> may lead to conflict and
Copy link
Collaborator

Choose a reason for hiding this comment

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

I would remove the mention of nftables and write something like... running Firewalld along other firewall solution may cause problems.
The reason is to keep the rule generic.

@openshift-merge-robot openshift-merge-robot removed the needs-rebase Used by openshift-ci bot. label Dec 14, 2022
@rumch-se
Copy link
Contributor Author

Hello @vojtapolasek
I have done proposed changes.
Have a nice day
Rumen

@@ -1104,6 +1105,7 @@ controls:
status: automated
rules:
- package_firewalld_removed
- firewalld_service_disabled
Copy link
Collaborator

Choose a reason for hiding this comment

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

This line also needs the new rule name.

@vojtapolasek
Copy link
Collaborator

Also I see that you are adding some CCE identifiers into the pool... this should not be part of this PR.

@rumch-se
Copy link
Contributor Author

Hello @vojtapolasek

I did not added these CCE numbers to the pull. I think that this is because of rebase and they are related to another (rules). Because of last changes which use CCE numbers and because validation of each PRs has some time lag we will have this effect of discrepancy.

To me more clear - this PR should "inherit" available numbers from previous PR which is 9937, but 9937 has to "inherit" available CCE numbers from 9932, 9932 from 9931, 9931 from 9930, 9930 from 9927, and 9927 from 9900. Unfortunately in this chain of PRs there are some PRs approved /9932 and 9937/ and the rest not - i.e. we have something like gaps related to the usage of available numbers.

Have a nice day.
Rumen

@vojtapolasek
Copy link
Collaborator

Hello,
could you please rebase so that unwanted modifications of CCE files go away? This PR should contain changes in CCE only related to the added rule.

@codeclimate
Copy link

codeclimate bot commented Dec 20, 2022

Code Climate has analyzed commit 1ae99ad 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 49.8% (1.0% change).

View more on Code Climate.

@vojtapolasek
Copy link
Collaborator

Automatus is failing because the rule is sle15 only. Thanks for updates, merging.

@vojtapolasek
Copy link
Collaborator

One of @ComplianceAsCode/suse-maintainers has to review this and accept.

@anivan-suse anivan-suse merged commit ebf5f30 into ComplianceAsCode:master Dec 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CIS CIS Benchmark related. needs-ok-to-test Used by openshift-ci bot. New Rule Issues or pull requests related to new Rules. SLES SUSE Linux Enterprise Server product related.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants