Ubuntu – be notified about blocked connection attempts

firewallnotification-area

My computer is running Ubuntu 10.10 and I would like to know if there is a firewall that actively informs me when a certain program is trying to access the internet or when a connection attempt is blocked from the internet. I remember ZoneAlarm for Windows will alert you to blocked attempts but now that I have switched to Ubuntu I'm not so sure. All my searching leads me to is gufw.

Best Answer

As far as I know the answer to both questions is unfortunately "no".

Details (but I'm going to simplify here anyway):

firewall that actively informs me when a certain program is trying to access the internet

  • The kernel net filter that firewalls use does not work well on the application level, so it is not used for that purpose. Though it is generally possible to filter outgoing connections (for all programs), it is hard to do, as you can't block connections to port 80 (used for http - just used as an example here), which means that a rogue application can easily use that port to make connections.
  • Even if this was possible, it would be quite hard to implement, as the connections are either allowed or blocked (and not "intercepted" or "paused" as with e.g. ZoneAlarm) so you don't get a chance to actively allow or ban the request on-the-fly.
  • One option on an application level would be AppArmor (you can restrict connecting to the Internet among other things there), but it's not very beginner-friendly and granular.

actively informs when a connection attempt is blocked from the internet

  • It does if you configure it so - for instance ufw by default logs to /var/log/kern.log. Notification via system notifications is certainly possible though I don't know of any such program (for AppArmor it is apparmor-notify).
Related Question