Youtube not blocked by iptables
On our Ubuntu machine I have attempted to block internet access to one of the user accounts by adding the following line to /etc/network/interfaces:
pre-up iptables -A OUTPUT -p tcp -m owner --uid-owner 1001 -j DROP
This works well except somehow Youtube and other Google properties are not blocked.
I'm not an expert in iptables, but I assumed the above command would drop all outgoing requests from the specified user. Is there something special about Google properties that would somehow cause them to be exempted?
For reference here is my iptables list:
$ sudo iptables --list
Chain INPUT (policy ACCEPT)
target prot opt source destination
Chain FORWARD (policy ACCEPT)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
DROP tcp -- anywhere anywhere owner UID match ****
Solution 1:
Is the user using Chrome/Chromium? If so, the browser is most likely using QUIC for those sites, and that protocol uses UDP as the transport.
You can block UDP ports 80 and 443 to solve it.