Need help translating rate limiting iptables rules to Puppet format

Posted by geoffroy on Server Fault See other posts from Server Fault or by geoffroy
Published on 2014-08-19T16:07:30Z Indexed on 2014/08/19 16:21 UTC
Read the original article Hit count: 187

Filed under:
|

I use Puppet Iptables module to manage Iptables rules on my machine. I'd like to implement to rate limit failed SSH connections as described here : Hundreds of failed ssh logins

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 

Is it possible to translate it to Puppet syntax, such as

firewall { '015 drop 5 failed attemps to connect to SSH in a minute ':
   proto   => 'tcp',
   port    => 22,
   action  => 'drop',
   // what are the other paramters ?
}

Any help welcome.

Best regards

Geoffroy

© Server Fault or respective owner

Related posts about iptables

Related posts about puppet