280 points · by Tomte · 2y ago · 253 comments
All Linux binaries are compiled with PIE nowadays. You can run `checksec` on any binaries on Ubuntu, and it will have those properties. (You can install checksec with `pip install pwntools`).
On the other hand, GLIBC has, to my knowledge, the most hardened heap implementation out there. And there are more mitigations for double-free and other heap exploits on GLIBC.
So in that regard, Alpine is less secure by using musl. Having a small, understandable system is a real advantage when it comes to security.
How did that look like in your mind that it is a point for (and not against) glibc?
It seems to be they were only comparing the relatives benefits/drawbacks of glibc and musl, but with the way it is written the pro-musl comment feels out of place.
COMMAND PID RELRO STACK CANARY NX/PaX PIE
init 1 Full RELRO Canary found NX enabled PIE enabled
[snip...]
crond 422838 Full RELRO Canary found NX enabled PIE enabledCheck the OpenBSD libc...
Windows and MacOS on the other hand have an untrusted security model, everything is assumed to be potentially dangerous.
Security isn't just about how the code behaves.
But in normal Linux land things are moving too: Flatpack, Wayland, immutable rootfs, systemd service sandboxing, ...
Also browsers on GNU/Linux are generally well sandboxed, the interfaces are there.
ChromeOS is not one of the most secure OSes, it's not even the most secure Android OS.
The Linux kernel's security design is crap. Doesn't matter what you run underneath it. It gets owned all the time, and it will stay that way.
I don't know what features ChromeOS has over Linux but I wouldn't considered Android or iOS particularly secure, and Qubes isn't either directly, it's just a tool that can help in some cases.
It's busybox. If you don't need explicitly discrete binaries of the /bin and /sbin utils it is a tiny user-space and fast to boot. Tmux, zsh and I was done for most unix purposes.
To get to my endpoint I wound up doing a lot of apk installs (node. More node dependencies. Stuff) but overall I found it the best Linux experience I've had in a long time. I wish zfs was baked in, and more overt virtio bindings to things for bhyve zfs backed run.
Anyway, I'm glad to hear that there might be a sane Linux distro out there. I will give it a go if I need a linux box which is pretty rare tbh.
I've looked for an explanation, but I only get high level explanations, or specific features like jails.
You wouldn't happen to have more information, would you?
network settings. if-up scripts? NetworkManager? Are we already supposed to use that systemd-network thingy or is it still not ready ? I just need to add an IP address in addition to the one given by DHCP...
who is managing /etc/resolv.conf today?
(my regular frustrations when dealing with both Ubuntu and Rocky Linux hosts..)
With GNU/Linux things change and the lack of authoritative documentation is tiresome. I end up on Stack-overflow triaging legacy posts from sources I just cannot trust.
Is FreeBSD perfect? No of course not. Is Linux a complete waste of time? No of course not! BUT my time is better spent in FreeBSD (and yes even windows) than Linux.
On prod, I have to use ifconfig, because ip isn't installed. On dev, I have to use ip, because ifconfig is 'obsolete'. Same deal with netstat vs ss. Those are the big ones for me.
I don't particularly care about the progression of firewalls on Linux, it seems like one day it will be back to one, but FreeBSD has always had three and I use two of them simultaneously, so how can I complain?
This ends up with the documentation "working" and very consistent vs a linux (jeez, no man pages, what the heck is this "info" crap?).
Things are better now, especially in the documentation front, but it remains that the "gnu" ecosystem is still a hodgepodge of different utilities written by different teams at different times and there are still inconsistencies.
I've spent decades in the linux ecosystem and away from "unix" so the memories are hazy and the brain damage (from linux) permanent at this point; the fish no longer notices the water.
https://www.jwz.org/doc/cadt.html (cut/paste link)
BSD is closer to "omakase" in that sense. Pick your cliche... people "rowing in the same direction," "more wood behind fewer arrows," etc.
How baked in? I think Alpine is one of the few distros to ship a binary zfs kernel module. So it's just a quick apk command away from getting it. There's some pretty decent documentation to install zfs on root on the alpine wiki too https://wiki.alpinelinux.org/wiki/Root_on_ZFS_with_native_en...
Easy, but not 'simple'. Don't get me wrong, it's entirely doable. But it's a distinct, non-standard pattern.
And virtio..
That's all you need to use ZFS data drives on alpine. On root is admittedly a lot more complex though.
Like in FreeBSD - to be as available option in installer.
In FreeBSD You just select 'Auto (ZFS)' - then select disk(s) on which it should happen - hit [ENTER] - and it happens.
That level of integration I would expect ... and all that with ZFSBootMenu integration for ZFS Boot Environments.
https://chimera-linux.org/docs/configuration/services
Then if a Linux kernel isn't a strict requirement, there's obviously NetBSD, from which Void takes inspiration. At last it's "the real thing" and not some adaptation, and a very underappreciated and overlooked Unix.
that said i was a freebsd user for over a decade so it must have left some mark (even though generally the systems have little to do with each other in their general design)
There does seem to be a lot of BSD influence over Chimera with the BSD userland, Clang / LLVM toolchain, lack of glibc, and cports.
Regardless of the inspiration, the design choices in Chimera are great. Being able to standardize on things like Pipewire and Wayland without legacy. Working to bring the functionality of systemd without the monolith is great too. I hope Turnstile catches on.
The system also has no relation to ChimeraOS, besides the unfortunate name similarity. ChimeraOS used to be called GamerOS and renamed itself to ChimeraOS later; however, at this point Chimera Linux was already in public development with its name in place.
Alpine users, am I missing some configuration option to make sure all documentation is always installed when getting a package? Or is manually installing the -doc package every time the only way?
Also, inevitably these things heavily rely on syslog, which is the most 80s technology ever invented. I agree that multilog/svlogd/whatever could be improved to add an easy centralised view (when you need to know the sequence of events from multiple tools) but grouping logs by some vaguely defined category which you always get wrong, and letting anyone log anywhere with any name are such strange features.
https://mastodon.social/@ariadne@treehouse.systems/112044942...
https://mastodon.social/@ariadne@treehouse.systems/112214386...
https://old.reddit.com/r/AlpineLinux/comments/ug3ipr/any_new...
There's just way too much going on in PID1, written in a memory unsafe language. I don't see a technical reason why it couldn't have a minimal PID1, and a few setuid programs. Aside from it making it possible to run systemd inside a docker container, which I presume redhat/IBM is strongly against, preferring you to use their in-house containerization tools like systemd-nspawn.
It's just never going to be viable from a security point of view with how it's architected.
For a real world in-situ use of runit, see voidlinux. It could be handled better but at this present moment it is at least no more clunky than using OpenRC.
This is a general "back in the days always was better" answer. Fact is that along the years systemd had less than 50 CVEs published, it reinvented for good the whole initialization process and linux administration in general, and together with SELinux are great foundation for any modern Linux distribution. Sure RC was super simple, but systemd is just the evolution that Linux needed to become what it is today.
When there's a CVE in a program written in a memory-unsafe language that has a position of privilege in your security model, that's a much much bigger deal than if there's a poorly written bash script running as a user.
Seperate out your service manager from your pid1, pid1 needs to just be responsible for reaping orphan processes. If you're going to have a monolithic daemon in that privileged position at least write it in a memory-safe language, as that's where most of the nasty RCE vulns come from.
I do wish something like s6 was the default on Alpine, it’s been quite nice when I have used it in containers.
Not at all. The linux of today doesn't owe anything to systemd, is not radically different from when systemd didn't exist, and arguably we would have a better alternative if systemd had never been adopted.
At this, I just vomited a little in my mouth.
Linux owes nothing to systemd. In every measurable way, systemd adds more complexity, reduces security by expanding the vulnerability footprint, creates a monolithic ecosystem, and handles everything far worse than, for example, Debian's use of sysvinit.
I spend more time dealing with systemd edge cases, and bugs, and security issues every few months, than I did in 30 years of other init systems.
Systemd is a step backwards.
More detailed: Systemd conflates the init system (PID1) and service supervisor. And as a service supervisor, it isn't really that reliable.
Alpine allows something akin to sets by using `apk add -t setname pkg1 pkg2 pkg3`, which creates a dummy package which depends on your package selection. I generally create shell scripts in /etc/apk/sets/ to mimick the Gentoo experience, but it's not always the same.
Slow alpine posts: - https://pythonspeed.com/articles/alpine-docker-python/ - https://superuser.com/questions/1219609/why-is-the-alpine-do...
Pro alpine post: - https://nickjanetakis.com/blog/benchmarking-debian-vs-alpine...
I wonder if this still holds water.
For many situations, performance is a secondary concern relative to simplicity or security.
I used to like it as a minimal distro that just stayed out of my way and considered it oriented towards slightly more technical folk.
Then the community would be hostile if you were digging in to an issue and didn't do a full install because that's the recommended way. And not doing so would also result in stupid issues due to stupid dependencies like mplayer not working because samba was not installed.
Alpine is an improvement over Slackware in every way.
It's .... Busybox/Linux?
If that kind of crediting was necessary for something like the GNU project to be known and to thrive, then it should have been solved eons ago by including it as a requirement the terms of the GPL instead of by being indignantly recalcitrant about it later on.
- https://rubenerd.com/files/2024/alpine-openrc.png
Of course its OpenRC related and not Alpine.
IMHO it would looked more 'nice' if the '[ok]' stayed where they were - at least till 'login:' prompt - but I know that its just implemented in a way that 'write [ok] after space from right side of the screen' and as resolution increased - it happened what happened.
They could just move the '[ ok ]' or '[fail]' to the left - beginning of the message - that would 'solve' that problem also.
I used to think these screenfuls of scrolling diagnostics were super cool and felt like a real hacker when I was 16 years old and first started playing with Linux, a feeling likely shared by many. These days I prefer a minimalistic boot, as long as the diagnostics are easily accessible when there’s a need to debug something. And in that case it doesn’t matter much ehether everything lines up neatly or not.
Have been on Alpine for around 18 months now and it's the first time i've EVER thought 'this is my forever distro'
The only bad experiences I've had with it, come from the lack of parity between the x86_64 and aarch64 virt images. So our x86_64 setup doesn't work without building our own image with kernel params and addons. Even ZFS I don't think is built into the virt-aarch64 image.
All in all, I would recommend more devs/sysadmins to try alpine outside the container world, and run it in test VMs, host servers, etc.
It's good to know it gets a little wobbly in heterogeneous bare metal environments.
> "Alpine is not full-source-bootstrapped, often imports and trusts external binaries blindly, has no signed commits, no signed reviews, no signed packages, and is not reproducible. It is one phished git account away from a major supply chain attack any day now.
Alpine chooses low security for low contribution friction. It is the Wikipedia of Linux distros, which granted it a huge package repository fantastic for experimental use and reference, but it is not something sane to blindly trust the latest packages of in production."
I'd be grateful to hear other expert opinions.
Are Void or Chimera any better?
in the other aspects most distros are generally not much or at all better, since all that stuff is hard and takes extra infrastructure
in chimera we try to make source bootstrap possible and in general not rely on third party executables, but it's not always possible (e.g. some language toolchains were bootstrapped from official binaries originally) and we try to respect best practices for reproducibility (pretty sure alpine does too) but actually verifying it would need dedicated infra/resources, so we don't do it
Alpine aren’t exactly drowning in money, despite so much container shit being built off their backs.
But overall, I prefer it to the more bloated modern distros. There's less complexity, it's snappier (I use an old laptop), and nothing gets shoved down your throat. Flatpak makes using 3rd party or bigger glibc apps a breeze. To get 1Password GUI to work using Docker took quite a bit of experimenting but it worked out in the end.
When running complex applications I find it's simplest to "compile" the application into a container thus rendering some tedious complex runtime to a static binary that's trivial to run without worrying about tedious dependency management. It burns a bit of storage but that's not a big deal these days.
If someone suggested to me "hey I want to run a big PHP / nginx / mysql workload for my startup; should I use alpine?" I'd suggest they find a doctor.
Has support for zones, which in my opinion are 10 steps above docker containers, has builtin ZFS support for root/zones/etc and so on.
Services are managed using SMF which has the only downside that services are configured using XML but usually if using only the builtin services it is not a problem. SmartOS also has a script to automatically configure the XML file.
I'm running OmniOS on a couple servers having a few zones each and I also run a SmartOS server for VMs. Launching a VM is a lot easier than on Linux. I can switch between Bhyve and KVM and use a single JSON file to configure all the VM properties and then launch the VM using a single command: vmadm create -f file.json.
All the networking is done using simple commands such as dladm and ipadm which are using the standard UNIX way.
I do wish there were a glibc-based Linux that had an emphasis on being small. Not as small as Alpine, of course, but something without systemd and snap and 100MB of files for locales I'll never use.
But a minbase Debian install is reasonably small by today's standards. Doing this using the Debian installer is not as easy as doing it using a tool like debos if you're trying to build a disk image or file system tarball to make a container (then you don't need the kernel). A Debian bookworm minbase container (no kernel or locales, with ca-certificates, does have systemd) works out to about 71MB gzip compressed or 212MB uncompressed (about 78MB compressed and 235MB uncompressed if you add 1 locale). That's definitely not small but it is *reasonably* small in my book today.
(Hilariously, 4MB of Alpine's 10MB is libcrypto.)
Also in my homelab I have a Docker Swarm system on multiple Lenovo Tiny nodes which all run Alpine Linux because it has much less overhead compared to Ubuntu or even Debian
[1] https://blog.haschek.at/2020/the-perfect-file-server.html
[2] https://blog.haschek.at/2019/build-your-own-datacenter-with-...
> Perhaps the package I was most surprised about was zfs. ... What that would look like after an upgrade I’d have to see, but thus far I’m impressed.
I can confirm it works smoothly. I've observed that the ZFS package is updated whenever the kernel is updated.
> At the risk of embellishing my feelings about this, it is such a relief that there are Linux distros like Devuan, Gentoo, and Alpine using this. It’s a breath of alpine air, and has legitimately made Linux fun again.
What kind of fun I'm missing by using systemd as init system? Couple examples of those who used it, would be interesting to see
I sort of understand this instinctively, but what actually makes it fun?
Those are what I liked about OpenRC when I ran Gentoo for a few years in the ‘00s, anyway. Only init system I’ve ever actually liked.
On FreeBSD You have ZFS with ZFS Boot Environments - which gives GREAT flexibility and protection against all kind od updates, changes and even accidental files deletion in the system. Moving to 'oldschool' LVM and EXT4 is just a huge downgrade. Especially without any advanced features such as compression or snapshots or clones or ... all the other wonders from ZFS.
As from the busybox ... You can also use it on FreeBSD - its under 'sysutils/busybox' port ... and FreeBSD has 'kinda' itself busybox-like solution - its called FreeBSD Rescue System and its located at /rescue. It contains one executable file 17 MB in size (and ZFS lz4 makes that 11 MB) with hardlinks as commands - including all needed ZFS commands - which BusyBox obviously does not have.
FreeBSD % % du -sm /rescue
11 /rescue
FreeBSD % du -smA /rescue
17 /rescue
FreeBSD % ls /rescue
[ dhclient gbde kldstat mt rmdir umount
bectl dhclient-script geom kldunload mv route unlink
bsdlabel disklabel getfacl ldconfig nc routed unlzma
bunzip2 dmesg glabel less newfs rrestore unxz
bzcat dump gpart link newfs_msdos rtquery unzstd
bzip2 dumpfs groups ln nextboot rtsol vi
camcontrol dumpon gunzip ls nos-tun savecore whoami
cat echo gzcat lzcat pgrep sed xz
ccdconfig ed gzip lzma ping setfacl xzcat
chflags ex halt md5 ping6 sh zcat
chgrp expr head mdconfig pkill shutdown zdb
chio fastboot hostname mdmfs poweroff sleep zfs
chmod fasthalt id mkdir ps stty zpool
chown fdisk ifconfig mknod pwd swapon zstd
chroot fetch init more rcorder sync zstdcat
clri fsck ipf mount rdump sysctl zstdmt
cp fsck_4.2bsd iscsictl mount_cd9660 realpath tail
csh fsck_ffs iscsid mount_msdosfs reboot tar
date fsck_msdosfs kenv mount_nfs red tcsh
dd fsck_ufs kill mount_nullfs rescue tee
devfs fsdb kldconfig mount_udf restore test
df fsirand kldload mount_unionfs rm tunefs
The MUSL also limits some things - but that is topic for another discussion.... and do not get me wrong - I like Alpine (same as Void or Gentoo or Devuan) - its just not the same thing.
... and its even possible to setup Alpine with root on ZFS - https://openzfs.github.io/openzfs-docs/Getting%20Started/Alp... - it will just take a quite large amount of work while on FreeBSD you just select 'Auto (ZFS)' installer option and hit enter.
Hope that helps.
From within the bootloader's interactive (fzf-based) menu, you can:
* Select boot environment (and change the default boot environment)
* Select specific kernels within each boot environment (and change the default kernel)
* Edit kernel command line temporarily
* Roll back boot environments to a previous snapshot
* Rewind to a pool checkpoint
* Create, destroy, promote and orphan boot environments
* Diff boot environments to some previous snapshot to see all file changes
* View pool health / status
* Jump into a chroot of a boot environment
* Get a recovery shell with a full suite of tools available including zfs and zpool, in addition to many helper scripts for managing your pool/datasets and getting things back into a working state before either relaunching the boot menu, or just directly booting into the selected dataset/kernel/initrd pair.
It also supports 100% of ZFS features that the host system supports, since it uses the ZFS kmod. That includes native encryption.Its just 'crazy' to me that there are ZERO Linux distributions that install as root on ZFS with ZFSBootMenu and enabled ZFS Boot Environments.
None. Zero. Why?
Seems like the only ones that have ventured to ship a ZFS binary are Canonical, and their implementation seems to be done by people that didn't understand ZFS and have no interest in understanding it.
It's really a shame. OpenZFS on Linux really has excellent support and integration, arguably as good as or better than FreeBSD and Illumos, and has this excellent bootloader.
Still, ZFS has good out-of-tree support in distros like Void and Alpine, where the users can take it upon themselves to do a good root-on-ZFS setup and reap the benefits.
$ ls -lh /usr/lib/x86_64-linux-gnu/liblz4.so.1.9.3
-rw-r--r-- 1 root root 123K Mar 24 2022 /usr/lib/x86_64-linux-gnu/liblz4.so.1.9.3
$ ldd /usr/lib/x86_64-linux-gnu/liblz4.so.1.9.3
linux-vdso.so.1 (0x00007ffd3df82000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fe560800000)
/lib64/ld-linux-x86-64.so.2 (0x00007fe560b81000)"was booting it on a VM at work, before realising I misread Dom0 as DomU...former refers to a Xen hypervisor, not a guest...it booted and installed the same as a standard ISO."
For so many of us that would be an automatic fireable offense. I hope OP has the autonomy to do that and remain unscathed.
*Edit: Reformatted
But most companies have less critical or testing environments available where people have some more space to play with.
And some teams like support, QA, Dev, etc usually have their own vm servers available to play with.
Where i work support analysts even had their personal servers they could do whatever they wanted, within reason of course. They still have access to VMs at AWS that they can start and destroy at will, but now there is just a few base images to choose from.