Hi there. I have a VPS running nginx as web server, local unbound, local maria-db and sshd.
I'd be glad if anyone could confirm that I have no weird rule for the main server purposes I listed above and so that I'd continue studying PF.
So this is my pf.conf (FreeBSD 13)
(the table "f2b" belongs to fail2ban)
Thanks in advance!
I'd be glad if anyone could confirm that I have no weird rule for the main server purposes I listed above and so that I'd continue studying PF.
So this is my pf.conf (FreeBSD 13)
(the table "f2b" belongs to fail2ban)
Thanks in advance!
Bash:
ext_if="vtnet0"
set skip on lo
set block-policy drop
set loginterface $ext_if
set optimization normal
set ruleset-optimization basic
set limit { states 200000, frags 200000, src-nodes 100000, table-entries 400000 }
privip = "{ 127.0.0.0/8, 192.168.0.0/16, 172.16.0.0/12, 10.0.0.0/8, 169.254.0.0/16, 192.0.2.0/24, 0.0.0.0/8, 240.0.0.0/4 }"
int_services = "{domain, ntp, smtp, smtps, submission, pop3, pop3s, imap, imaps, www, https, ftp, sftp, ssh}"
icmp_types = "{ echoreq unreach }"
# Blocklists
table <blocklist1> persist file "/usr/pf/banlist.txt"
table <f2b> persist
#Whitelist table
whitelist ="{213.133.99.100, 213.133.99.99,213.133.98.98}"
scrub in on $ext_if all fragment reassemble
antispoof for $ext_if inet
anchor "f2b/*"
block return in log all
### Block spooks
block in from no-route to any
block in from urpf-failed to any
block in quick on $ext_if from any to 255.255.255.255
### block probes that can possibly determine our operating system by disallowing
### certain combinations that are commonly used by nmap, queso and xprobe2, who
### are attempting to fingerprint the server.
block in quick on $ext_if proto tcp flags FUP/WEUAPRSF
block in quick on $ext_if proto tcp flags WEUAPRSF/WEUAPRSF
block in quick on $ext_if proto tcp flags SRAFU/WEUAPRSF
block in quick on $ext_if proto tcp flags /WEUAPRSF
block in quick on $ext_if proto tcp flags SR/SR
block in quick on $ext_if proto tcp flags SF/SF
block drop in quick from <f2b>
# Drop all Non-Routable Addresses
block drop in quick on $ext_if from $privip to any
block drop out quick on $ext_if from any to $privip
block drop in log quick on $ext_if from <blocklist1>
block drop out log quick on $ext_if to <blocklist1>
#pass in quick on lo0 all - needed?
pass quick on $ext_if proto { tcp udp } to port $int_services
pass quick from $whitelist to any keep state
pass quick inet proto icmp icmp-type $icmp_types
pass quick proto ipv6-icmp from any to any