By alternative it's not meant the program needs to be gui. Any method that allows a program to logs when something calls listen()
and only allows selected programs to listen to the interface:port
will works. I've seen opensnitch but it woeks with outbound connections only.
If such program doesn't exist can anyone point to how to create? Like using nftable rules. What I'm not looking for is to run a program in separate net namespace etc. The solution should work for all userland programs in general.