As the avid reader will know, I’m working on automated migration of Sophos UTM firewalls to VyOS.
Sophos UTM is object based, so you have a firewall rule that says “traffic from these objects to these objects using these protocols and these ports is allowed”.
So say I have a rule that defines:
source objects: NETWORKGROUP1, NETWORKGROUP2, NETWORKADDRESS1
destination objects: NETWORKGROUP3,NETWORKADDRESS1,NETWORKADDRESS2
service objects: 80-tcp, 443-tcp, 22-tcp, 143-udp, 445-tcp
As I understand, a VyOS firewall (I assume the underlying nftables) can only have once source, one destination, one protocol and one port or port-range per rule.
Does this mean I have to do something like
set firewall ipv4 forward filter rule 1 description ‘TEST’
set firewall ipv4 forward filter rule 1 action jump
set firewall ipv4 forward filter rule 1 jump-target FWR000001
set firewall ipv4 name FWR000001 default-action return
set firewall ipv4 name FWR000001 rule 1 source group network-group NETWORKGROUP1
set firewall ipv4 name FWR000001 rule 1 destination group network-group NETWORKGROUP3
set firewall ipv4 name FWR000001 rule 1 protocol tcp
set firewall ipv4 name FWR000001 rule 1 destination port 80
set firewall ipv4 name FWR000001 rule 1 action accept
And so on, for every possible combination of source, destination and service (so 3 x 3 x 5 = 45 seperate rules for FWR000001) ? Times 2 if all source and destination objects define both IPv4 and IPv6 addresses?
Or can this be done a lot smarter and compacter than this?