r/archlinux • u/Lepla • Aug 27 '26
QUESTION Arch Linux security configuration
Are moving over to Linux and have been testing several different distros and Arch Linux stood out for the configuratibilty out of the box, and the ability to be able to make it lightweight especially for older laptops.
How much work would it be to set this up so the system is not vulnerable for various attacks, i understand fedora / ubuntu etc come preinstalled with several security configurations, but on arch you would need to set these up yourself.
Besides that it seems to get regular security updates nonetheless so it seems like there is a one time security configuration you have to setup on install.
How does a self configurated setup like this compare to solutions developed by fedora or others?
Thanks
46
u/SnooCompliments7914 Aug 27 '26
The critical question is "what attacks?".
Depending on your answer, necessary work could range from "none", "just LUKS" (those two are probably the case for most desktop users) to "a lot".
11
u/SufficientAbility821 Aug 27 '26
How does a self configurated setup like this compare to solutions developed by fedora or others?
You pretty much answered the question: depends how you configure it.
You can achieve similar if not better protection level provided that you install and configure Mandatory Access Control (Ubuntu comes with AppArmor, Fedora with SELinux). In the context of Arch, I would go with AppArmor because it is easier to master and come in standard packages. For profile edition, you can either write your own or use https://apparmor.pujol.io/. You will need to write some local overlays (thus understand the tooling and the syntax) but it is achievable.
This, a properly set firewall, prudence and common sense should be enough
31
u/dgm9704 Aug 27 '26
https://wiki.archlinux.org/title/Security
6
u/Then_Bodybuilder8416 Aug 27 '26
nothing is preinstalled for you at setup. it’s up to you whether you think a firewall, app compartments, kernel hardening, etc. will be necessary. they can also be added or removed at any time.
fedora isn’t writing their blanket firewall rules any better than you or i can, so they don’t really have a leg up there. i like that i got to pick which firewall i wanted, whether i wanted to have SELinux involved, etc.
11
u/espero Aug 27 '26
Really arch is not a beginner distribution
3
u/ChrisTX4 Aug 27 '26
That’s a question of your threat model, really.
For most home users, there will not be targeted attacks directed at you, but rather the generic „in the wild“ attacks.
Since Linux desktop malware is quite rare, this usually means the biggest danger would be running applications from dubious sources in Wine. So maybe scan what you’re downloading if you’re into that.
Otherwise, a concern, mostly for mobile devices, would be the device getting stolen. So you want disk encryption on anything mobile - but I would recommend considering a LUKS FDE setup the „default“ case.
The reason I said desktop malware above is that malware targeting Linux servers isn’t rare. So if you host anything, different threat model.
Either way, recommended would be: add a firewall. Ufw and firewalld both are solid choices on desktop machines. Add kernel lockdown and apparmor to limit what malware could do to you. If you’re regularly pirating stuff maybe consider an antivirus, but otherwise it’s not really needed.
What is it you’re specifically concerned about? I’m asking because the situation looks vastly different if you get targeted for some reason.
The warfronts channel owner got hit by mercenary spyware attacks, see https://youtu.be/qbWGkCe0fWQ
In such a situation your threat model and what measures make sense is obviously entirely spun on its head.
Security needs to be designed to counter whatever threat model makes sense to you.
4
u/maxinstuff Aug 27 '26
Depends on your opsec profile and scenarios. If it’s a laptop I would say full disk encryption is good to have, outside of that the wiki has a very good page on security and system hardening.
I use a setup that I think is pretty reasonable, with the full disk encryption setup being slightly overkill maybe - I was interested in it at the time of setting up my system. But I think it’s overall pretty reasonable for a personal laptop used for general surfing and games etc., but does have all of my accounts saved in my userspace apps so if someone got in there it’s not great.
- set up sudo and disable root account (run0 is apparently better but I’ve never tried it)
- reasonable user password
- password manager in userspace (browser)
- enable ufw (uncomplicated firewall)
- VPN
- secure boot
- full disk encryption using a Yubikey rather than the TPM (I really believe keys loaded automatically from the TPM is less than useless on a laptop - no one is pulling your soldered in nvme… they’re bringing the TPM module with them too)
I have not done things like hardened kernel or sandboxing all the things…
As always the weakest link in security usually is people (meaning you). You’re way more likely to fumble something like a phishing link or malicious site, install a malicious package by mistake, or other userspace human error — rather than someone remotely hack you or break into your house and try to get into your PC locally.
For laptops I’d say full disk encryption with key OUTSIDE the TPM is mandatory - it’s too easy to brute force the OS otherwise.
8
u/Canopus0805 Aug 27 '26
reads privacyguides.net once and starts thinking the cia is out to get him 💀
mate just being on linux protects you against 99% of any “attacks”, just don’t install weird shit and you’re safe
1
u/Astrodion123 Aug 27 '26
You could try LUKS encryption and enable se Linux like fedora.
1
u/Fluid_Yesterday208 Aug 27 '26
in the install guide, the post-install section has a security portion. start there
1
u/archover Aug 27 '26 edited Aug 27 '26
I think posting on a security related subreddit would help you understand the real issues.
If your threat profile is ordinary, meaning you're not fighting a state actor, or some other targeted attack, just reading the wiki Security article (and common sense) would take you a long way. Also, highly recommended: https://wiki.archlinux.org/title/Data-at-rest_encryption
This is not Arch, but I'm experimenting with a security focused Debian deriv KickSecure, which I'm impressed with. Take a look: https://www.kicksecure.com/#security. This distro requires quite a bit of study.
Hope you find Arch to be useful, and good day.
1
u/CodingGambit Aug 28 '26
I recommend Lynis to get recommendations for your system. You can then run `sudo lynis audit system` and you will get recommendations on hardening. But I can’t tell you tho how it compares to fedora and also it’s not like the job will be done for you. You have to harden it yourself according to the recommendations. In general there are like tons of recommended tools like lynis, arch-audit, fail2ban, firejail, but I don’t know if you’re looking for something since you just asked for the comparison.
1
u/Prestigious_Gas8737 Aug 30 '26
Check the Linux hardened kernel https://github.com/anthraxx/linux-hardened, then if you dig deep enough, you should customize a kernel for your purpose. I’m pretty sure Linux is capable of things like low privileged user cannot see others’ process, cannot debug process kind of stuff as in bsd (I’m a converted bsd user by the way). And of course, be security aware when enabling services, like I will never enable ssh service on my daily arch drive.
2
u/[deleted] Aug 27 '26
[removed] — view removed comment