How to at a minimum, allow https (port 443/TCP), ssh (port 22/TCP), auth (port 113/TCP), and ICMP lock-down. I want to only allow specific traffic such as the FreeBSD 443 and the w3school port 80 examples as below. Out of all the threads about pf only one used these words but the site no longer exist and there is absolutely nothing that I could find for pf, even on openbsd. Linux way is all over the place 
.
I don't know exactly what I am doing here. Could someone please show me by fixing this pf.conf as far as you can? If I can’t have specific traffic in port 80 forget 80. I have only a few that I like to run in this special VM.
.
I don't know exactly what I am doing here. Could someone please show me by fixing this pf.conf as far as you can? If I can’t have specific traffic in port 80 forget 80. I have only a few that I like to run in this special VM.
Code:
ext_if="em0"
dns1 = "199.85.126.10"
dhcp = "192.168.1.254"
icmp_types_A = "{ 8 }" # Set allowed ICMP types - { 0, 3, 4, 8, 11, 12 }
icmp_types_B = "{ 8 }"
ob_state = "flags S/SA modulate state"
ib_state = "flags S/SA synproxy state"
table <sshguard> persist
set optimization aggressive
set block-policy drop
set state-policy if-bound
set loginterface $ext_if
scrub out on $ext_if all random-id
scrub reassemble tcp
# ...............................
# ................................
# nat on $ext_if from !($ext_if) -> ($ext_if:0) # vBox bridge mode for FreeBSD guest
pass quick on lo0 all
block in all
block out all
pass in quick from 8.8.178.110 to any # https
pass out quick from 8.8.178.110 to any
pass in quick from 72.21.91.8 to any # http
pass out quick from 72.21.91.8 to any
# ............................................................................
# ............................................................................
pass out quick on $ext_if proto tcp from any to $dns1 port 53 $ob_state
pass out quick on $ext_if proto udp from any to $dns1 port 53 keep state
pass out quick on $ext_if proto tcp from any to $dns1 port 113 $ob_state
pass out quick on $ext_if proto tcp from any to any port 443 $ob_state
pass out quick on $ext_if proto tcp from any to any port 22 $ob_state
## pass out quick on $ext_if proto tcp from any to any port 80 $ob_state
pass out quick on $ext_if inet proto icmp from any to any icmp-type $icmp_types_B keep state
# ##################################################################
block out log quick on $ext_if all
block in quick on $ext_if from <sshguard> label "ssh bruteforce"
block in quick on $ext_if inet proto icmp all icmp-type $icmp_types_B # public pings
### pass out quick on $ext_if proto udp from any to $dhcp port 67 keep state # O dhcp