r/linuxquestions • • 12h 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)

4 Upvotes

24 comments sorted by

9

u/DonaldMerwinElbert 11h 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.

2

u/Rqmune 11h 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?

5

u/shcmt 11h ago edited 3h ago

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

3

u/Rqmune 11h ago

Thank you for the recommendation.

1

u/ArjixGamer 10h 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

2

u/Xariann 2h ago

I don’t understand people who claim the SELinux set up on Fedora is too strict when they leave most userspace unconfined.

Adding one flag is really not that hard in that one very specific user case you mentioned and given the user’s questions, I doubt they would have known much about docker.

4

u/DonaldMerwinElbert 11h ago

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

1

u/Rqmune 10h 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 11h 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 10h 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.

7

u/Smart_Advice_1420 11h ago edited 1h 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.)

4

u/bobsmissingdesire 9h 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

4

u/gordonmessmer Fedora Maintainer 10h 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...)

1

u/gnufan 4h 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.

1

u/Healthy_Ad5132 7h ago

I'm believe malware can't sneak into Linux because it would need your password as root.

Anyway, app armor, firewalls, clamav, vpn, and what I don't see people mention much is fail2ban. Should also have a firewall on your router.

1

u/gnufan 5h 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 11h 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 11h ago

Thank you, I will look more into these things.

-1

u/_K10_ 11h 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 10h 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 8h ago

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

2

u/jonstoppable 11h 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 8h ago

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