EBPFSnitch: An eBPF based Linux Application Firewall
github.com
github.com
It has a GUI interface as well.
evilsocket/opensnitch is worse but EBPFSnitch could also be a lot better.
Unless it's actually not that simple?
You could at least make constructive criticism instead of just dismissively saying that all solutions suck. ("Tons of dependencies", "complexity", and "perplexing" are not actionable criticisms... they're highly subjective opinions.)
Recognising that given sufficient domain knowledge you could minimise and optimise dependencies and actually having that domain knowledge for this specific field are not the same thing. For the former, you just need to be a professional. For the latter, you need to be in luck for this specific subject.
You don't fix that by being snarky. Ironic, because in the last paragraph you do ask for constructive criticism! The least you could do is materially reciprocate in doing so.
> Why OpenSnitch does not intercept application XXX
>
> tl;dr
>
> - because we don't use eBPF.
> - a process is opening connections too fast (nmap for example, firefox sometimes...).
> - the system has a high load and we're unable to find the process in time.
> ...
For example, if you allowed curl or Firefox, another executable can simply call one of them and send/receive whatever data they need to. It also can't do things like filter ptrace calls which could easily be used to modify another process to perform exfiltration or just spawn another thread and inject a whole new dynamic library to them, a common practice to bypass detection on Windows.
There is not need for explorer to access internet!
I only allow windows defender, firefox and chrome to access internet in my home computer setup all other apps are blocked unless truly needed.
If you block svchost.exe from internet access with windows firewall, it will block the windows update. Enable it once in a while to allow the windows update to go thru when you feel the need.
For instance if I type "firefox 'http://google.com'" in my terminal my already-running firefox instance loads the URL in a new tab, so I assume that some kind of IPC is used behind the scenes to ask the main instance to load the URL. Of course that's harder to exploit nefariously than spawning wget from the same process but when there's a will there's a way...
What overhead? `docker run --rm -it -v $PWD/untrustedprogram:/untrustedprogram:ro ubuntu:latest`, done. Use x11docker if needed.
Not sure if running a program as root in a container is the best approach to "fully sandbox" - depends on what the goal is, obviously.
With it you can write a security profile containing a rule like:
network tcp src 192.168.1.1:80 dst 170.1.1.0:80
Networking access is just the start, you can restrict many other stuff, like access to dbus, files, signals, etc.ebpf: extended berkeley packet filter
Unfortunately, even the website https://ebpf.io/what-is-ebpf doesn't mention this. Interestingly, I was unable to find the words packet filter used together as well or firewall. I might be wrong.
I know that if you know what it is you'd know but trying to explain that to my partner here just glancing at my screen wasn't easy.
In a sense eBPF as just some letters being a name is a better name than "extended Berkeley Packet Filter", just like DPRK is a better name than "Democratic People's Republic of Korea", since 75% of the words in the expanded acronym aren't even relevant or true.
Dropping packets using netfilter makes many applications wait for a timeout. I prefer reject to filter unwanted outbound connections so that applications don't wait.
— The said feature is critical to proper DEFAULT-DENY firewall configuration/modeling.
Edit to provide link: https://elixir.bootlin.com/linux/v4.6/source/samples/bpf/bpf...
Furthermore, the process ID is not yet identified at early inbound stage of EBPD. We would be talking about being past the pre-inbound stage, post-table-lookup stage, and specifically just during the input-to-user land stage.
Hence, OpenRC enters the picture instead just to ensure that network port is not being used.
Also, premise of the DEFAULT-DENY firewall modeling is to pinhole open the port(s) on a per-process (or per-parent-process group) basis.
There's much more that can be done as well, I really highly recommend taking a look at eBPF!
It also has the option to see the location of the executable trying to access the web and to also upload a hash of the file to VirusTotal.
I have been using this back before when it was a paid program (I think it was only $15 for lifetime use) and before it was purchased by MalwareBytes.
I no longer use any Windows computers but I install it on all my friends and families Windows PC’s.
I really wish there was something similar for Linux.
That was my first thought as well. Back then Kerio Personal Firewall was a godsend, and seeing live how much software (which on windows was 99.9% closed) was attempting to phone home behind the user, became an eye opener to many of us.
(Linux 5.7.0-1-amd64 #1 SMP Debian 5.7.6-1 (2020-06-24)
It installed flawlessly after satisfying the libnetfilter-queue1 dependency, currently I'm playing with it, I like the granularity that allows blocking/allowing different domains accesses from within a process, such as for example a tab in Firefox. I'm curious to test it in the next days with Windows closed software run under WINE to see what they do under the hood. So far it seems really well made, I believe it would deserve a full HN article.
>The control interface is implemented in Python 3 utilizing Qt5
I would recommend moving away from this and instead run the controls using a web interface. A small django/flask/fastapi app (maybe even running through docker).
U can see how that could run on a raspberry Pi and be accessible on the network through the browser.
Also, based on your recent HN comments you seem to have claimed to find vulns in several projects, but to date have provided no proof of such claims, so I'll have to admit I'm a little skeptical.
Ultimately, all firewalls are just a very poor hack around a complex problem. The best solution to the problem is to ensure the connection is genuine and that the data being passed is genuine, and you can't do that with an arbitrary monitoring program. You need strong end to end authentication, authorization, and integrity, and sometimes also privacy. But we don't have the tools to do that right now because the protocols were designed for a different time.
Take DLP for example. Almost every major company in the world is starting to implement traffic inspection, because how the hell else are you going to ensure security of your IP with 10,000 employees using TLS 1.3? The inspection you force on the users is its own security hole, to say nothing of software bugs. And you can't even just lock down the network to only protocols that use OAuth or something. None of our security solutions are holistic.
We need a revolution in network security that takes each part of a network communication and its individual security needs into account, not just what we imagine is end-to-end (but never actually is). We can't rely solely on a facile "privacy or nothing" approach to internet security that the TLS mafia has been pushing. We need more flexible methods that allow us to fine-tune security at each level of the protocol stack, across multiple organizations and use cases. Nothing like that exists currently for the web.
Wrt our current conversation, you could have a network filter which only allows network communications whose packets at a particular layer are authenticated by a particular identity provider, authorized by a particular service provider, encrypted by a particular standard, and pass only a particular set of data using a particular data standard.
But looking further, you could have much bigger impacts. For example, right now we have to use NAT for IPv4 because there's no way for a private network to route directly to public networks and vice versa. But with this new scheme, the route tables, host addresses, the DNS, TCP protocol, service address (the address of the service should not require numbering at all, it should just pass a URI and boxes along the way should translate how to route to it based on that local network's definitions), and the various data payloads and formats, all would be delivered to every hop along the way up to the app server. The server reply would be carried back the same way just by reversing the order of the path. And so you could actually route messages between multiple sets of public and private networks, and those networks would allow the traffic or not based on the authn+z protocols and policies at each segment.
(Particularly, the application on the user's device would be prompted by the OS whether to accept the packets, similar to how the application firewall works. Except it could actually verify that each data payload was not just signed by a key on a random load balancer, but that it's actually been passed by an application with a valid OAuth session (but not OAuth since much better protocols would be used))
None of this assumes backwards compatibility (again, it's a revolution, not an incremental change). But there are some hacks that could be used to implement some of these features with existing protocols, to make transition easier. However, it's been shown time and again that all we really need to implement breaking changes in internet infrastructure is for a sufficiently large company to force it.
We need holistic solutions where we can control traffic by entity, domain, role, application, not IP address and port.
> There will come a point where the attacker will position themselves to appear exactly like legitimate traffic.
It's been happening for decades: botnet C&C servers use HTTPS and run on public clouds, mimicking legitimate websites.