OpenSnitch is a GNU/Linux port of the Little Snitch application firewall
github.com
github.com
The first time I installed and ran Little Snitch, I was pretty much flabergassted at how chatty my system was. Just constantly being presented with requests to the point that made it impossible to work. I loved learning how prevelant E.T. phoned home.
But then as I was just constantly inundated with those requests, I hated having to constantly deal with it. Now it's time to whitelist/authorize/etc. But do I really want to blanket OK something just because I'm annoyed? What does one do to stay sane and safe?
<disables Little Snitch> securely places head back in sand
Little Snitch is the single program to illustrate all of the scary websites/blogs/etc of how shitty companies are about their "free" software and other shenanigans that devs play and from some "legit" companies.
I love Little Snitch and I hate Little Snitch, and it's not their fault.
It's a 2 edged sword. Full tilt block mode causes insanity but shows just how bad all these devs are at phoning home for whatever. Setting it to some default might be okay for some but still too much/not enough for others. Some people then might think they are protected while potentially nefarious back room deals to get something whitelisted.
btw, similar program for Windows: https://binisoft.org/wfc
Given the above, sandboxing with namespace nftable is still required for ultimate inbound security (I am looking at you, systemd).
Not macOS and BSD.
IIRC the problem with tagging in Linux is that there isn't necessarily a 1:1 relationship with a destination PID and a packet in a variety of scenarios.
2017: https://news.ycombinator.com/item?id=14245270 (103 comments)
2020: https://news.ycombinator.com/item?id=22206116 (131 comments)
I mean I get what it is supposed to do, but if I already have a means of blocking certain spam/telemetry URLs that I don't want (via etc/hosts, or PiHole), is there any real benefit of using an application firewall on top?
As others have said, micro-managing all these connections is not really feasible in most cases. And if I have a domain I don't trust, I can just globally block that.
What are some real-world use-case scenarios of a domain that I want to block for one application, but not generally for all applications? It sounds cool in theory to be able to fine-tune all that on an application basis, but is this actually useful/sensible in practice?
But yes there's real world use cases for per application filtering -- you want Facebook messenger to reach Facebook.com but probably not any other applications.
And FB's trackers and ad-services and other privacy-invading stuff is all on different sub-domains that PiHole or any other "generic" firewall blocks anyways, so again I'm fine without application-level firewalling
Except if someone sends you a specially crafted message that causes an exploit to be triggered which could contact some other site to download malware on your system.
* https://www.wired.com/story/facebook-messenger-bug-bounty/
Do a search for "no-click exploits":
* https://googleprojectzero.blogspot.com/2021/12/a-deep-dive-i...
You may trust the authors of the software and how the software acts as intended, but you should also considered unintended / undesired usage.
It also allows you to deny all internet access per-app. For example, should there be an exploit for a MP3 parser in Audacity (presume that Audacity has no use for internet normally -- at least that's my use case), it will probably try to download a second stage from the internet, and you want to block this. Unfortunately, OpenSnitch probably cannot detect "Audacity has spawned wget and you have allowed wget, but only as a child of bash in your terminal launched from your DE startup script, not as a child of Audacity".
This is not entirely made up (only the exploit part), there was indeed an Audacity telemetry incident: https://www.google.com/search?client=firefox-b-e&q=site%3Ane...
As another real-life example, I have discovered that Stardict scans clipboard by default and tries to translate what it finds there using an online dictionary. This includes passwords in your clipboard. https://jenda.hrach.eu/w/et#stardict (the linked page contains several other less severe examples discovered about 2014-2016; I'm not in infosec anymore, so I'm not looking for this that much)
if you haven’t heard of libnetfilterqueue, this is what it’s for. it’s really good. tremendous thanks to the author for introducing me to it via this project.
the main problem with libnetfilterqueue is that it doesn’t have pid information. you have to look that up in /proc or via a hashmap maintained by ebpf. either method has issues.
an unexplored alternative, afaik, is seccomp with userspace filtering[1]. then you get pid information and direct control of syscalls. this may still need to be paired with libnetfilterqueue depending on implementation.
Something like this:
app_firewall --block all --allow www.google.com ./my_untrusted_application
Or like this: app_firewall --rules my_employer_network.conf ./untrusted_employer_application
Then you can do cool stuff like: app_firewall --block microsoft.com qemu my_dirty_windows_virtual_machine.qcowif you can set up a socks server, tsocks?
or you will have to create iptable rules and then use cgroups et al to tag the proccess to them.
Command used was: "bwrap --bind / / --dev /dev --unshare-net -- exe_name"
I don't really like GUIs in my Linux, setting up VNC is such a pain.
Netstat sort of fills this niche, but not without a lot of manual toil on behalf of the operator. In general, Linux and the apps in the ecosystem are much more well-behaved with regard to "wtf is this traffic" compared to macOS or Windows.
Trust is great and all but visibility is better. Linux is still dicey to correlate traffic with a particular app, especially if the connection is/was shortlived.
This is has become a lot easier and more reliable to do now with BPF [0].
I also used the same approach to create a somewhat user-friendly TUI and web dashboard for it [1]. It is also able to hash the executable (even if it was shortlived).
[0] https://www.gcardone.net/2020-07-31-per-process-bandwidth-mo...
can ebpf operate in a blocking manner while making drop/allow decisions on packets WITH reliable access to the callers pid and argv?
I wasn't talking about using it as a firewall, just a connection/bandwidth monitor that correlates traffic with a particular app.
picosnitch looks really cool! i’ve rss subscribed to its github commits.
If so (without a kernel vulnerability which should be a given) I'd like to have it mentioned under the limitations section for picosnitch so others can be aware as well.
[0] https://github.com/iovisor/bcc/blob/master/docs/reference_gu...
in the end there are only two ways to handle this: drop data or block. for a bandwidth monitor, i’d choose drop. for a firewall, i’d choose block.
i use bpftrace to monitor docker filesystem access in a similar way[1]. i also increase the ringbuffer size until i stop seeing lost data.
https://github.com/evilsocket/opensnitch/blob/4ce8b0e57cfb25... https://github.com/evilsocket/opensnitch/blob/d9e0c59158ddf6...
my understanding of what is happening is as follows:
- 1: libnetfilterqueue gets a packet.
- 2: lookup packet via ebpf to get pid and argv.
- 3: lookup rule, on miss prompt user to allow/deny.
- 4: libnetfilterqueue allows/denies the packet.
the tricky part is step 2. afaik there are 3 possibilities:
- ebpf already knows about about this packet, return pid and argv.
- ebpf will know about this packet shortly, wait, then return pid and argv.
- ebpf dropped the data because of ringbuffer overflow, wait, then give up.
lsof -i -n -P | grep "\\-\>" | awk '{a[\$1"_p"\$2]++;}END{ for (it in a){print it,a[it]}}' | sort -nr -k2,2
This project uses conky to display the current connexions:
awk '{a[$1"_p"$2]++;}END{ for(it in a){print it,a[it]}}'
Little snitch does not have this issues and you can have multiple users logged in with fast user switching and all can operate their notifications no problem.
i agree with you. especially if i’m filtering all traffic, i need to be able to y/n quickly and easily.
The missing piece was remote installing the client on Windows en mass to be able to be able to switch to root errr Administrator. TV allows you to pass Windows creds through to remote install itself but rustdesk can't yet or that might become an "enterprise feature". However Ansible can manage a WinRM enabled Windows box with Kerb and encryption over http and no client install. You can switch on WinRM via a GPO.
Getting some bits of Ansible working on Arch and certain other bleeding edge distros might involve pip install --update pycrypto (and/or) pykerberos. Python 3.10 deprecated something in a rather cryptic way, that I'm sure was jolly important but broke quite a lot of things important to a Linux sporting sysadmin in a Windows world.
If you skim read that thread from HN where I also learned about Rust Desk then there is no consensus about "sketchy". Searching for the word "security" gets a discussion about SSL/TLS and some pontificating.
I'm no real expert on IT security but I do have a Nessus license and a box to wield it from. I've run quite a few firewalls from Fortinet, pfSense, Juniper, hand crafted Linux, <various others>. I have 15 VLANs at home 8)
In my office I have a pair of Dell S funky devops switches worth around £20,000 sat on the bench as I plough through the 2000 page manual. I've got over the lack of old school stacking (why do they still have a stack LED indicator?) They have a LACP mediated VLT domain link running at 200Gbs-1 (Gb/s) - two physical wires. Now, do I partition the 100Gb links into four lots of 25Gb because that will allow more flows. Ok let's look at how this thing is used: iSCSI for data and VMware. The iSCSI links are 10Gb to the M series SAN so more links seem indicated.
I also learned Ansible on Thursday rather rapidly because I can deploy these beasts with it (they boot Debian and have Docker installed already, which is adorable!) and coincidentally, I need a non MS way of getting at Windows boxes from Linux. Ansible doesn't need a client app.
It's getting busy in IT. I'm 52 FFS (and absolutely love it!)
If I'm mistaken please tell me, would love to use it if it's "safe".
They also provide three or so really low spec jump boxes to get people up and running if they can't self host - again, I call that altruism not sinister.
I will get Wireshark out anyway to check about this stuff next week.
You can do your own real due-dil stuff yourself by browsing around this: https://github.com/rustdesk/rustdesk - read the issues, browse the source (read the comments!) get a feel for the software.
I'm asserting that it is no worse than anything else. I can also assert that the binaries that I get on Arch Linux are probably from the official sources (I checked a few strings etc). I can't sign off the Windows binaries but I can assert that I do trust them from their GitHub repo.
I can assert things until I'm blue in the face but I trust rustdesk more than most remote access facilities for now but I am still kicking the tyres.
https://github.com/evilsocket/opensnitch/tree/master/ebpf_pr...
- You can apply more flexible rules than just blocking specific hostnames -- for example, based on IP subnets, port numbers, or specific binary executables
- You can block connections even from programs that bypass the default system-wide DNS configuration
This doesn't sound like a common use case. You can already block connection on a specific port with all available firewall programs. And you can bubblewrap binaries from making internet connections.
> You can block connections even from programs that bypass the default system-wide DNS configuration
Other than browser's making use of DOH for DNS, I can't think of a common use case for this. Besides, why would I want to Wireshark my browser? Why not use uBlock to filter domains.
Doesn't seem obvious to me why one would go through all this trouble.
I can easily imagine such a program doing its own DNS lookups (or just using hardcoded IP addresses) to avoid detection, and this approach allows you to block it anyway.
Sure, you could do the same thing manually. But you might as well say "why does anyone need Visual Studio Code when we have sed and awk?"
There are better alternative routes you can take that do not involve a "MITM" for all your connections.
There’s no MITM involved. Just another hop (potentially with an interactive go/no decision.
Little snitch is effectively a MITM app for all connections on the system it is installed on.
Little Snitch is a gate. It either lets a specific connection through, or not; it does not modify it. It all happens on your own machine. You keep using that term, "MITM", I don't think it means what you think it means.
https://github.com/gustavo-iniguez-goya/opensnitch/issues/21
https://nullsweep.com/why-is-this-website-port-scanning-me/
https://user-images.githubusercontent.com/2742953/84960681-9...
2. install opensnitch or similar on 1.
3. route all traffic through 1.
4. figure out how to deal with rule management and new connection requests from 1 to wherever is most convenient for you.
bonus points for making it easy to install a cert on the machines in my network and capture/inspection of ssl streams.
alternatively, some cloud egress point i can vpn to with outbound firewalling/logging/filtering as a service. i don't want to think about it all the time, so either community driven filters or a managed service.
basically i'm interested in two things. catching malware on my personal devices and inspecting/defeating software that is gossiping too much about what appears to me to be private.
There's also pfsense [1] and OPNsense [2] which are more geared towards business users, and personally not worth the effort for me to maintain at home, so I haven't looked into them as much.
[1] https://www.pfsense.org/products/
[2] https://shop.opnsense.com/product-categorie/hardware-applian...
Slap on the pfblocker-ng package and you effectively have a souped up Pi-Hole in the router too. My TV at home has stopped showing adverts for certain streaming channels which is nice.
There are certain strong feelings against Netgate (nee Electric Sheep Fencing) which may or may not be justified. You have Opnsense as an alternative option - it's a very well thought of fork of pfSense.
This can actually be harmful for less experienced Linux users who may trust something like this to keep them safe for running random scripts, especially since I see this tool often recommended for such a use case.
Also if you're using it to prevent an app not to phone home, you still have to trust it not to do anything more nefarious than that, or simply spawn a program like curl (which you've probably allowed) to phone home for it.
one alternative is to specify rules at system level instead of program level. that’s the approach i ended up landing on[1]. i wish i had finer granularity, but i’m glad i don’t have flakes.
it’s hard to imagine that monitoring network exfil isn’t THE best way to secure any system. at the least, it’s an important and necessary step.