Hi!
I have used pf for the first on a server, where i have only ssh login. ... and i have got locked out of the system. Can you tell me where my mistake is in the rules?
Thx
Alex
I have used pf for the first on a server, where i have only ssh login. ... and i have got locked out of the system. Can you tell me where my mistake is in the rules?
Code:
#Macros
int_if = "em0"
trusted_ssh_hosts = "{ xxx.xxx.xxx.xxx, xxx.xxx.xxx.xxx, xxx.xxx.xxx.xxx }"
trusted_dns_hosts = "{ xxx.xxx.xxx.xxx, xxx.xxx.xxx.xxx }"
trusted_smtp_hosts = "xxx.xxx.xxx.xxx"
trusted_ftp_hosts = "xxx.xxx.xxx.xxx"
trusted_https_hosts = "xxx.xxx.xxx.xxx"
trusted_hosts = "{ xxx.xxx.xxx.xxx/24, xxx.xxx.xxx.xxx/24 }"
icmp_types="echoreq"
#ein paar settings
set loginterface $int_if
set state-policy if-bound
set block-policy return
set optimization aggressive
pass out keep state
#Normalisierung
#scrub in all
# alles unerwünschte wird sofort geblockt
block all
set skip on l0
#Antispoofing
antispoof quick for { lo0, $int_if }
#********** Eingehender Traffic ******************#
#Loopback
pass in quick on lo0
# icmp Requests
pass in inet proto icmp all icmp-type $icmp_types keep state
# SSH Verbindungen zum xxx
pass in quick log on $int_if proto tcp from $trusted_ssh_hosts port ssh flags S/SA keep state
# HTTPS auf die Website
pass in quick log on $int_if proto tcp from $trusted_https_hosts port https flags S/SA keep state
#********* Ausgehender Traffic *******************#
#Loopback
pass out quick on lo0
#ausgehender SMTP fuer die Alerts
pass out quick on $int_if proto tcp to $trusted_smtp_hosts port smtp flags S/SA keep state
#ausgehender FTP
pass out quick on $int_if proto tcp to $trusted_ftp_hosts port ftp flags S/SA keep state
#Traffic auf xxx Systeme
pass out quick on $int_if proto tcp to $trusted_hosts port { ssh, http, https } flags S/SA keep state
#DNS auf interne Systeme
pass out quick on $int_if proto { tcp, udp } to $trusted_dns_hosts port domain
Thx
Alex