geerlingguy / ansible-role-firewall

Ansible Role - iptables Firewall configuration.
https://galaxy.ansible.com/geerlingguy/firewall/
MIT License
524 stars 217 forks source link

Flush rules for INPUT chain only (for compatibility with docker) #106

Closed vitabaks closed 2 months ago

vitabaks commented 1 year ago

This pull request refactors the firewall playbook to introduce the ability to flush only the INPUT chains, while leaving other chains (such as DOCKER chains) untouched. This change is made to ensure compatibility with Docker configurations.

The following changes have been made:

  1. Added new variables:

    • firewall_flush_rules_input_nat: Indicates whether to flush the INPUT chain in the 'nat' table.
    • firewall_flush_rules_input_mangle: Indicates whether to flush the INPUT chain in the 'mangle' table.
    • firewall_flush_rules_input_filter: Indicates whether to flush the INPUT chain in the 'filter' table.
  2. Updated the playbook logic:

    • The flush rules for the INPUT chain are now conditioned based on the new variables mentioned above.
    • This change allows selective flushing of the INPUT chains, leaving other chains untouched.

These changes ensure compatibility with Docker configurations and provide more flexibility in managing firewall rules.

github-actions[bot] commented 9 months ago

This pr has been marked 'stale' due to lack of recent activity. If there is no further activity, the issue will be closed in another 30 days. Thank you for your contribution!

Please read this blog post to see the reasons why I mark issues as stale.

etoosamoe commented 9 months ago

This works pretty well! 👍

kare commented 9 months ago

This PR should fix issues #80 and #82.

kare commented 9 months ago

@etoosamoe Do you think this PR is ready for a merge?

etoosamoe commented 9 months ago

@etoosamoe Do you think this PR is ready for a merge?

Definitely. It does exactly what it supposed to do - add controls if we want to flush some another chains.

github-actions[bot] commented 5 months ago

This pr has been marked 'stale' due to lack of recent activity. If there is no further activity, the issue will be closed in another 30 days. Thank you for your contribution!

Please read this blog post to see the reasons why I mark issues as stale.

github-actions[bot] commented 2 months ago

This pr has been closed due to inactivity. If you feel this is in error, please reopen the issue or file a new issue with the relevant details.

robcxyz commented 1 week ago

Can this be reopened / merged?