Skip to content

Commit

Permalink
Merge pull request #12522 from Mab879/fix_12476
Browse files Browse the repository at this point in the history
Update remedation for firewalld_sshd_port_enabled
  • Loading branch information
jan-cerny authored Oct 22, 2024
2 parents 9844a54 + 8e2d767 commit 98b98b5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@

- name: '{{{ rule_title }}} - Collect firewalld active zones'
ansible.builtin.shell:
cmd: firewall-cmd --get-active-zones | grep -v interfaces
cmd: firewall-cmd --get-active-zones | grep -v "^ " | cut -d " " -f 1
register: result_firewall_cmd_zones_names
changed_when: false

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ else
systemctl restart NetworkManager

# Active zones are zones with at least one interface assigned to it.
# It is possible that traffic is comming by any active interface and consequently any
# It is possible that traffic is coming by any active interface and consequently any
# active zone. So, this make sure all active zones are permanently allowing SSH service.
readarray -t firewalld_active_zones < <(firewall-cmd --get-active-zones | grep -v interfaces)
readarray -t firewalld_active_zones < <(firewall-cmd --get-active-zones | grep -v "^ " | cut -d " " -f 1)
for zone in "${firewalld_active_zones[@]}"; do
firewall-cmd --permanent --zone="$zone" --add-service=ssh
done
Expand Down

0 comments on commit 98b98b5

Please sign in to comment.