-
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
firewalld_sshd_port_enabled
add zone to all connections
#12256
Conversation
Works on RHEL 9.0 aarch with
|
This datastream diff is auto generated by the check Click here to see the full diffbash remediation for rule 'xccdf_org.ssgproject.content_rule_firewalld_sshd_port_enabled' differs.
--- xccdf_org.ssgproject.content_rule_firewalld_sshd_port_enabled
+++ xccdf_org.ssgproject.content_rule_firewalld_sshd_port_enabled
@@ -22,7 +22,7 @@
firewall-cmd --zone="$firewalld_sshd_zone" --add-service=ssh
# This will collect all NetworkManager connections names
- readarray -t nm_connections < <(nmcli -f UUID,TYPE con | grep ethernet | awk '{ print $1 }')
+ readarray -t nm_connections < <(nmcli -g UUID,TYPE con | grep -v loopback | awk -F ':' '{ print $1 }')
# If the connection is not yet assigned to a firewalld zone, assign it to the proper zone.
# This will not change connections which are already assigned to any firewalld zone.
for connection in "${nm_connections[@]}"; do
ansible remediation for rule 'xccdf_org.ssgproject.content_rule_firewalld_sshd_port_enabled' differs.
--- xccdf_org.ssgproject.content_rule_firewalld_sshd_port_enabled
+++ xccdf_org.ssgproject.content_rule_firewalld_sshd_port_enabled
@@ -53,7 +53,7 @@
- name: Enable SSH Server firewalld Firewall Exception - Collect NetworkManager
connections names
ansible.builtin.shell:
- cmd: nmcli -f UUID,TYPE con | grep ethernet | awk '{ print $1 }'
+ cmd: nmcli -g UUID,TYPE con | grep -v loopback | awk -F ':' '{ print $1 }'
register: result_nmcli_cmd_connections_names
changed_when: false
|
Change in Ansible Please consider using more suitable Ansible module than |
Please back port this to |
🤖 A k8s content image for this PR is available at: Click here to see how to deploy itIf you alread have Compliance Operator deployed: Otherwise deploy the content and operator together by checking out ComplianceAsCode/compliance-operator and: |
The tests feature a similar string of |
7fcfce3
to
cefd5ba
Compare
Right, it's unlikely someone would have VM with non-ethernet type. But updated, to keep it aligned with remediation |
Change in Ansible Please consider using more suitable Ansible module than |
Code Climate has analyzed commit cefd5ba 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 59.4% (0.0% change). View more on Code Climate. |
Automatus errors are expected as the remediation required running firewalld and NetworkManager services |
Description:
Configure
zone=...
for all non-loopback connections on the system.ethernet
is not the only type that can be connected to machine https://docs.fedoraproject.org/en-US/quick-docs/configuring-ip-networking-with-nmcli/#_the_nmcli_optionsRationale:
Fixes issue when remediation failed on system with
infiniband
connection.Fixes #12233
Review Hints:
and see Testing Farm CI
and ideally test on aarch64 system, the one with
infiniband
connection