P.S. (Without understanding all details of how you do the networking in your program), consider that you can also pick the option of first establishing your connections through net.Listen(), net.Dial() etc, and then enforcing the Landlock policy. That way, you do not need to list these ports in your policy any more.
https://github.com/pufferffish/wireproxy/blob/master/cmd/wireproxy/main.go#L133
Please update the Landlock library use in this project - the version you are using has a known bug:
https://github.com/landlock-lsm/go-landlock/security/advisories/GHSA-vv6c-69r6-chg9
P.S. (Without understanding all details of how you do the networking in your program), consider that you can also pick the option of first establishing your connections through net.Listen(), net.Dial() etc, and then enforcing the Landlock policy. That way, you do not need to list these ports in your policy any more.
Thanks, —Günther