This posting is related to an entry in the BSD DEV Center. It contains the neccessary amendments to the original article, in order to make it work for me, running OpenBSD
installing the packet fwbuilder-2.0.7p0:
#pkg_add fwbuilder-2.0.7p0.tgz
ssh access to localhost has to be configured like this:
src dst srvc
server_wall:lo0:ip server_wall:lo0:ip ssh
* the final rules look like this :
# pfctl -s rules
pass in quick inet proto tcp from 127.0.0.1 to 127.0.0.1 port = ssh keep state \
label "RULE 0 -- ACCEPT "
pass out quick inet proto tcp from 127.0.0.1 to 127.0.0.1 port = ssh keep state \
label "RULE 0 -- ACCEPT "
pass out quick inet from to any keep state label "RULE 2 -- ACCEPT "
block drop in quick inet all label "RULE 3 -- DROP "
block drop out quick inet all label "RULE 3 -- DROP "
block drop in quick inet all label "RULE 10000 -- DROP "
block drop out quick inet all label "RULE 10000 -- DROP "
Backslashes are just there because of the formatting, they would not be included in the command output.