-
Notifications
You must be signed in to change notification settings - Fork 153
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
ansible.posix.firewalld permanent rule issue. #451
Comments
This is a huge issue! The line - name: open ports
ansible.posix.firewalld:
port: "25/tcp"
permanent: yes
immediate: yes
state: enabled
zone: "public" Afterwards test using nc: on the server: [user@server]# nc -l 1234 On the client: echo "this is a huge problem" | nc <ip> 1234 Back on the server: [user@server]# nc -l 1234
this is a huge problem This potentially leaves many servers exposed. |
To expand on the above message, I have identified the problematic commit during testing. It is ee9df94 where apparently a protocol gets added to the config without the restriction to a single port. Using the above example by @rekup the file
before the ansible run to
after the run.
What makes this even more problematic, is that this does not show up as a change during the ansible run if the initial port is already open. |
The problem might be that in ansible.posix/plugins/modules/firewalld.py Lines 859 to 861 in ee9df94
protocol is used to save the protocol extracted from the port parameter. This is the same variable used by the newly introduced protocol parameter: ansible.posix/plugins/modules/firewalld.py Lines 949 to 963 in ee9df94
|
fix firewalld protocol SUMMARY This PR resolves an issue where opening a port (e.g. 25/tcp) resulted in opening all ports for the specified protocol (e.g. tcp) Fixes #451 ISSUE TYPE Bugfix Pull Request COMPONENT NAME ansible.posix.firewalld ADDITIONAL INFORMATION Many thanks to @nerrehmit and every one else who helped troubleshooting this!
Is there a release planned in the near future? I would strongly suggest to do one as soon as possible. This issue seems very urgent to me, as it de facto disabled the firewall on my systems completely without even showing a change in the playbook run. |
release 1.5.4 is out now and has the fix |
When I add a "permanent" rule in the following environment, all tcp communication permission rules are added with no change in the execution result.
The text was updated successfully, but these errors were encountered: