ufw
: The ufw classufw::config
: Manages ufw related configuration filesufw::install
: Manages ufw packageufw::service
: Manages ufw service
ufw::params
: Parameters for the ufw class
The ufw class controls state of the ufw installation and service in the system. It also applies firewall rules.
class {'ufw':
manage_package => true,
package_name => 'ufw',
packege_ensure => 'present',
manage_service => 'true',
service_name => 'ufw',
service_ensure => 'running',
rules => {
'sample rule' => {
'ensure' => 'present',
'action' => 'allow',
'direction' => 'out',
'interface' => 'eth0',
'log' => 'log',
'from_addr' => '10.1.3.0/24',
'from_ports_app' => 3133,
'to_addr' => '10.3.3.3',
'to_ports_app' => 2122,
'proto' => 'tcp',
},
},
routes => {
'sample route' => {
'ensure' => 'present',
'action' => 'allow',
'interface_in' => 'any',
'interface_out' => 'any',
'log' => 'log',
'from_addr' => 'any',
'from_ports_app' => undef,
'to_addr' => '10.5.0.0/24',
'to_ports_app' => undef,
'proto' => 'any',
},
},
purge_unmanaged_rules => true,
purge_unmanaged_routes => true,
log_level => 'low',
manage_default_config => true,
default_config_content => file('ufw/default'),
manage_logrotate_config => true,
logrotate_config_content => file('ufw/logrotate'),
manage_rsyslog_config => true,
rsyslog_config_content => file('ufw/rsyslog'),
manage_sysctl_config => true,
sysctl_config_content => file('ufw/sysctl'),
manage_before_rules => true,
before_rules_content => file('ufw/before'),
manage_before6_rules => true,
before6_rules_content => file('ufw/before6'),
manage_after_rules => true,
after_rules_content => file('ufw/after'),
manage_after6_rules => true,
after6_rules_content => file('ufw/after6'),
}
The following parameters are available in the ufw
class:
manage_package
package_name
packege_ensure
manage_service
service_ensure
service_name
rules
routes
purge_unmanaged_rules
purge_unmanaged_routes
log_level
manage_default_config
default_config_content
manage_logrotate_config
logrotate_config_content
manage_rsyslog_config
rsyslog_config_content
manage_sysctl_config
sysctl_config_content
manage_before_rules
before_rules_content
manage_before6_rules
before6_rules_content
manage_after_rules
after_rules_content
manage_after6_rules
after6_rules_content
Data type: Boolean
If the class should manage an ufw package.
Default value: $ufw::params::manage_package
Data type: String[1]
Ufw package to manage.
Default value: $ufw::params::package_name
Data type: String[1]
What state the package should be in.
Default value: $ufw::params::package_ensure
Data type: Boolean
If the module should manage the ufw service state.
Default value: $ufw::params::manage_service
Data type: Stdlib::Ensure::Service
Defines the state of the ufw service.
Default value: $ufw::params::service_ensure
Data type: String[1]
The name of the ufw service to manage.
Default value: $ufw::params::service_name
Data type: Hash[String[1], Hash]
Rule definitions to apply.
Default value: $ufw::params::rules
Data type: Hash[String[1], Hash]
Routing definitions to apply.
Default value: $ufw::params::routes
Data type: Boolean
Defines if unmanaged rules should be purged. Default: false
Default value: $ufw::params::purge_unmanaged_rules
Data type: Boolean
Defines if unmanaged routes should be purged. Default: false
Default value: $ufw::params::purge_unmanaged_routes
Data type: Ufw::LogLevel
Logging level. Default: 'low'
Default value: $ufw::params::log_level
Data type: Boolean
If the module should manage /etc/default/ufw. Default: true
Default value: $ufw::params::manage_default_config
Data type: String[1]
Configuration content to put to /etc/default/ufw. Default is taken from files/default of this module.
Default value: $ufw::params::default_config_content
Data type: Boolean
If the module should manage /etc/logrotate.d/ufw. Default: true
Default value: $ufw::params::manage_logrotate_config
Data type: String[1]
Configuration content to put to /etc/logrotate.d/ufw. Default is taken from files/logrotate of this module.
Default value: $ufw::params::logrotate_config_content
Data type: Boolean
If the module should manage /etc/rsyslog.d/20-ufw.conf. Default: true
Default value: $ufw::params::manage_rsyslog_config
Data type: String[1]
Configuration content to put to /etc/rsyslog.d/20-ufw.conf. Default is taken from files/ufw of this module.
Default value: $ufw::params::rsyslog_config_content
Data type: Boolean
If the module should manage /etc/ufw/sysctl.conf. Default: true
Default value: $ufw::params::manage_sysctl_config
Data type: String[1]
Configuration content to put to /etc/ufw/sysctl.conf. Default is taken from files/sysctl of this module.
Default value: $ufw::params::sysctl_config_content
Data type: Boolean
Controls if the module should manage /etc/ufw/before.rules. Default: true
Default value: $ufw::params::manage_before_rules
Data type: String[1]
Configuration content to put to /etc/ufw/before.rules. Default is taken from files/before.rules of this module.
Default value: $ufw::params::before_rules_content
Data type: Boolean
Controls if the module should manage /etc/ufw/before6.rules. Default: true
Default value: $ufw::params::manage_before6_rules
Data type: String[1]
Configuration content to put to /etc/ufw/before6.rules. Default is taken from files/before6.rules of this module.
Default value: $ufw::params::before6_rules_content
Data type: Boolean
Controls if the module should manage /etc/ufw/after.rules. Default: true
Default value: $ufw::params::manage_after_rules
Data type: String[1]
Configuration content to put to /etc/ufw/after.rules. Default is taken from files/after.rules of this module.
Default value: $ufw::params::after_rules_content
Data type: Boolean
Controls if the module should manage /etc/ufw/after6.rules. Default: true
Default value: $ufw::params::manage_after6_rules
Data type: String[1]
Configuration content to put to /etc/ufw/after6.rules. Default is taken from files/after6.rules of this module.
Default value: $ufw::params::after6_rules_content
Manages ufw related configuration files.
class {'ufw::config':
log_level => 'low',
manage_default_config => true,
default_config_content => file('ufw/default'),
manage_logrotate_config => true,
logrotate_config_content => file('ufw/logrotate'),
manage_rsyslog_config => true,
rsyslog_config_content => file('ufw/rsyslog'),
manage_sysctl_config => true,
sysctl_config_content => file('ufw/sysctl'),
manage_before_rules => true,
before_rules_content => file('ufw/before.rules'),
manage_before6_rules => true,
before6_rules_content => file('ufw/before6.rules'),
manage_after_rules => true,
after_rules_content => file('ufw/after.rules'),
manage_after6_rules => true,
after6_rules_content => file('ufw/after.rules'),
}
The following parameters are available in the ufw::config
class:
log_level
manage_default_config
default_config_content
manage_logrotate_config
logrotate_config_content
manage_rsyslog_config
rsyslog_config_content
manage_sysctl_config
sysctl_config_content
manage_before_rules
before_rules_content
manage_before6_rules
before6_rules_content
manage_after_rules
after_rules_content
manage_after6_rules
after6_rules_content
Data type: Ufw::LogLevel
Logging level. Default: 'low'
Default value: $ufw::log_level
Data type: Boolean
Controls if the module should manage /etc/default/ufw.
Default value: $ufw::manage_default_config
Data type: String[1]
Configuration content to put to /etc/default/ufw.
Default value: $ufw::default_config_content
Data type: Boolean
Controls if the module should manage /etc/logrotate.d/ufw.
Default value: $ufw::manage_logrotate_config
Data type: String[1]
Configuration content to put to /etc/logrotate.d/ufw.
Default value: $ufw::logrotate_config_content
Data type: Boolean
Controls if the module should manage /etc/rsyslog.d/20-ufw.conf.
Default value: $ufw::manage_rsyslog_config
Data type: String[1]
Configuration content to put to /etc/rsyslog.d/20-ufw.conf.
Default value: $ufw::rsyslog_config_content
Data type: Boolean
Controls if the module should manage /etc/ufw/sysctl.conf.
Default value: $ufw::manage_sysctl_config
Data type: String[1]
Configuration content to put to /etc/ufw/sysctl.conf.
Default value: $ufw::sysctl_config_content
Data type: Boolean
Controls if the module should manage /etc/ufw/before.rules.
Default value: $ufw::manage_before_rules
Data type: String[1]
Configuration content to put to /etc/ufw/before.rules.
Default value: $ufw::before_rules_content
Data type: Boolean
Controls if the module should manage /etc/ufw/before6.rules.
Default value: $ufw::manage_before6_rules
Data type: String[1]
Configuration content to put to /etc/ufw/before6.rules.
Default value: $ufw::before6_rules_content
Data type: Boolean
Controls if the module should manage /etc/ufw/after.rules.
Default value: $ufw::manage_after_rules
Data type: String[1]
Configuration content to put to /etc/ufw/after.rules.
Default value: $ufw::after_rules_content
Data type: Boolean
Controls if the module should manage /etc/ufw/after6.rules.
Default value: $ufw::manage_after6_rules
Data type: String[1]
Configuration content to put to /etc/ufw/after6.rules.
Default value: $ufw::after6_rules_content
This class manages ufw package installation.
class {'ufw::install':
manage_package => true,
package_name => 'ufw',
packege_ensure => 'present',
}
The following parameters are available in the ufw::install
class:
Data type: Boolean
If the class should manage an ufw package.
Default value: $ufw::manage_package
Data type: String[1]
Ufw package to manage.
Default value: $ufw::package_name
Data type: String[1]
What state the package should be in.
Default value: $ufw::packege_ensure
Manages ufw service.
class {'ufw::service':
manage_service => true,
service_ensure => 'running',
service_name => 'ufw',
}
The following parameters are available in the ufw::service
class:
Data type: Boolean
If the module should manage the ufw service state.
Default value: $ufw::manage_service
Data type: Stdlib::Ensure::Service
Defines the state of the ufw service.
Default value: $ufw::service_ensure
Data type: String[1]
The name of the ufw service to manage.
Default value: $ufw::service_name
This type provides Puppet with the capabilities to manage ufw routing rules.
Important: The default action is reject
, so traffic would be rejected
if action
parameter is omitted.
Autorequires:
Class[ufw::install]
ufw_route { 'route vpn traffic to internal net':
ensure => 'present',
action => 'allow',
interface_in => 'tun0',
interface_out => 'eth0',
log => 'log',
from_addr => 'any',
from_ports_app => undef,
to_addr => '10.5.0.0/24',
to_ports_app => undef,
proto => 'any',
}
The following properties are available in the ufw_route
type.
Data type: Enum[allow, deny, reject, limit]
Action to perform. default: reject
Default value: reject
Data type: Enum[present, absent]
Whether this resource should be present or absent on the target system.
Default value: present
Data type: Optional[String]
Source address. default: any
Default value: any
Data type: Optional[Variant[Integer, String]]
Source address ports or app.
Data type: Optional[String]
Interface that recieves traffic.
Data type: Optional[String]
Interface that sends traffic.
Data type: Optional[Enum[log, log-all]]
Logging option.
Data type: Optional[String]
Protocol. default: any
Default value: any
Data type: Optional[String]
Destination address. default: any
Default value: any
Data type: Optional[Variant[Integer, String]]
Destination address ports or app.
The following parameters are available in the ufw_route
type.
namevar
Data type: String
The name of the resource you want to manage.
This type provides Puppet with the capabilities to manage regular ufw rules.
Important: The default action is reject
, so traffic would be rejected
if action
parameter is omitted.
Autorequires:
Class[ufw::install]
ufw_rule { 'allow ssh from internal networks':
ensure => 'present',
action => 'allow',
direction => 'in',
interface => undef,
log => undef,
from_addr => '10.1.3.0/24',
from_ports_app => 'any',
to_addr => '10.3.0.1',
to_ports_app => 22,
proto => 'tcp',
}
The following properties are available in the ufw_rule
type.
Data type: Enum[allow, deny, reject, limit]
Action to perform. default: reject
Default value: reject
Data type: Enum['in', 'out']
Traffic direction. default: in
Default value: in
Data type: Enum[present, absent]
Whether this resource should be present or absent on the target system.
Default value: present
Data type: Optional[String]
Source address. default: any
Default value: any
Data type: Optional[Variant[Integer, String]]
Source address ports or app.
Data type: Optional[String]
Interface that recieves traffic.
Data type: Optional[Enum[log, log-all]]
Logging option.
Data type: Optional[String]
Protocol. default: any
Default value: any
Data type: Optional[String]
Destination address. default: any
Default value: any
Data type: Optional[Variant[Integer, String]]
Destination address ports or app.
The following parameters are available in the ufw_rule
type.
namevar
Data type: String
The name of the resource you want to manage.
The Ufw::LogLevel data type.
Alias of
Enum['off', 'low', 'medium', 'high', 'full']