I'm trying to block a specific port for local users with nftables. I need to block access to port 80 for all users not in the web (120) group. This is my command:
nft add rule ip filter4 input ip daddr $VEGAIP tcp dport 80 meta skgid ne 120 drop
filter4 is the IPv4 filter table and input is the name of the input chain. VEGAIP is my local IPv4 address. 120 is the web group gid. nftables isn't recognizing meta skuid or meta skgid and CoPilot couldn't suggest any way to get this to work with nftables alone. I do not want to use iptables along with nftables. It needs to be just nftables alone. Even a non-privileged user is able to see that port 80 is open using -sT with nmap. I guess I'll just have to block all local access to this port until I can resolve this issue.
All of the drop rules are listed before any of the accept rules.
Signed,
Matthew Campbell
nft add rule ip filter4 input ip daddr $VEGAIP tcp dport 80 meta skgid ne 120 drop
filter4 is the IPv4 filter table and input is the name of the input chain. VEGAIP is my local IPv4 address. 120 is the web group gid. nftables isn't recognizing meta skuid or meta skgid and CoPilot couldn't suggest any way to get this to work with nftables alone. I do not want to use iptables along with nftables. It needs to be just nftables alone. Even a non-privileged user is able to see that port 80 is open using -sT with nmap. I guess I'll just have to block all local access to this port until I can resolve this issue.
All of the drop rules are listed before any of the accept rules.
Signed,
Matthew Campbell