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

Allow changing the ports of the fail2banned services #48

Open
wants to merge 16 commits into
base: master
Choose a base branch
from
Open

Allow changing the ports of the fail2banned services #48

wants to merge 16 commits into from

Conversation

brunorro
Copy link

@brunorro brunorro commented Apr 3, 2018

Pull Request (PR) description

This request allows changing the default port for any service watched by fail2ban. Check Readme.md for the usage of the "ports" parameter.

Most changes made in this request are just ternary operators on templates and the addition of the "ports" parameter hash to init.pp

This Pull Request (PR) fixes the following issues

Adds feature: Allow modification of default ports for each service

@@ -33,6 +33,7 @@
$bantime = 432000,
$email = "fail2ban@${::domain}",
$jails = ['ssh', 'ssh-ddos'],
$jail_ports = {},
Copy link
Member

Choose a reason for hiding this comment

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

Please add a datatype to the new parmeter.

@@ -59,6 +60,7 @@

validate_hash($config_file_hash)
validate_hash($config_file_options_hash)
validate_hash($jail_ports)
Copy link
Member

Choose a reason for hiding this comment

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

the validate_* method isn't needed when a datatype is used.

@@ -187,7 +187,7 @@ action = %(<%= scope['::fail2ban::action'] %>)s

[sshd]
enabled = <%= scope['::fail2ban::jails'].include? "sshd" %>
port = ssh
port = <%= scope['::fail2ban::jail_ports'].key?('sshd') ? scope['::fail2ban::jail_ports']['sshd'] : 'ssh' %>
Copy link
Member

Choose a reason for hiding this comment

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

The scope method is deprecated, can you instead use this style or convert the template to epp?

Instead of using so many ternary statements we should use a defaults hash, merge that once with $jail_ports and afterwards directly access the hash in the templates

@bastelfreak bastelfreak added the needs-work not ready to merge just yet label May 17, 2018
@bastelfreak
Copy link
Member

HI @brunorro, thanks for the PR.Pleas:

  • Take a look at the inline comments
  • rebase
  • take a look at the used email address in the commits, it isn't associated with your github account

@vox-pupuli-tasks
Copy link

Dear @brunorro, thanks for the PR!

This is pccibot, your friendly Vox Pupuli GitHub Bot. I noticed that your pull request contains merge conflict. Can you please rebase?

You can find my sourcecode at voxpupuli/vox-pupuli-tasks

@vox-pupuli-tasks
Copy link

Dear @brunorro, thanks for the PR!

This is pccibot, your friendly Vox Pupuli GitHub Bot. I noticed that your pull request contains merge conflict. Can you please rebase?

You can find my sourcecode at voxpupuli/vox-pupuli-tasks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merge-conflicts needs-work not ready to merge just yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants