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

Add configuration option for iptables_chain #42

Merged
merged 3 commits into from
May 12, 2018

Conversation

brwyatt
Copy link
Contributor

@brwyatt brwyatt commented Jan 7, 2018

iptables is already pretty fiddly on its own. Allowing a user to select a custom chain for Fail2Ban to manage (instead of INPUT) will make this management quite a bit less headache-inducing.

This change doesn't manage the chain, just instructs Fail2Ban to use it, via the config file.

@bastelfreak
Copy link
Member

Hi @brwyatt, thanks for the PR. This repo got recently migrated to Vox Pupuli. Can you please rebase?

@brwyatt
Copy link
Contributor Author

brwyatt commented Mar 30, 2018

@bastelfreak Should be good now! Let me know if you need any further assistance to get this merged in.

Thanks!

@brwyatt
Copy link
Contributor Author

brwyatt commented Apr 3, 2018

Noticed the new updates to master. I've rebased again accordingly.

@bastelfreak
Copy link
Member

Hi @brwyatt, thanks for the rebase! Can you add at least one rspec test to verify the file content?

@brwyatt
Copy link
Contributor Author

brwyatt commented Apr 9, 2018

I've added in some tests to make sure the line is present (default of "INPUT" when using the templates), and additionally checking when the parameter is changed that it appears when using a template.

I'm hoping this is sufficient and what you were looking for. Feel free to point out if I've missed anything and I'll try to get things sorted out.

@brwyatt
Copy link
Contributor Author

brwyatt commented May 12, 2018

Hey @bastelfreak Saw the updates on master and have rebased on those changes. Also noticed the added template for stretch and have updated the tests to make sure it will cover all the template versions for all supported os versions (rather than defaulting to wheezy as some of the other tests do, but they aren't testing for template content), and have also added in an update to the README to include the iptables_chain parameter.

Let me know if you need anything else from me to before this can be merged.

end
end

context 'when content template and custom chain' do
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

acceptance tests \o/

@@ -33,6 +33,7 @@
Integer[0] $bantime = 432000,
String $email = "fail2ban@${::domain}",
String $sender = "fail2ban@${::fqdn}",
String $iptables_chain = 'INPUT',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

datatypes \o/

@bastelfreak bastelfreak added enhancement New feature or request and removed needs-tests labels May 12, 2018
@bastelfreak
Copy link
Member

Thanks for the updates @brwyatt !

@bastelfreak bastelfreak merged commit 353f1f7 into voxpupuli:master May 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants