Hello everyone,
I just realized that my pf firewall rules are not actually doing what I thought they did.
My plan was to only allow ssh() access to the server only if the host IP address are 213.146.159.xxx, 82.31.44.xxx or 193.128.224.xx.
When playing with juicessh (Android app) I realized that I was allowed in the Server. This should not happen as my phone Random IP (not over wifi) is not set in the rules.
Could anyone help me to figure out where i went wrong please?
Thank you very much
Here is my pf.conf file:
I just realized that my pf firewall rules are not actually doing what I thought they did.
My plan was to only allow ssh() access to the server only if the host IP address are 213.146.159.xxx, 82.31.44.xxx or 193.128.224.xx.
When playing with juicessh (Android app) I realized that I was allowed in the Server. This should not happen as my phone Random IP (not over wifi) is not set in the rules.
Could anyone help me to figure out where i went wrong please?
Thank you very much

Here is my pf.conf file:
Code:
ext_if="bge0"
IP_FREEBSD_HOST="192.168.0.xxx"
IP_WEB="192.168.0.xxx"
SSH_HOSTS= "{" $IP_FREEBSD_HOST $IP_WEB "}"
ICMP_TYPES="{echoreq,unreach}"
PORT_WEB="{80,443}"
PORT_SSH="{22,1413}"
PORT_ZABBIX="{10059}"
table <fail2ban> counters persist file "/var/db/pf/bf.table"
table <workssh> { 213.146.159.xxx,82.31.44.xxx,193.128.224.xx }
# [options]
set skip on lo0
# [normalizaiton]
scrub in all
# [translation]
# [filtering]
pass out all
block in all
#block all IPs from the fail2ban blocklist without any further evaluation
block in quick on $ext_if from <fail2ban> to any
#pass in quick proto tcp from any to $IP_FREEBSD_HOST port $PORT_SSH
# Allow ssh traffic from authorise hosts with synproxy handshaking
pass in quick proto tcp from <workssh> to $SSH_HOSTS port $PORT_SSH flags S/SA keep state (max-src-conn 10, max-src-conn-rate 3/5, overload <fail2ban> flush)
pass in quick proto tcp from any to $IP_WEB port $PORT_WEB
pass in quick proto {tcp,udp} from any to $IP_FREEBSD_HOST port $PORT_ZABBIX
pass inet proto icmp all icmp-type $ICMP_TYPES keep state
# add IPs used for brute force attacks to table fail2ban, flush
pass in on $ext_if proto tcp from any to any port $PORT_SSH flags S/SA keep state (max-src-conn 100, max-src-conn-rate 15/5, overload <fail2ban> flush global)