-
Notifications
You must be signed in to change notification settings - Fork 698
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
Change custom zones check in firewalld_sshd_port_enabled #10162
Change custom zones check in firewalld_sshd_port_enabled #10162
Conversation
If any default zone is modified by the administrator, the respective zone file is placed in /etc/firewalld/zones dir in order to override the default zone settings. The same directory is applicable for new zones created by the administrator. Therefore, all files in this directory should also allow SSH. This test was updated in a reaction to OpenSCAP/openscap#1923, which changed the behavior of xmlfilecontent probe in OpenSCAP 1.3.7.
We were not able to find or create Copr project
Please check your configuration for:
|
/packit build |
The OVAL test is pretty complex. Could you describe what was the change? It seems to me that you converted the Then, is the problem with previous scanner versions the fact that there is always the equality although SSH is not allowed in all zones? |
Unfortunately it became a little more complex now to adapt for the scanner change.
You are correct.
Once the behavior for the
These two variables are compared and should match in a compliant system with newer scanner version. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The patch works, but I have suggested a simplification that worked locally.
If there is no special reason to use variable var_firewalld_sshd_port_enabled_custom_zone_files
I suggest removing it and reverting object_firewalld_sshd_port_enabled_zone_files_etc
to its previous form.
linux_os/guide/services/ssh/ssh_server/firewalld_sshd_port_enabled/oval/shared.xml
Outdated
Show resolved
Hide resolved
linux_os/guide/services/ssh/ssh_server/firewalld_sshd_port_enabled/oval/shared.xml
Outdated
Show resolved
Hide resolved
linux_os/guide/services/ssh/ssh_server/firewalld_sshd_port_enabled/oval/shared.xml
Show resolved
Hide resolved
Simplify definition of xmlfilecontent object for ssh services. There is no need to use a variable to define the object, the collected set will be the same.
Talked offline with @marcusburghardt and pushed 50bbd13. All test scenarios still pass with openscap-1.3.6 and 1.3.7. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Mab879 Could take a quick look too?
Thanks
Thanks for committing the simplification @yuumasato . I could only take a look on this next week. |
Code Climate has analyzed commit 50bbd13 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.5% (0.0% change). View more on Code Climate. |
I cannot corroborate that "All test scenarios still pass with openscap-1.3.6 and 1.3.7.". At least in my testing. |
I may have misunderstood Marcus and overstated the test results. Do you also get the same results, @marcusburghardt ? |
The simplification created by @yuumasato is pretty valid. However, also in my tests, they are failing for 1.3.6 and passing for 1.3.7. In my tests last week I didn't find a way pass on both versions without creating two different tests, one for each version. |
Yes @yuumasato . This is what I mentioned in the "Review Hints". |
Thanks, sorry for the confusion. |
The Automatus CS8, CS9 and Fedora tests are failing because containers are not applicable for this rule. The commands systemctl, firewall-cmd and nmcli are not available there. |
Relates to #9712 |
Description:
One test in the OVAL check of this rule verifies if new zones or customized zones allow ssh.
Basically, if any default zone is modified by the administrator, the respective zone file is placed in
/etc/firewalld/zones
directory in order to override the default zone settings.The same directory is applicable for new zones created by the administrator.
Therefore, all files in this directory should also allow SSH. This test was updated in a reaction to OpenSCAP/openscap#1923, which changed the behavior of
xmlfilecontent
probe in OpenSCAP 1.3.7.Rationale:
The previous behavior in OpenSCAP
xmlfilecontent
probe was caused by a bug which was fixed on1.3.7
release and consequently the OVAL check had to be adapted to the expected behavior.Review Hints:
This rule will fail in systems which use OpenSCAP version older than
1.3.7
.It is not feasible to keep compatibility with the old (also buggy) behavior.