Hi all,
DiscIaimer: I only partially understand what I am doing.
I set up a FreeBSD 13.0 Host with. BastilleBSD.
Everything working fine but I struggle with the configuration of the pf packet filter, which is new to me (only used ipfw since).
My goal is to be as restrictive as possible without limiting basic functionalities of the jails
This is my simple /etc/pf.conf
The jails (for example a web server on port 80 and 443) works fine and is available to the world.
But calling
Maybe I should mention, that this does not happen when I add the following rule to the conf:
so basically, additionally to only ssh allow also traffic on port 80 and 443 - which makes no sense for me, why
Any hints or experience appreciated
Martin
DiscIaimer: I only partially understand what I am doing.
I set up a FreeBSD 13.0 Host with. BastilleBSD.
Everything working fine but I struggle with the configuration of the pf packet filter, which is new to me (only used ipfw since).
My goal is to be as restrictive as possible without limiting basic functionalities of the jails
This is my simple /etc/pf.conf
Bash:
# my ext interface
ext_if = "vtnet0"
# basic settings
set block-policy return
scrub in on $ext_if all fragment reassemble
# I dont want pf on internal traffic on the loopback interface.
# Bastille creates additional ips on the bastille0 loopback interface when creating a new jail
# Is using lo possible? It is the loopback group - found nothing in the docs, that groups are allowed but gave it a try
set skip on lo
# This is from the bastille documentation for nat and "runtime" redirect rools
# So how I understand it, if a rdr tcp 80 80 is set, this traffic will never be handled by consectuive rules?
table <jails> persist
nat on $ext_if from <jails> to any -> ($ext_if:0)
rdr-anchor "rdr/*"
block all
# I added this ipv6-imcp, otherwise calling pkg update or install on the host would not work anymore... it hangs..
pass proto ipv6-icmp all
pass out quick keep state
antispoof for $ext_if inet
antispoof for $ext_if inet6
# prevent loggin me out
pass in inet proto tcp from any to any port { 22 } flags S/SA modulate state
The jails (for example a web server on port 80 and 443) works fine and is available to the world.
But calling
pkg update
in a jail does not work... Traffic somehow comes not out or back? curl google.com
in a jail works also fine...Maybe I should mention, that this does not happen when I add the following rule to the conf:
Bash:
pass in inet proto tcp from any to any port { 22, 80, 443 } flags S/SA modulate state
pkg update
is working then... Any hints or experience appreciated
Martin