Hello,
I'm new to FreeBSD and trying to set up some sort of blocking for brute-force ssh attempts. Looking around it seemed like sshguard was a good solution. I tried to follow along with sshguard-setup(7) for the pf backend:
But when I try to do that and reload the pf.conf I get:
I'm sorry, I'm having trouble understanding two things.
1. How should I order the rules in my pf.conf file? (I've tried looking in the pf.conf(5) man page and reordering things but can't get it working)
2. Is my pf.conf file even good/correct? (I feel like I'm guessing and would just like to have a decent security setup)
Here's my current attempt at the pf.conf:
Thanks so much for any help!
I'm new to FreeBSD and trying to set up some sort of blocking for brute-force ssh attempts. Looking around it seemed like sshguard was a good solution. I tried to follow along with sshguard-setup(7) for the pf backend:
Code:
SSHGuard adds attackers to table <sshguard>. Create the table and block
attackers by adding the following lines to the end of pf.conf:
table <sshguard> persist
block in proto tcp from <sshguard>
But when I try to do that and reload the pf.conf I get:
Code:
/etc/pf.conf:7: Rules must be in order: options, normalization, queueing, translation, filtering
pfctl: Syntax error in config file: pf rules not loaded
I'm sorry, I'm having trouble understanding two things.
1. How should I order the rules in my pf.conf file? (I've tried looking in the pf.conf(5) man page and reordering things but can't get it working)
2. Is my pf.conf file even good/correct? (I feel like I'm guessing and would just like to have a decent security setup)
Here's my current attempt at the pf.conf:
Code:
block in all
pass quick on { lo0 lo1 }
scrub in all fragment reassemble max-mss 1440
pass in proto { tcp udp } to port ssh
pass in proto tcp to port { https }
pass out proto { tcp udp }
block in proto tcp from <sshguard>
table <sshguard> persist
Thanks so much for any help!