2026-04-05 15:16:48 +02:00
|
|
|
## confdroid_ssh::firewall::iptables.pp
|
|
|
|
|
# Module name: confdroid_ssh
|
|
|
|
|
# Author: 12ww1160 (12ww1160@confdroid.com)
|
|
|
|
|
# @summary Class manages firewall rules for SSH
|
|
|
|
|
##############################################################################
|
|
|
|
|
class confdroid_ssh::firewall::iptables (
|
|
|
|
|
|
|
|
|
|
) inherits confdroid_ssh::params {
|
2026-04-09 14:12:26 +02:00
|
|
|
if $ssh_use_firewall == true {
|
2026-04-05 15:16:48 +02:00
|
|
|
firewall { "${ssh_fw_order}${ssh_fw_port} allow SSH on port ${ssh_fw_port}":
|
|
|
|
|
ensure => 'present',
|
|
|
|
|
proto => 'tcp',
|
2026-04-05 15:26:08 +02:00
|
|
|
source => $ssh_source_range,
|
2026-04-05 15:16:48 +02:00
|
|
|
dport => $ssh_fw_port,
|
2026-04-05 15:26:08 +02:00
|
|
|
jump => 'accept',
|
2026-04-05 15:16:48 +02:00
|
|
|
}
|
2026-04-09 14:15:05 +02:00
|
|
|
}
|
2026-04-09 14:19:04 +02:00
|
|
|
if $ssh_use_firewall == false {
|
2026-04-09 14:12:26 +02:00
|
|
|
firewall { "${ssh_fw_order}${ssh_fw_port} remove SSH on port ${ssh_fw_port}":
|
|
|
|
|
ensure => 'absent',
|
|
|
|
|
proto => 'tcp',
|
|
|
|
|
source => $ssh_source_range,
|
|
|
|
|
dport => $ssh_fw_port,
|
|
|
|
|
jump => 'accept',
|
|
|
|
|
}
|
2026-04-05 15:16:48 +02:00
|
|
|
}
|
|
|
|
|
}
|