我使用Puppet Iptables模块来pipe理我的机器上的Iptables规则。 我想实现的速率限制失败的SSH连接,如下所述:
iptables -A INPUT -p tcp --dport 22 -m recent --update --seconds 60 --hitcount 5 --name SSH --rsource -j DROP iptables -A INPUT -p tcp --dport 22 -m recent --set --name SSH --rsource -j ACCEPT
是否有可能将其翻译成Puppet语法,如
firewall { '015 drop 5 failed attemps to connect to SSH in a minute ': proto => 'tcp', port => 22, action => 'drop', // what are the other paramters ? }
puppetlabs-firewall模块尽力支持所有的iptabels争论。 recent具体争论以一个单一的r作为前缀,例如rseconds而不是--seconds 。
尝试
firewall { '015 drop 5 failed attemps to connect to SSH in a minute ': proto => 'tcp', port => 22, action => 'drop', recent => 'update', rseconds => '60', rhitcount => '5', rname => 'SSH', rsource => true, }