I am making a Go program that uses gopacket/pcap to read and write raw packets. On windows, this Go program is safe to ship as it doesn’t need any special permissions to run (winpcap is installed prior to running).
On macOS and Linux however, I get permission denied when I try to do this. The solution I know of is to run the program using
sudo, however as I’ve understood it, having a Go program run in root space is not a good idea.
Therefore I am wondering if there is a better way to make my Go program that uses gopacket/pcap to read/write packets not run as root, but rather open those permissions up to my Go binary to run in userspace.
Any help is appreciated!