fail2ban
: Installs, configures and manages the Fail2ban service.fail2ban::install
: == Class: fail2ban::install
fail2ban::config
: Handles the configuration file.fail2ban::service
: Handles the service.
fail2ban::define
: == Define: fail2ban::definefail2ban::jail
: Handles the jails.
Fail2ban::Logpath
: Describes logpath format allowedFail2ban::Time
: Describes time format allowed for bantime and findtime The time entries in fail2ban configuration (like findtime or bantime) can be provided
This module installs, configures and manages the Fail2ban service. Main class, includes all other classes.
The following parameters are available in the fail2ban
class:
package_ensure
package_name
package_list
config_dir_path
config_dir_purge
config_dir_recurse
config_dir_source
config_file_path
config_file_owner
config_file_group
config_file_mode
config_file_source
config_file_string
config_file_template
config_file_notify
config_file_require
config_file_hash
config_file_options_hash
manage_defaults
manage_firewalld
service_ensure
service_name
service_enable
action
bantime
email
sender
iptables_chain
jails
maxretry
whitelist
custom_jails
banaction
config_file_before
config_dir_filter_path
default_backend
sendmail_config
sendmail_actions
Data type: Enum['absent', 'latest', 'present', 'purged']
Determines if the package should be installed.
Default value: 'present'
Data type: String[1]
Determines the name of package to manage.
Default value: 'fail2ban'
Data type: Optional[Array[String]]
Determines if additional packages should be managed.
Default value: undef
Data type: Stdlib::Absolutepath
Determines if the configuration directory should be managed.
Default value: '/etc/fail2ban'
Data type: Boolean
Determines if unmanaged configuration files should be removed.
Default value: false
Data type: Boolean
Determines if the configuration directory should be recursively managed.
Default value: true
Data type: Optional[String]
Determines the source of a configuration directory.
Default value: undef
Data type: Stdlib::Absolutepath
Determines if the configuration file should be managed.
Default value: '/etc/fail2ban/jail.conf'
Data type: String[1]
Determines which user should own the configuration file.
Default value: 'root'
Data type: String[1]
Determines which group should own the configuration file.
Default value: 'root'
Data type: String[1]
Determines the desired permissions mode of the configuration file.
Default value: '0644'
Data type: Optional[String[1]]
Determines the source of a configuration file.
Default value: undef
Data type: Optional[String[1]]
Determines the content of a configuration file.
Default value: undef
Data type: Optional[String[1]]
Determines the content of a configuration file.
Default value: undef
Data type: String[1]
Determines if the service should be restarted after configuration changes.
Default value: 'Service[fail2ban]'
Data type: String[1]
Determines which package a configuration file depends on.
Default value: 'Package[fail2ban]'
Data type: Hash[String[1], Any]
Determines which configuration files should be managed via fail2ban::define
.
Default value: {}
Data type: Hash
Determines which parameters should be passed to an ERB template.
Default value: {}
Data type: Enum['absent', 'present']
Determines whether the file /etc/fail2ban/jail.d/defaults-debian.conf
should be deleted or not.
Default value: 'absent'
Data type: Enum['absent', 'present']
Determines whether the file /etc/fail2ban/jail.d/00-firewalld.conf
should be deleted or not.
Default value: 'absent'
Data type: Enum['running', 'stopped']
Determines if the service should be running or not.
Default value: 'running'
Data type: String[1]
Determines the name of service to manage.
Default value: 'fail2ban'
Data type: Boolean
Determines if the service should be enabled at boot.
Default value: true
Data type: String[1]
Determines how banned ip addresses should be reported.
Default value: 'action_mb'
Data type: Fail2ban::Time
Determines how many time (second or hour or week) ip addresses will be banned.
Default value: 432000
Data type: String[1]
Determines which email address should be notified about restricted hosts and suspicious logins.
Default value: "fail2ban@${facts['networking']['domain']}"
Data type: String[1]
Determines which email address should notify about restricted hosts and suspicious logins.
Default value: "fail2ban@${facts['networking']['fqdn']}"
Data type: String[1]
Determines chain where jumps will to be added in iptables-* actions.
Default value: 'INPUT'
Data type: Array[String[1]]
Determines which services should be protected by Fail2ban.
Default value: ['ssh', 'ssh-ddos']
Data type: Integer[0]
Determines the number of failed login attempts needed to block a host.
Default value: 3
Data type: Array
Determines which ip addresses will not be reported
Default value: ['127.0.0.1/8', '192.168.56.0/24']
Data type: Hash[String, Hash]
Determines which custom jails should be included
Default value: {}
Data type: String[1]
Determines which action to perform when performing a global ban (not overridden in a specific jail).
Default value: 'iptables-multiport'
Data type: String[1]
Data type: Stdlib::Absolutepath
Default value: '/etc/fail2ban/filter.d'
Data type: Enum['pyinotify', 'gamin', 'polling', 'systemd', 'auto']
Default value: 'auto'
Data type: Hash
Default value: {}
Data type: Hash
Default value: {}
== Class: fail2ban::install
== Define: fail2ban::define
The following parameters are available in the fail2ban::define
defined type:
config_file_path
config_file_owner
config_file_group
config_file_mode
config_file_source
config_file_string
config_file_template
config_file_notify
config_file_require
config_file_options_hash
Data type: Stdlib::Absolutepath
Default value: "${fail2ban::config_dir_path}/${title}"
Data type: String
Default value: $fail2ban::config_file_owner
Data type: String
Default value: $fail2ban::config_file_group
Data type: String
Default value: $fail2ban::config_file_mode
Data type: Optional[String]
Default value: undef
Data type: Optional[String]
Default value: undef
Data type: Optional[String]
Default value: undef
Data type: String
Default value: $fail2ban::config_file_notify
Data type: String
Default value: $fail2ban::config_file_require
Data type: Hash
Default value: $fail2ban::config_file_options_hash
Handles the jails.
The following parameters are available in the fail2ban::jail
defined type:
logpath
filter_includes
filter_failregex
filter_ignoreregex
filter_maxlines
filter_datepattern
filter_additional_config
enabled
action
filter
maxretry
findtime
bantime
port
backend
journalmatch
ignoreip
config_dir_filter_path
config_file_owner
config_file_group
config_file_mode
config_file_source
config_file_notify
config_file_require
Data type: Optional[Fail2ban::Logpath]
Filename(s) of the log files to be monitored
Default value: undef
Data type: Optional[String]
Default value: undef
Data type: Optional[String]
Default value: undef
Data type: Optional[String]
Default value: undef
Data type: Optional[Integer]
Default value: undef
Data type: Optional[String]
Default value: undef
Data type: Any
Default value: undef
Data type: Boolean
Default value: true
Data type: Optional[String]
Default value: undef
Data type: String
Default value: $title
Data type: Integer
Default value: $fail2ban::maxretry
Data type: Optional[Fail2ban::Time]
Default value: undef
Data type: Fail2ban::Time
Default value: $fail2ban::bantime
Data type: Optional[String]
Default value: undef
Data type: Optional[String]
Default value: undef
Data type: Optional[String[1]]
Default value: undef
Data type: Array[Stdlib::IP::Address]
Default value: []
Data type: Stdlib::Absolutepath
Default value: $fail2ban::config_dir_filter_path
Data type: Optional[String]
Default value: $fail2ban::config_file_owner
Data type: Optional[String]
Default value: $fail2ban::config_file_group
Data type: Optional[String]
Default value: $fail2ban::config_file_mode
Data type: Optional[String]
Default value: $fail2ban::config_file_source
Data type: Optional[String]
Default value: $fail2ban::config_file_notify
Data type: Optional[String]
Default value: $fail2ban::config_file_require
Describes logpath format allowed
Alias of Variant[String[1], Array[String[1]]]
Describes time format allowed for bantime and findtime The time entries in fail2ban configuration (like findtime or bantime) can be provided as integer in seconds or as string using special abbreviation format (e. g. 600 is the same as 10m).
Abbreviation tokens:
years?, yea?, yy? months?, mon? weeks?, wee?, ww? days?, da, dd? hours?, hou?, hh? minutes?, min?, mm? seconds?, sec?, ss?
The question mark (?) means the optional character, so day as well as days can be used.
You can combine multiple tokens in format (separated with space resp. without separator), e. g.: 1y 6mo or 1d12h30m. Note that tokens m as well as mm means minutes, for month use abbreviation mo or mon.
The time format can be tested using fail2ban-client:
fail2ban-client --str2sec 1d12h
Alias of Variant[Integer[0], Pattern['^\d.*$']]
Ban IPs in a jail
Supports noop? false
Data type: String[1]
The jail to operate on
Data type: Array[Stdlib::IP::Address]
IP addresses to ban
Unban IP in all jails and database
Supports noop? false
Data type: Array[Stdlib::IP::Address]
IP addresses to unban
Unban IP in a jail
Supports noop? false
Data type: String[1]
The jail to operate on
Data type: Array[Stdlib::IP::Address]
IP addresses to unban