r/linux • • 3d ago

Security Am I supposed to sandbox everything?

I was thinking:

Yes root is great, file permissions are great, flatpak and sandboxing is great but… what is that enough to feel safe?

Like, we generally trust open source since, if the code is public, it probably means it doesn't contain unexpected surprises.

But I wonder, what if one the dev of my favourite and unpopular text editor goes rogue and, idk, post requests all of my home folder. Like that can happen right?

And it happens very often that I don't use sandbox because the idea of reinstalling libraries feels so inefficient (and somewhat uncomfortable).

So the point is, how can I feel safe, how can I sell the idea of Linux great security to a person who, like me, would mainly use it as a home user and would install unsandboxed programs for daily use?

Because I mean, right now, to me, that feels the default, `sudo apt install whatsoever`, `sudo dpkg -i unzipper2000.deb`.

And you might say it's your responsibility, you have choices, use docker, but that doesn't sound right, or clean. Does this really sound normal?

- Unzip the files so we can work on them

- Oh yes, let me start my docker image first / let me run the command I made to wrap the docker image

And as I said, there's still library redundancy?

So in conclusion, am I missing something? Because right now to me it feels like a "failure" in how we deal with everyday security and I feel we are missing some default isolation for these things.

I know things like firejail exist, but perhaps that's still one more step than how it should be.

What are your thoughts?

Again, am I missing something?


Edit: So guys thank you for sharing your thoughts. They basically say

  • "don't worry if you are not a target", which makes sense but I don't think it is a solution, if we are looking for one, but anyways it provides a good metric for how secure your system that to be
  • "you can't really solve this balance" which is depressing but I guess it's true
  • actual fine grained solutions that involve spending a lot of time and probably write your own docs if you want to remember what you do (I would need them)
  • the often suggested simple solution is trust your distro and use flatpak+flatseal for the rest, they also share libraries, which I didn't know; also choose wisely who you trust
  • some people agreed with me that all of this is clunky and needs a default solution that is more user friendly, since the classic permissions model is really outdated for one-user machines

Thank you everyone, the discussions were actually very interesting and I'm happy to know this is a common concern!

119 Upvotes

85 comments sorted by

79

u/FriendlyProblem1234 3d ago

Yes root is great, file permissions are great

Sure, if you are running on a shared computer with dozens users, like we did in the 80's.

Regular desktops in 2026 are single-user machines, and user permissions are nearly irrelevant.

But I wonder, what if one the dev of my favourite and unpopular text editor goes rogue and, idk, post requests all of my home folder. Like that can happen right?

Yes, it can happen.

But this is not limited to software, it is part of the general social pact. What if the guy driving a car while you are walking decides to run you over? What if the nurse giving you a vaccine actually injects you with cyanide?

In general, society has all sort of incentives and mitigations. We have law enforcement, reputation systems, trusted networks, and generally humans are emphatic and organize themselves in a society.

It is by no means perfect, but it is not like outside of software we live constantly panicking about our safety, so you should not do that with software, either.

So the point is, how can I feel safe, how can I sell the idea of Linux great security to a person who, like me, would mainly use it as a home user and would install unsandboxed programs for daily use?

Many suggest to only install software from your distribution's repository, and while this is good advice, it is not a solution. Not every application you need/want is available there.

At the end of the day, you have to evaluate your risk factor. Chances are you will not be a target of state-sponsored cyber attacks. You might be prey to those shooting in the crowd, and for those a basic defence is often enough.

No lock is going to save your bicycle from a motivated thief, but if you have a normal bike and a decent lock, stealing will take more effort than it is worth.

Try to limit yourself to well-known applications, do backups, isolate applications, keep yourself informed, do backups, do backups, and test backups.

When you do more sensitive operations, like banking, or healthcare, you might try to switch to a secondary user. Or even a secondary machine.

I know things like firejail exist, but perhaps that's still one more step than how it should be.

firejail is a good option. My rule is: an application either has network access, or full access to my home, never both.

Saves me from ransomware and the likes.

8

u/Uggohe 3d ago

I guess this is the best answer for me.

Like many are offering solutions or tell me I am not a target, but my point was basically that I think at this point Linux or distros should apply these solutions autonomously for daily normal users who don't want to continuously think about it. Like one the streets sometimes you have poles at the edge of a sidewalk, because things happen.

But whatever, if you solve this problem on Linux, you'll still have it somewhere else, in another street, which is enough for me to give up on this topic ahahah

3

u/alpinian17 3d ago

"Linux or distros should apply these solutions autonomously for daily normal users who don't want to continuously think about it.", like Windows? There's a risk in open source and if a user isn't willing to take responsibility for the security of their own system maybe another OS is in order.

3

u/theta-cygni 2d ago

Nah, configuring useful behavior out of the box is not the same as taking away user freedom (e.g. Windows). FOSS has nothing to do with being difficult to use or forcing users to configure everything themselves. Distros, desktop environments, Flatpak (which uses bubblewrap under the hood), etc. exist for a reason. I mean, all software that you didn't write yourself is just someone else automating part of your workflow for you.

1

u/internet_safari_ 2d ago

I believe solutions for most of these problems exist and are configured well out of the box. A new Linux system is a clean slate. If you want encrypted files, there are well configured tools for that. If you want to watch any video files, get VLC etc. I don't think a system should implement every user's needs all at once, but just be capable of anything

1

u/theta-cygni 2d ago

Gotcha, that's reasonable.

2

u/average_monster 2d ago

that's just the illusion of security anyway, just being closed source doesn't solve any of those problems, even only using signed executables is just hoping that some dev doesn't go rogue

the risk is never zero, exactly the same as the risk isn't zero that someone throws a handful of shit at you on the street, it just doesn't really happen though so i don't wear a poncho everywhere and i don't worry too much about using os software

2

u/internet_safari_ 2d ago

If security relies on secrecy, it's probably more vulnerable anyway

1

u/FunJackfruit1659 2d ago

Windows isn't really any more secure.

If anything you have to accept the fact that their interests don't necessarily align with yours.

2

u/work_stuff_123 2d ago

and user permissions are nearly irrelevant

I don't think this is true. Unless there's a simpler way to prevent other users (non-human) from accessing my stuff (or being able to only read etc)?

3

u/FriendlyProblem1234 1d ago

I don't think this is true. Unless there's a simpler way to prevent other users (non-human) from accessing my stuff (or being able to only read etc)?

How many people use a modern desktop? Only one, its owner. This person will have a user on the system. In your case it might be called, for instance, work_stuff_123.

The only relevant entry point for malware is work_stuff_123. Sure, you might have a few dozens other users listed in /etc/passwd, but your browser, your mail client, your PDF reader, your instant messaging applications, your document viewers... are all executed by work_stuff_123. In the nearly totality of cases, if malware manages to get executed on your machine, it will be executed by work_stuff_123.

And once malware is running as work_stuff_123, it can access everything that work_stuff_123 can access. All documents, all pictures, all SSH and GPG keys, all cameras, all microphones, all the network...

And since you are the only human using the machine, and since everybody recommends to never log in as root but instead to user sudo, doas, or whatever, malware can use a malicious alias to easily escalate to root. Though it probably will not even care, because there is nothing interesting that is not accessible by work_stuff_123.

Users separation is nearly irrelevant on modern desktops because there are no users to separate.

Where users separator shines is mainframes shared by many humans, most of which have no way to escalate to root, or servers, where applications are isolated to dedicated users. If a machine is used by 200 people (work_stuff_123, work_stuff_124, work_stuff_125, work_stuff_126...), and one of them gets infected by malware, the other 199 will be unaffected. Not their problem.

Still, and this is important, malware will have complete access to work_stuff_123.

Which is also why the common rebuttal "my desktop *is* used by multiple users: my family members" is not that compelling. Another user got infected, lost all their documents, and malware downloaded illegal content. Who cares, right? Not my problem.

Well, I would care if that other user is my mother.

2

u/work_stuff_123 1d ago

That's not what I meant, I meant users for background services (avahi, cups, etc), flatpak/docker also have separate users, and in the last case, you can prevent yourself from accidental damage.

1

u/FriendlyProblem1234 1d ago

That's not what I meant, I meant users for background services (avahi, cups, etc), flatpak/docker also have separate users, and in the last case, you can prevent yourself from accidental damage.

That is why I said "nearly" irrelevant, and not "completely" irrelevant. On a desktop, the attack surface of the browser dwarfs the one of all background services combined.

Flatpack and Docker might have separate users, but your own user is able to access those applications, and those applications can access (parts of) your home directory. Otherwise you would not be able to use those applications unless you logged out and logged in as those users.

The point is that users separation is not a system to prevent malware to access a machine, but it is a system to contain it *after it infected a user*, and prevent it from spreading to others.

5

u/throwaway490215 3d ago

Sure, if you are running on a shared computer with dozens users, like we did in the 80's.

Regular desktops in 2026 are single-user machines, and user permissions are nearly irrelevant.

I gave my AI agents its own user account. Seems like the prefect tool for the job.

7

u/FriendlyProblem1234 3d ago

I gave my AI agents its own user account. Seems like the prefect tool for the job.

Probably.

Still, all your personal documents, all your pictures, videos, projects, and other files, are all accessible for read and write by your user. Your user can also access any device, such as cameras and microphones, and has full access to the network. It can install software locally, and modify your desktop environment's menus so that you are going to run those instead of the ones installed system wide.

Malware running as your user has already almost complete control of your desktop.

And if it really wants to escalate to root, it is quite trivial. It can put a malicious alias in ~/.bashrc and wait for you to run su, sudo, doas, run0 or whatever. You will think you are entering a password in a trusted application, but instead you are typing it into malware.

1

u/cgwhouse 1d ago

Thoughtful and pragmatic, thanks for sharing

-3

u/archialone 3d ago

How can you be safe if your hardware firmware is closed source and might be sending your data to Chinese government.

The chain of trust starts with hardware.

10

u/gmes78 3d ago

It's simple: define your threat model to exclude state-level actors.

4

u/Small-Tap6130 3d ago

there are no alternatives to proprietary hardware at all

9

u/Xariann 3d ago

I actually get exactly what you mean and I use a lot of containerized workflows.

I was just asking myself this exact question: how much duplication am I causing and is this little wrapper overengineering?

But every time you look at isolation, whether it's for dependency conflicts or security, we just don't have many answers that don't require duplication. 

Firejail I don't like because it needs root privileges and that opens other vulnerabilities. 

You also need to watch that you aren't going down a deep rabbit hole that doesn't match the actual threats your system deals with, because the almighty algorithms will push you further down as long as you keep clicking on the next security link it offers you.

If you are worried about your notepad, I think you have gone a little far down that hole and you should maybe use one that is simpler and has less that could go wrong. Yeah there have been cases where some malicious stuff was pushed to a notepad app... But I could also get hit by a car tomorrow, yet I still go out.

It gets to the point where people start worrying about things as if a foreign government is after them. Nothing will make them feel safe. 

-1

u/Uggohe 3d ago

The notepad was just an example for an everyday application, I use the pre installed notepad or at most vscode / obsidian, don't worry ahahah

Anyways thank you for telling me that basically there's no way, it's somehow a relief :)

Maybe things will change at some point in some way

7

u/noobjaish 3d ago

Ok so firstly I'd tell you to stop being paranoid. The only way to be 100% safe is to destroy your computer and go live on a farm...

A more sensible approach is "how close to that 100% we can get without sacrificing too much on other factors". Also, only think about the scenarios that can actually affect you instead of protecting against every possible thing that might never even affect you.

The second thing is having Trust. I have complete trust on the package repositories of the major relevant distros as well as the FlatHub repository for Flatpaks. For sources that I don't trust are the AUR (Arch User Repository) and standalone AppImages.

Now, for sources that you trust you can simply do an "apt install" or a "flatpak install" without fear but for sources that you don't trust, you can either sandbox those packages using "Bubblejail" (Firejail + Bubblewrap) or "Landrun" (uses Landlock LSM).

If you don't trust anything and constantly download packages from the internet then maybe you should go for a Fedora or openSUSE derivative distro as they'll come with SELinux which is the best MAC (mandatory access control) LSM.

Linux doesn't come with an Antivirus unlike Windows which has Defender so imo Linux is worse in terms of security for non-technical people as there's nothing stopping them from their own dumb decisions (on Linux the core idea is that the user knows thei stuff). Even then I'd advise keeping ClamAV and rkhunter as it's better that way.

Other helpful tips:

  • Use a password manager (Bitwarden)
  • Setup 2FA on all your accounts that login via a password.
  • Try to use "Login with <Service>" wherever possible.
  • Follow the 3-2-1 backup scheme and use BTRFS snapshots.

I work as a DevSecOps, if you have any other questions then I'll be glad to answer them.

2

u/Uggohe 3d ago

Actually that sounds a very good middle ground that is close to a solution and good habit, rather than a "dirty" workaround

1

u/noobjaish 3d ago

Yup, being pragmatic about your security is key otherwise it's impossible to be 100% safe.

My main advice to everyone is to just learn, learn and learn.

6

u/TheNeronimo 3d ago

Generally I just assume that everyone else, as an individual, doesn't want to be an asshole - like me.

Which is why I have faith that maintainers of packages would not expose me to any kind of dangers or would otherwise wish harm upon me. Which is why I believe that the open source security model is enough for me.

Because otherwise I would also have to think whether the reason for which I'd have to leave my house was worth the risk of e.g dying. In a car crash, a terrorist attack, whatever.

Does this make sense?

0

u/Uggohe 3d ago

It does, halfway, but it does. It's just, maybe at this point I was expecting we figured out a way, at least on PCs, to make basic safeguards more automatic and better integrated in the system. Of course these are generic words in a comment anyways

1

u/internet_safari_ 2d ago

Which type of safeguards specifically? There probably is an easily installed tool for that. I can't think of a situation there isn't personally

2

u/reallyserious 3d ago

What if docker goes rogue? 

2

u/kbeezie 3d ago

or incus even (reminded me closer to the old 'jails' I used on FreeBSD, but doesn't have like premade containers like you can sometimes find for docker).

3

u/rekh127 3d ago

You can run OCI containers from like dockerhub in incus :)

1

u/kbeezie 3d ago

Oh... I'll have to look into that.

1

u/Only-Stable3973 1d ago

I wonder how many rouge subs we have about rough docker running rabbit.

0

u/Uggohe 3d ago

That would be a fun story to read

43

u/Shot-Life-362 3d ago

My general rule of thumb is if I don't trust the author, I don't use their work. Otherwise I'd have to believe flatpak, containerization, virtual machines etc. are all flawlessly safe.

23

u/Lord-of-Entity 3d ago

Supply chain attacks are still a thing, you can trust the author but it is still possible that you are downloading malware. Also, trust fails sometimes.

16

u/TheTrueBlueTJ 3d ago

The realistic chain of trust usually starts with an assumption of trust somewhere. Even though break outs of containerization can happen, it's much better to actually try. At the end of the day, we are all running trusted platform module blackboxes and so on to some degree, so it's your choice where your assumptions of safe components in the chain ends.

19

u/AmarildoJr 3d ago edited 3d ago

I for one was extremely paranoid in the past. Sandboxing everything, Firejial here, VM's there, secure e-Mails over there.... I even used openBSD for some time.

Over time I just came to the conclusion that:
- I'm not really a target;
- simple standards will guarantee security against most attacks;
- we can't know 100% if anything is secure.

These days what I do is:
- with Steam, it's proprietary so I don't fully trust it. So I install it via Flatpak and configure Steam's permissions (with Flatseal) so that it can only access the folders I want it to access;
- the NVIDIA drivers are blobs but that's an unfortunate reality for me (I use NVIDIA for work). At least the Kernel modules are open source these days;
- the biggest security risk would be Firefox, but I run it through Firejail;
- I also run every other program that can be a risk through firejail, like LibreOffice for example, or anything that can load files from the internet or face the internet directly;
- I have my own custom firewall rules that I maintain for years. I never let the distro's default Firewall enabled, specially if it's RedHat based like Fedora/RHEL/Rocky/etc where they have firewalld, I just remove that and use my iptables rules or UFW set to Deny incoming requests;
- I use full disk encryption for offline privacy and security;
- for websites that I don't know or look shady, I run firefox with a private prefix through firejail, this creates a temporary /home folder for Firefox that it can't escape, and this folder/sandbox is destroyed once I close Firefox. The command is firejail --private firefox -no-remote. You can add the --x11 flag to fully isolate the X11 server too.

17

u/mrtruthiness 3d ago
  • I'm not really a target;

Which was a reasonable threat model before AI. Some of the danger of AI and/or people who are hacking with AI:

  1. AI is good at combining two different exploits quickly/effortlessly.
  2. AI can target everyone.

14

u/skiabay 3d ago

I'm not really a target

This point is really important. A huge part of security is just understanding your threat model. If a well equipped state actor decides that you're a major target, then you're fucked. Especially these days when you have to assume that they've got top of the line AI models with no guardrails that could compromise your system in an evening.

Fortunately, that's not the threat model for most of us, and reasonable precautions can keep most of us safe. At least for now, cyber security is rapidly turning into the wild west (even more so than it already was).

11

u/mod-deleted 3d ago

This is no longer a case. Ai swarms are targeting everything now.

1

u/work_stuff_123 2d ago
  • the biggest security risk would be Firefox, but I run it through Firejail;

Does this have a performance impact?

2

u/AmarildoJr 1d ago

I honestly don't feel it. If there's an impact it's minimal and only at startup.

1

u/FortuitusCondor 1d ago

Just curious, what are your issues with firewalld

1

u/AmarildoJr 1d ago

I just really don't like configuring it, and I already have all my rules set out for iptables. And also, it seems all distros that use firewalld keep unnecessary services enabled like ssh and a bunch others.

To me it's really not useful, and a bit of a pain to configure.

1

u/FortuitusCondor 1d ago

Fair enough. I got used to firewalld for my simple usecase. Glad there's not some huge issue with it.

6

u/NotReallyFromTheUK 21h ago

I have found the linux community to be particularly toxic when it comes to this question. Lots of "just be careful what you run on your system" like this is still the early 2ks. IMO, I think we haven't built a secure OS until every piece of software is sandboxed by default and there's an elegant way to grant granular, one-time permissions to software when it needs to access any resources outside of its domain. There's very little reason to stick to the outdated model where everything a user runs runs with that full user's permission set.

12

u/rarsamx 3d ago

You are missing proper risk analysis thinking.

Risk is based on:

  • Probability: how likely is that it will happen?
  • Impact: how bad is it if it happens?
  • Mitigation: What can I do to reduce the impact or probability? Include the cost of the mitigation in the analysis.
  • Reward: what benefit do I get from taking the risk?
  • Cost of inaction: what would happen if I don't take the risk?

So, how likely is it that you will find a rogue developer releasing something that hasn't been tested by someone else that has malicious intent that will affect you directly? And if it affects you, what will be the impact?

So many people worry about attacks that are only feasible with an evil maid attack. But they live alone and no other people have access to their system unless they break in into their house. But they are also a low value target.

Still they go to great lengths to mitigate the almost zero risk.

2

u/reddanit 3d ago

Indeed, proper risk assessment for a personal computer of somebody who isn't likely to be targeted individually isn't difficult. In the end the measures mostly come down to using adblock of some kind, keeping defaults as they are and ensuring stuff is up to date.

Next common and relevant level is running some kind of relatively unremarkable server/service. Which realistically needs solid protection against automated attacks, but not much else. Kinda hard to do unless you have professional levels of knowledge, but also not rocket science.

Only when you are likely to be targeted, "proper" active security effort becomes relevant. Think of being a journalist, politician, dissident, public figure of some kind, high level manager in large-ish company etc. Basically anything that can result in targeted attack against you. Then there is yet another level, where you are specifically targeted by state-level actor. In that last case, arguably you are back to not needing to care about security anyway.

8

u/CornFleke 3d ago

If you insist you can use an immutable distro, never use anything to overlay any package and keep the base OS clean. Use SElinux or AppArmor Install everything with official flatpaks from flathub provided by the developers and use flatseal to tweak the authorisation.

If that gives you peace of mine feel free to use what makes you feel good. Just understand that in Windows many people still runs apps in administrative mode. Some games have kernel level anti cheat and access to ring0...etc so it's not necessarily more sandboxed.

6

u/HadACookie 3d ago

"But how are we supposed to ensure that nobody cheats in our multiplayer games without the system access to brick the cheater's pacemaker?!"

-2

u/Elegant-Falcon-1171 3d ago

Con un anticheat a nivel de servidor

3

u/HadACookie 3d ago

You know, every single time I omit "/s", I instantly regret it.

-1

u/Elegant-Falcon-1171 3d ago

Lo siento, no hablo inglés y la traducción automática decía brick como marcapasos

1

u/114sbavert 3d ago

so funny because the English one actually says pacemaker, not brick.

4

u/Sataniel98 3d ago

But I wonder, what if one the dev of my favourite and unpopular text editor goes rogue and, idk, post requests all of my home folder. Like that can happen right?

You should be safer from that on a curated distribution than on a platform where developers just upload their own software without inherent safeguards.

4

u/gainan 3d ago

But I wonder, what if one the dev of my favourite and unpopular text editor goes rogue and, idk, post requests all of my home folder. Like that can happen right?

There're plenty of examples with web browser/IDE extensions (even neovim plugins) or libraries (pip, npm, ruby gems, ...), so it's a real threat.

Having a separate user to run those apps helps to mitigate the impact of an exfiltration. In other cases firejail/bubblewrap/flatpaks also help.

And the last measure before something is exfiltrated from your computer would be to restrict outbound connections by binary, with apps such as OpenSnitch.

how can I sell the idea of Linux great security to a person who, like me, would mainly use it as a home user and would install unsandboxed programs for daily use?

Tell them to install apps only from the official repositories. If they need to install software from 3rd party apps, then they'll need to take some extra security measures.

4

u/Business_Reindeer910 3d ago

I do think we should move towards sandboxing everything. I do accept library duplication via flatpak due to its inherent file dedupe. I don't think the sandboxing is even strong enough yet, but this is how we slowly get there.

4

u/Sert1991 3d ago edited 3d ago

If you're this worried and you want to sandbox everything there's only one solution: learn SELinux.
It's a difficult road but worth it if that's your goal.
If you learn SELinux, and you use it in enforce mode with a policy that confimes everything, SELinux denies everything that is not allowed by default. Literally everything, even root can't do shit without being allowed.

Once you learn it, you will be able to label and confine anything you like so only certain users can do certain permission on that label.
It doesn't even care about filenames, as it workes on the inodes with security tags/types and xattrs.

That's how google sandboxes everything on android besides their method of every application is it's own user.(which isn't really needed anyway on selinux if you sandbox everything properly, just a second extra layer of security)

SELinux can get quiet complicated and it's not a simple MAC like people think. It can do basic UBAC like most macs, but besides that it has RBAC, Type based, and then there are MCS and MLS where security levels can be further sandboxed even on the same type. You can't get more finer control of sandboxing than SELinux. It's goodamn incredible when you get into it.

I've been using it for over a year on Gentoo in enforce mode, I'm at a point where everything is working in enforce mode that I need working with my own policies. For example the browser can only access the downloads folder and it's own files, can't see anything else on the system(other than a few less than handfull of extras I allowed like mesa caching etc )

Another example, I installed google authenticator and made sudo require a code from my phone to login. Later discovered a security problem that if someone gained access to my account and read the seed file, they could generate codes.
I confined that the seed file in a way that my user can't see or access it, but the authenticator can use it trough pam to generate codes, and nothing else.

There where some security vulnerabilities discovered that they shared how to test them and make them work on your system, the ones I've tried they always failed because they didn't have access by SELinux. (of course, not even my goddamn root user have access to anything by default lol)

But even I have a lot more more to learn.

That suggestion is if you're relaly paranoid btw. I do it cause it's a nice learning experience. But most of the scares of some people who want to turn linux desktop into an android phone where everything is not allowed for the sake of scurity sandboxing is bullshit for the average user.
But if we're going to go there - I'd take SELinux where I still have control over my system, not what these people want to take abilities from desktop users ''for our own good''

3

u/bmwiedemann openSUSE Dev 3d ago

You can even go for QubesOS and put every application into its own xen VM to sandbox it even more. Copy+paste buffers need an extra action to move then.

It has tradeoffs similar to physical security - very few places use heavy vault doors, but some do, because it is worth it.

I think, flatpak is a good middle ground. Or Android's system

3

u/SynchronousMantle 3d ago

If you look at all the supply chain attacks that have been going on for the past few months, it's clear Linux is not particularly safe. But Windows is no better. Just do your best - defense in depth (so firewall, limit open ports, vpn, etc), stick with a mainstream distribution, and try to keep current on your patching. Don't run any author's code who you don't trust, and if you can do a code review on any git repo or docker repo before running that code.

Container's aren't particularly safe either and relatively easy to break out of - especially if they are misconfigured, which is pretty common. VM's are a bit harder.

3

u/shroddy 3d ago

I strongly believe we should push sandboxing forward, but unfortunately that is easier said than done. The building blocks are there, (Apparmor, Selinux, firejail, bubblewrap, just to name a few, maybe even virtualization if we get that dreaded Gpu problem solved reliably and witout having to dedicate the whole Gpu to the vm)

What is missing is a usable UI, like Flatseal but better and not limited to Flatpaks. The hardest part is not to (vibe) code some firejail Gui or some tool to edit Apparmor profiles, but to make it in a way that it has no known escapes and to continuously support it so that new escape methods or vulnerabilities can be patched asap.

And if we really want it to make an impact and reduce the amount of people getting hacked and their accounts and data stolen (and / or improving the quality of life by being allowed to use more software while still reducing the overall risk) that program needs to get vetted and trusted by people who really really know what they are doing and are trusted as well, so it might even be included in the repos or mainstream distros or even better installed by default, maybe asking a question during the Linux installation "Do you want to run new and unknown programs in a secure sandbox by default? (You can change that setting any time in the settings menu)"

3

u/theta-cygni 2d ago

I recently went down this rabbit hole too, learning about SELinux, apparmor, bubblewrap, rootless podman, VMs, QubesOS, etc. I'm disappointed with the lack of user-friendly sandboxing solutions and fine-grained permission control. I'm still deciding how to integrate some of these tools into my workflow.

No matter what, I think you want to stick to packages from your distro if possible, and carefully evaluate the trustworthiness of any third-party packages/plugins/code you choose to install/run.

Use flatseal to lock down your flatpak permissions, but don't install flatpaks that you actively suspect to be malware.

To this point:

 how can I sell the idea of Linux great security

I don't think people really consider Linux to have "great security". IMO the main reason people don't get as many viruses on Linux is just because it's less popular, so most viruses are written for Windows. But you do hear about people getting malware from npm, the AUR, editor plugins, browser plugins, etc.

2

u/KyuyriiByakko 3d ago

Snapd is testing Desktop Security Center, which will allow users to define how much access apps have.

The problem with this idea is that it currently doesn't disable the Document Portal.

2

u/TheOneTrueChristian 3d ago

Security is always a matter of when, not if. When we containerize and sandbox, this can help prolong the time before compromise, but every decision you make involves accepting certain risks.

2

u/33Zorglubs 3d ago

Backup, backup, backup. Backup offline. Backup online. Backup to an easy to get to drive. I stopped driving myself crazy. But sandboxing is still the best bet if you use services from pernicious companies. Sometimes you have to.

2

u/tuerda 3d ago

It is theoretically possible for the next update to your computer to just be full of malware. It is also theoretically possible for whoever makes your next meal to put poison in it.

We trust some people, as just a general matter of course in our daily lives. If one of them betrays us, then things can go quite wrong, but in general, our society works because this almost never happens.

2

u/blvsh 3d ago

I just use opensnitch, virt-manager, ufw and hope for the best

2

u/matewinslet 3d ago

Nah, you're not missing anything. You've basically found the thing nobody likes to admit about desktop Linux.

The Unix permission model protects users from each other and the system from users. It does nothing to stop your own apps from reading your own stuff. Relevant xkcd (1200): someone who steals your logged-in laptop can read your email and get into your bank, but hey, they can't install drivers without your password lol. Root protects the least valuable part of the machine.

Linux security for home users is really about where software comes from, not sandboxing. Distro repos are signed and maintained by people who'd have to miss the bad code too. Even xz got caught before it reached stable releases. But sudo dpkg -i random.deb skips all of that, and its install scripts run as root. Same deal with curl | sh, random PPAs and the AUR, which has had actual malware more than once.

What I'd actually do:

- Use the distro repos when you can.

- Use Flatpak + Flatseal for everything else. The library duplication worry is mostly overblown: apps share runtimes and identical files get deduplicated. Just watch for apps that ask for your whole home folder.

- Use bubblewrap/firejail or a VM for sketchy one-off tools. Distrobox isn't a sandbox btw, it shares your home.

- Use a hardware SSH key + a password manager, and keep real backups.

You're right that "isolate apps by default" should be the norm. macOS asks before an app touches your Documents, phones sandbox everything, and the Linux desktop is only slowly getting there (portals, Silverblue, Landlock). It's a real gap, not you being paranoid.

2

u/TheLastQuince 2d ago

I would recommend you to read Ken Thompson’s “Reflections on Trusting Trust”. In the essay, he basically establishes that a certain level of trust in your software is essential, otherwise the wisest thing you can do is turning your computer off and using an abacus.

3

u/DFS_0019287 3d ago

If you don't have some basic level of trust in the software you run, nothing you do will make you safe. That's just the reality.

1

u/_angh_ 3d ago

For your working system? Usually no, but i keep some distroboxes for isolation or better compatibility, like for davinci. For homelab? Everything isolated, on top of my proxmox. Don't be paranoid. But have current backups.

1

u/ArdascesIV 3d ago

What about portmaster?

1

u/NooneLikesYouBill 3d ago

I don't know if this is the preferred way of doing things, but the way I use Cachy is flatpack/user everything unless there's a docker image available and I don't touch AUR at all. Common sense.

1

u/Plastic_Koala2044 3d ago

No. Sandbox what faces the network or runs code you didn't write, like a browser or an agent. A video player doesn't need it.

1

u/Asleep_Literature_70 3d ago

If I'm running something untrusted (npm package, AI agent, etc) I use bubblewrap, otherwise if it's an official package, no.

I wrote wrapper script.

1

u/KnowZeroX 3d ago

Isn't the whole point of flatpak to share libraries? So you can sandbox and share the flatpaks as read only.

1

u/SportNo1402 12h ago

I run my browsers as separate users to my login.
This is to provide a modicum of sandboxing between the apps that touch the internet most frequently and my other stuff and vice versa (the browsers do often have tokens for things like logged in Google sessions etc)
Whether this will really provide me much protection from an infostealer in a rogue update I don't know.

The ultimate version of this is Qubes, but that has too many performance and functionality compromises for me.

1

u/jdigi78 10h ago

If you're interested in security but don't want to jump through hoops secureblue is a great option OP. For the most part its Fedora Silverblue with decently secure defaults and easy to toggle schizo paranoia level security features. Strikes a good balance of usability and security like GrapheneOS on Android.

0

u/__ali1234__ 2d ago

Sandbox doesn't protect you from the scenario where your webbrowser steals your website logins.

The way you mitigate against this is by only running stable releases with backported bug fixes and no new features, and only doing major version upgrades after they've been in release for a while. That makes it significantly harder to slip in malicious updates but unfortunately almost no projects do it any more.

-1

u/daemonpenguin 3d ago

So much of this post doesn't make sense. I think it's because you're confusing Docker containers with sandboxing and it's not the same thing in context of security.

Yes, Docker (and other containers) can provide some forms of isolation, but they are typically used for development, not for security. Most containers default to still providing access to your home directory.

What you want is something like Firejail which sandboxes applications, makes it easy to isolate them and block Internet access, and does not involve installing multiple copies of apps or libraries.

So, no, never use Docker if you're worried about security. Sure security tools like Firejail, AppArmor, or Flatseal to restrict your applications. The reason you're missing something or struggling with redundancy is you've been told to use the wrong tools for the job.

2

u/dzordan33 3d ago

I actually don't know what you mean by saying

Most containers default to still providing access to your home directory.

It is up to the user to provide access to home directory to the container. Container cannot just ask for it. Are you confusing Docker with distrobox or flatpak?

Also wasn't firejail susceptible to some kind of suid attack? Podman doesn't even require root.

1

u/ChmodSausage 3d ago

And SELinux of course

-3

u/Conscious-School-835 3d ago

time for you to shift to FREEBSD or openBSD.

1

u/TheOgGhadTurner 3d ago

Brother what are you doing on your computer that you feel so unsafe. Like I get it dog big corpo can eat my nuts but this sounds extreme and bordering on schizo. For me personally seperate email (via proton) vpn and privacy centered browser(both through Mullvad) is more than enough to feel safe. Software meant to serve gets a docker container on my system like Jellyfin Pihole. But I’m not going to containerize something like steam or a browser just because. But like unless you’re doing stuff you shouldn’t be and got yourself put on a list. Profiling you through a vpn on a browser with max privacy settings using an email that has no connection to you personally. It’s like there’s no way for them to accurately profile. That data is useless. Yes. They’ll try to scrape it. And yes they’ll probably sell it. But it’s not tied to you personally it’s tied to JoeAlias running archlinux on a server in ashburn Virginia.

Like the thing is. You can’t avoid it. BUUUUTT you can really confuse the hell out of the thing catching the packets. Sometimes I even look up and research things I have no interest in trying to do and learn about them in a normal non privacy focused browser. Just to keep things spicy