r/linuxquestions • • 24d ago

Question about Security of Linux Distros (specifically Arch)

Hi all, I've been using EndeavorOS as my primary desktop for about 6 months now, and I've become curious about the security of Arch and other Linux Distros. I've seen talk about how Linux is typically safe for the reasons: apps are primarily installed from "official" repos, the Linux user base being smaller and thus a smaller/less desirable target base, and how the Linux user base is more knowledgeable about fighting vulnerabilities, thus not worth the effort for most.

My question is, how safe are things like browsing possibly malicious sites, keeping private documents downloaded, or logging into sensitive accounts online on Linux (Arch) compared to Windows or MacOS. How does the lack of a default AV affect this, if at all (I've seen some people say that AV's aren't too useful).

In terms of web-browsing, I'm most curious to know how malicious links and the like would even work to infect my Linux system as to my understanding it doesn't work on a bases of executable links like Windows does. I'm not too knowledgeable about malware or phishing methods, so if anyone could tell me this would be very helpful.

Regarding protections, I'm running the Adguard extension on my web browser, and firewalld came preinstalled with EndeavorOS, but is this enough? The terms DNS, and kernel hardening has been mentioned to me but I'd like a second opinion on it.

-- Note: I've avoided installed anything from the AUR

tl;dr:

-- How safe is Arch compared to Windows and MacOS.

-- Is web browsing safe.

-- Is using Linux for work/managing sensitive information safe.

-- Any privacy/security/anti-malware suggestions? (ie. DNS, kernel hardening, VPN)

8 Upvotes

40 comments sorted by

11

u/DonaldMerwinElbert 24d ago

Linux is as safe as someone has made it.
Arch has some alright defaults, but since it's Arch, a lot of that is still on you.
If out of the box security is important to you, use a hardened Kernel and a distribution with pre-configured SELinux or AppArmor.

3

u/Rqmune 23d ago

Do you have a suggestion for a distribution that's pre-configured in that way? or would it be simpler to configure arch for SELinux/App Armour. How much manual input would it take to maintain these, or are they automatic?

6

u/shcmt 23d ago edited 23d ago

If you want it pre-configured youll want to try out RHEL based distro like fedora.

4

u/Rqmune 23d ago

Thank you for the recommendation.

2

u/ArjixGamer 23d ago

Just be aware that you will have to fight against the security measures, cause they are too strict.

Even a docker volume is not writable unless you use the flag :z or smth

5

u/DonaldMerwinElbert 23d ago

The most Arch-like is probably OpenSuse Tumbleweed - rolling release, SELinux by default.
Others have already been mentioned.

2

u/Rqmune 23d ago

I'm not explicitly looking for somethings "Arch-Like", I chose EndeavorOS originally due to the novelty of Ricing and freedom of control, but now that it's out of my system I'd like to fall back to something more secure and stable.

3

u/brighton_it 23d ago

Debian (AppArmor), AlmaLinux / Fedora (SELinux).
Using a threat blocking DNS (like Quad9) can help.
Keeping it patched: Debian (unattended-updates) Alma (dnf-automatic) - these are off by default. Debian Installer now offer option to turn it on. With Alma, think you'd have to install dnf-autmatic yourself.
-- compared to Windows, where every non-microsoft app is on it's own (or on you) to patch, above will patch the OS + all apps, so long as you only install from the distro repos (or know how to add 3rd party repos to unattended).

Security is about layers. Kind of like Swiss cheese, most slices (layers) have some holes, but stack several layers and nothing gets through.

On even the most hardened system, there's still phishing, social engineering scams, so an important layer is always security awareness of the user, password hygiene, etc.

1

u/Ryebread095 Fedora 23d ago

App armor isn't too difficult to set up on Arch to run in the background. The wiki will walk you through a basic setup for it.

8

u/gordonmessmer Fedora Maintainer 23d ago

Hi, I'm a distribution maintainer. My brackground is mostly SRE and development work for the last 30 years. Security is very important to me, personally and professinoally.

I've seen talk about how Linux is typically safe for the reasons: apps are primarily installed from "official" repos

You are somewhat less likely to download intentionally infected software if you exclusively use the official repos of a well staffed distribution. Most users don't. But that's only one vector for malware, and not the most common one. Most infections result from phishing or exploiting vulnerabilities, and GNU/Linux systms don't have especially strong protection against either of those.

the Linux user base being smaller and thus a smaller/less desirable target base

I tend to think that, more than anything else, has shielded the GNU/Linux community from malware, and that shield has allowed security myths to proliferate.

and how the Linux user base is more knowledgeable about fighting vulnerabilities

No, I don't think that's true. I talk to various communities about security topics regularly and I find myths and misunderstandings are VERY prevalent. A lot of ideals took hold in the 90s and remain deeply rooted, despite dramatic changes in the world.

how safe are things like browsing possibly malicious sites

More unsafe than most other platforms, frankly. Security infrastructure for browsers is much better developed in commercial desktop systems. Desktop safety on Linux is mostly down to the small community. Especially since the most prevalent distributions have relatively poor security patch coverage and desktops have LOTS of known vulnerabilities.

That's an area where Arch does very well, because it's shipping maintained software to users, not selectively patching vulnerabilities downstream of the primary development.

How does the lack of a default AV affect this

The lack of AV and the lack of signed binaries are both significant gaps in security infrastructure.

(Someone will surely point out that packages are signed. Preemptively: package signing does not support runtime execution policies based on approved signers the way that signed binaries does. And the most widely used distributions don't even sign packages, so...)

2

u/Rqmune 23d ago

Thank you, this cleared up a lot of misconceptions on my part.

2

u/gnufan 23d ago

Agree with most of this but....

> And the most widely used distributions don't even sign packages

The mostly widely used are I believe Ubuntu, Debian, Mint, Arch.

Do you mean Debian sign the releases not the packages themselves? I guess there is some merit to signing individual objects, but it feels more like a design decision than a weakness that such a throw away comment suggests.

3

u/gordonmessmer Fedora Maintainer 23d ago

The comment is brief because it supplements the prior statement, "Please don't chime in that distributions do sign packages, because that isn't the same thing and doesn't support the same solutions"

Yes, Debian signs the package manifest. Yes, it's a design decision. But if you want to talk about it, yes it is another significant weakness.

In a distribution that signs packages, I can use something like The Foreman + Katello to review and approve individual updates as they are tested, in environments that require tight controls. This is the sort of thing that Windows environments can do with WSUS. While Katello supports Debian packages, composing a new package repo also discards Debian's signature, which breaks end-to-end security. That's a significant security gap for those environments (which I have managed in the past). Distributions that sign packages themselves do not lose end-to-end package verification when custom repos are used.

And if you're doing forensic analysis of a system which you believe may be compromised, it's much easier to verify the origin of software when the packages themselves are signed. If the package itself is not signed, it can be difficult to verify that an installed package is authentic if it is not currently in the repo (e.g. it has been replaced by an updated version)

1

u/gnufan 23d ago

Thanks, just wanted to clarify. And the latest "apt" vulnerability also somewhat relevant, although that was a flaw after checking the release signature, but would probably be less likely if it was with the object itself.

1

u/_choam_ 23d ago

What myths from the 90's still hang around?

2

u/gordonmessmer Fedora Maintainer 23d ago

I mean... the entire model of building a distribution by selectively applying patches is a weird idea. Some Linux software distributions adopted that practice in the 90s and it survived because the sites that used Linux in those days mostly understood that they needed to participate in the process of assessing CVE reports and patching software, collaborating and generally participating in the maintenance of those systems. The problem is that the community sees the distribution, and they see the organizations that use the distribution, but they don't see the work that the model required, so they think it's secure by default. And now Debian and Ubuntu are widely used systems but I NEVER find anyone who's actually using a vulnerability scanner to report the vulnerabilities in their deployment, so the community is full of Debian and Ubuntu deployments with huge numbers of security vulnerabilities.

Build infrastructure security is also widely neglected. Because most distributions are unfunded volunteer projects, there wasn't a whole lot of centralized compute infrastructure to build software in the 90s, so developers tended to build software on their own computers and upload the result. From a security point of view, that's horrifying. The risk of malware in an uploaded binary is enormous, especially since every package you install and every package you update has root-level access to the host at the time of the install/update transaction. Debian allowed developers to upload binary packages until 2019. TWENTY NINETEEN!!! Arch still does, which is why Arch systems trust thousands of package signatures. Because Valve is using Arch as the basis for SteamOS, they're sponsoring build infrastructure, so it's possible that will change in the near future.

More generally, the UNIX security model was developed in the 70s based on the needs of institutions, because institutions owned computers. In an era where individuals own computers, a more granular security model is needed. Modern operating systems like ChromeOS, iOS, and Android provide a security model that is application-focused rather than user-focused. A UNIX system is a multi-user security model. Modern operating systems provide a multi-application security model. In this model, an application has access to the data that was generated in and by that application, and generally not to the data generated by other applications, unless it is specifically placed in a shared access area. That model has, for the most part, grown out of the security model developed for web browsers. ChromeOS was first released in 2011. Android in 2008. iOS in 2007. Users say that they come to GNU/Linux systems for privacy and security reasons, but the privacy and security controls on GNU/Linux are WOEFULLY inadequate compared to modern systems.

2

u/Mokelale 12d ago

Hi! First of all, thank you for what you do and for how you explain things here on Reddit.
Secondly—precisely because I like the way you write and explain things—I’ve looked through some of your past posts. In several instances, including this one, you’ve mentioned that those seeking privacy and security should lean toward ChromeOS or, more generally, modern operating systems. Does this also apply to desktop environments? Personally, I’ve been experimenting with Fedora for a while, but after reading your comments, I’ve become quite wary of using it for more sensitive tasks (accessing my bank, handling sensitive documents, etc.). In short, I’ve started to feel a bit concerned. For these types of tasks, I either reboot into a drive running Windows 11 or use my Pixel device. Did I correctly grasp the point you’re trying to make, or have I misunderstood?

Have a great day!

2

u/gordonmessmer Fedora Maintainer 12d ago

you’ve mentioned that those seeking privacy and security should lean toward ChromeOS or, more generally, modern operating systems. Does this also apply to desktop environments?

If security is a priority, then yes. One of my recent employers was Google, and their security practices reflect security as a very high priority. Many developers use Chromebooks as their desktop system, not just because they're very manageable, but because their security characteristics are very good. ChromeOS is the most direct implementation of the security model introduced by web browsers, because it's a web browser as an OS.

Aluminum OS will merge Chrome and Android application support, which will expand the set of applications available to desktop systems, while retaining isolation between applications. As far as I know, Aluminum OS will retain Android's security architecture, which basically runs each application in a separate user account to ensure that if one application is compromised or malicious, it can't harvest data from your other applications.

Multi-user systems like GNU/Linux and Windows don't really offer that level of privacy infrastructure.

1

u/Mokelale 12d ago

Interesting. So, if we’re talking about the choice between Windows and Linux, did I misunderstand the message? Personally, I like Fedora; it works well for me and does everything I need. My ears perked up only after reading what I did (and not just from you, actually)—but it’s possible I misunderstood.

1

u/gordonmessmer Fedora Maintainer 10d ago

Windows is... better than many Linux users believe, but still limited in many ways because backward compatibility is a high priority. It has a more sophisticated access control system than Linux, but many developers apply controls that are too broad, which has frequently limited its effective security. It has better infrastructure and more vendors for anti-malware than Linux. It has vastly better vulnerability patch coverage than most Linux distributions. And applications And because applications typically bundle their dependencies, application security isn't moving at the pace of the slowest set of developers on the platform.

But both Windows and GNU/Linux are multi-user operating systems whose security models are based on similar concepts. Neither of them offer the kinds of privacy controls that exist in ChromeOS, iOS, and Android.

I'm a Fedora maintainer. I like Fedora. I use Fedora on my desktop systems. But a lot of people say they want to adopt GNU/Linux systems for security and privacy reasons, and I think it's irresponsible to encourage that idea. Security and privacy are not better on GNU/Linux than on Windows. And security is actually really bad on a lot of the most widely used distributions. Debian and most of the systems downstream of Debian operate on backward notions about reliability that prioritize compatibility over security.

For users who want to take part in Free Software development, I can only really recommend systems that minimize friction between upstream releases and user deployments, for desktop use. Fedora is good in this respect, though I'm working on mechanisms to decouple applications from the OS, and I expect that to be a major security improvement. Rolling systems like Tumbleweed, Arch, Gentoo, and PikaOS will typically also offer better security characteristics than "LTS" systems.

1

u/Mokelale 10d ago

The most sincere response I’ve read in a long time. We need this more and even if I'm repetitive I thank you.

1

u/Mokelale 20d ago

Gran risposta, grazie!

7

u/Smart_Advice_1420 23d ago edited 23d ago

My personal arch security concept:


  • LUKS FDE (only /efi exposed). TPM unlock at home, required password when not at home.
  • secure boot with PCR's
  • apparmor
  • ufw (deny all first)
  • opensnitchd
  • data backup (not local on mine, source of truth is my fileserver)
  • VPN (wireguard into home network with adguard and DoH upstream)
  • VM for testing shady shit
  • clear browser @close to remove session cookies
  • PW manager (keepassxc)
  • TOTP manager (yubico auth)
  • common sense (don't run commands i don't understand, don't curl into bash/sh, etc.)

5

u/bobsmissingdesire 23d ago

Security is a huge topic, and for desktop users it's messy when you get into it.

Take downloading and running executables, a clear risk. Windows has warnings, MacOS requires they be detainted, SELinux does something similar if you run it (most desktop users don't).

None of them really "work" - as in protect your system. The user chooses to download and run the program, so a popup that says "this was downloaded from the Internet, are you sure" doesn't help, the user knows this, they just downloaded it. As the barriers get increasingly annoying to vault and it pisses people off some less technical people may give up, but the goal of stopping the user from running the program is fundamentally at odds with a user who wants to run the program.

Linux gives you tools that you can use to execute unknown programs safely, containers and other isolated environments. However they aren't the default, I don't think most users use them. 

Once you run the program Linux has really good privilege escalation barriers to prevent gaining complete control. This is often talked about as better security and this is hugely valuable on servers. On my desktop everything that I care about protecting is accessible to me, a program that I run can get at it all.

tldr; no operating system that you want to use can protect you from you

1

u/gnufan 23d ago

Agree with the sentiment that security is a huge topic.

The one security control I would recommend for most Desktop Linux users is encrypt the storage, especially laptops. This protects you from snooping and theft, and will also lose all your data that isn't backed up elsewhere if you forget the key.

Avoiding AUR makes sense if you are worried about people inserting malicious code into those packages you install from there, but then maybe look at a distro with more centrally packaged software.

Without knowing what you mean by "sensitive information" it is hard to say if Arch is suitable. Also sensitive information is very variable, if someone steals your credit card details from your computer, that is annoying but easily fixed and you may even get all your money refunded, if someone steals nuclear launch codes, or even private photos, the consequences may not be so easy to manage.

I know of projects that managed highly classified material using Linux Desktops, but they typically don't use a common Linux distro, certainly don't allow users to install software. But those projects could equally have used other operating systems as you can make anything secure enough if you wrap enough stuff around it. For them the beauty of Linux is they can make it more secure by leaving more stuff out easily; less is definitely more in security. Although going a bit too non-standard may carry other risks and the recent SSH fiasco shows.

0

u/Snoo_54991 23d ago

Well, some of what I do:

  • use a VPN tunnel for my home network combined with localized file syncing instead of cloud syncing services
  • subscribe to a private DNS service, which comes with filtering options built in
  • zram
  • tighten up firewalld permissions
  • encrypted disk
  • apparmor

1

u/Rqmune 23d ago

Thank you, I will look more into these things.

-1

u/_K10_ #1 Debian glazer 23d ago

Correction; On Arch based distros you're getting packages from the AUR which is unofficial and community driven.

You don't know who uploaded the package you're downloading or what it contains.

Every now and then trojans are discovered in packages, hence maybe you want to move towards a distro where you don't have to rely on blind faith as much.

Unless you're going to manually inspect every line of code in everything you install.

4

u/lnxrootxazz 23d ago

That's not true. The AUR is optional and you need a AUR helper like paru or yay to install or build from the AUR. No normal user should use the AUR. There is something like the chaotic AUR which you can use with pacman by setting it in addition to core and extra as a repo in pacman.conf but that's optional as well. But you are also right that the AUR has its risks. It was compromised a few months ago with malicious package builds

2

u/un-important-human white beard arch user 23d ago

wrong,
The AUR is OPTIONAL and your choice. Its the user choice, it's your fault. Be accurate.

0

u/_K10_ #1 Debian glazer 23d ago

Okay I'll go install Spotify from the official repos... Oh, wait I can't because it's not in there.

Okay I'll go install Bolt launcher... Nope, wait, that's also only in the AUR

Google Chrome? Nope. AUR. Lutris? AUR.

Everything else you want to use on a daily driver? Usually in the AUR. Exclusively.

2

u/un-important-human white beard arch user 23d ago edited 23d ago

ur wrong again

FLATPAK

take a chill pill my dude you know some things but you are not an experienced arch user.

0

u/_K10_ #1 Debian glazer 23d ago

All of the above are unverified on Flatpak.

Not that you would know if you were installing flatpaks from the terminal. Which an Arch user might.

You can check against flathub-verified yourself but for some reason Flathub doesn't. It should.

1

u/un-important-human white beard arch user 22d ago

Darling, check the github profiles its the devs that work on the programs. Very few "verify".

Clearly we got nothing to talk as you only seek confrontation. You are blocked for being a time waster.

good day user.

3

u/jonstoppable 23d ago

But isn't the AUR optional ? So by opting not to use it, that vector is closed yes ?

2

u/un-important-human white beard arch user 23d ago

correct K10 has failed in reading / using the wiki. Prop just a troll.

-2

u/[deleted] 23d ago

[removed] — view removed comment

1

u/gnufan 23d ago

Nope, most distros allow executable content in a user's home ditectory, and you can run shell scripts from any file you can read.

I suspect the thing that helps linux is fragmentation and that the default on most downloads is not to run or install it. But some distros are changing that.

Most Linux malware I've seen got there by stealing credentials from web developers, most of the rest by exploiting services that were intended to be public (web, printing etc).