I enable ufw and I tried to block all the traffic from one server, but I can't.
It only blocks ssh, all the other ports are open. I test it with telnet.
I want to allow all ports for some IPs, and block all ports if the IP is not there.
I have these rules:
sudo ufw status verbose
Status: active
Logging: on (low)
Default: deny (incoming), allow (outgoing), deny (routed)
New profiles: skip
UPDATE
Also, test from iptables
iptables --policy INPUT DROP
I tried telnet for ssh, is blocking but for other services, I can still access them.
Any ideas? I don't want to create default deny for outgoing, and then whitelist every port I want.
UPDATE
The problem is that the services are running inside the container. If I create a new listener with nc the firewall is blocking that connection.
How can I block the incoming traffic for containers?