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

getting actives firewall zones fails depending on configuration #12476

Open
mat000111 opened this issue Oct 7, 2024 · 0 comments
Open

getting actives firewall zones fails depending on configuration #12476

mat000111 opened this issue Oct 7, 2024 · 0 comments
Assignees
Labels
enhancement General enhancements to the project.
Milestone

Comments

@mat000111
Copy link

Share the context

I'm running the RHEL STIG which I derived from this project or at least that's my understanding. The ansible role is called ansible-role-rhel9-stig-main". I did confirm the issue is in both projects.

Description of problem:

In this project the file: linux_os/guide/services/ssh/ssh_server/firewalld_sshd_port_enabled/bash/shared.sh

When it gets active zones using: firewall-cmd --get-active-zones | grep -v interfaces
It can return a list that is not valid and the next task fails. This command assumes that "interfaces" is the only non zone line you can get but you can get things like "sources".

Proposed change:

change line: readarray -t firewalld_active_zones < <(firewall-cmd --get-active-zones | grep -v interfaces)

to: readarray -t firewalld_active_zones < <(firewall-cmd --get-active-zones | grep -v "^ ")

This will skip all lines that start with a space and give you only active zones.

Thank you,

@mat000111 mat000111 added the enhancement General enhancements to the project. label Oct 7, 2024
@Mab879 Mab879 added this to the 0.1.75 milestone Oct 16, 2024
@Mab879 Mab879 self-assigned this Oct 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement General enhancements to the project.
Projects
None yet
Development

No branches or pull requests

2 participants