Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: modules/fail2ban/manifests/filter.pp

Issue 29364214: Issue 2487 - Introduce fail2ban module (Closed)
Patch Set: Created Nov. 24, 2016, 3:09 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | modules/fail2ban/manifests/init.pp » ('j') | modules/fail2ban/manifests/init.pp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: modules/fail2ban/manifests/filter.pp
===================================================================
new file mode 100644
--- /dev/null
+++ b/modules/fail2ban/manifests/filter.pp
@@ -0,0 +1,39 @@
+# == Type: fail2ban::filter
+#
+# Manage filter information and files for any custom filter we create
mathias 2016/11/24 16:08:48 Please use un-personalized text in documentation,
f.lopez 2016/11/25 15:13:49 Acknowledged.
+#
+# == Parameters:
+#
+# [*failregex*]
+# The regular expressions used to detect break-in attempts, password failures, etc.
+# One per line
mathias 2016/11/24 16:08:48 A bit too specific. Something like "The regular ex
f.lopez 2016/11/25 15:13:48 Acknowledged.
+#
+# === Examples:
+#
+# filters => {
+# 'wordpress' => {
+# failregex => [
+# '^<HOST>.*\"WordPress\/.*',
+# ],
+# }
+# },
mathias 2016/11/24 16:08:48 The example is not valid Puppet code, a snippet at
f.lopez 2016/11/25 15:13:48 Acknowledged.
+define fail2ban::filter (
+ $failregex = undef,
+ $ensure = 'present',
mathias 2016/11/24 16:08:48 The $ensure parameter is not documented yet.
f.lopez 2016/11/25 15:13:49 Acknowledged.
+) {
+
+ include fail2ban
+ include stdlib
+
+ if $failregex != undef {
mathias 2016/11/24 16:08:48 This condition does not make much sense in this co
f.lopez 2016/11/25 15:13:49 There can be cases where an already existing filte
+ file {"/etc/fail2ban/filter.d/$title.conf":
+ ensure => $ensure,
+ content => template("fail2ban/filter.erb"),
+ group => 'root',
+ mode => '0644',
+ owner => 'root',
+ require => Package['fail2ban'],
+ notify => Service['fail2ban'],
+ }
+ }
+}
« no previous file with comments | « no previous file | modules/fail2ban/manifests/init.pp » ('j') | modules/fail2ban/manifests/init.pp » ('J')

Powered by Google App Engine
This is Rietveld