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

Support overriding service notifications (#143) #144

Merged
merged 12 commits into from
Apr 29, 2020

Conversation

deric
Copy link
Contributor

@deric deric commented Apr 28, 2020

Pull Request (PR) description

Support e-mail notification configuration directly from Puppet/Hiera.

This Pull Request (PR) fixes the following issues

Fixes #143

[Init]
<% $config.keys.each |$key| { -%>
<%= $key %> = <%= $fail2ban::sendmail_config[$key] %>
<% } -%>
Copy link
Member

Choose a reason for hiding this comment

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

please fix the missing \n at the end of the file

@@ -0,0 +1,11 @@
# Override the Fail2Ban defaults in sendmail-common.conf with these entries
<% include stdlib %>
Copy link
Member

Choose a reason for hiding this comment

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

is that include required for anything? I think we can omit it.

@bastelfreak bastelfreak added enhancement New feature or request needs-work not ready to merge just yet labels Apr 28, 2020
@bastelfreak
Copy link
Member

Hi @deric, thanks for the work! I made a tiny inline comment. Please have a look.

@deric
Copy link
Contributor Author

deric commented Apr 28, 2020

@bastelfreak Sure thing, all objections should be fixed.

@deric
Copy link
Contributor Author

deric commented Apr 28, 2020

Unfortunately these changes aren't enough to disable notifications. Notifications are defined in multiple files.

$ fail2ban-client get sshd action sendmail-buffered actionstart
printf %b "Subject: [Fail2Ban] <name>: started on `uname -n`
From: <sendername> <<sender>>
To: <dest>\n
Hi,\n
The jail <name> has been started successfully.\n
Output will be buffered until <lines> lines are available.\n
Regards,\n
Fail2Ban" | /usr/sbin/sendmail -f <sender> <dest>

I'll try to include integration tests in order to ensure that this really works as expected.

@bastelfreak bastelfreak removed the needs-work not ready to merge just yet label Apr 29, 2020
@bastelfreak bastelfreak merged commit 6300d5a into voxpupuli:master Apr 29, 2020
@bastelfreak
Copy link
Member

thanks for the PR!

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.

Option to disable service start/stop notifications
2 participants