Silverblue or other immutable on remote VPS?
from aordogvan@lemmy.world to selfhosted@lemmy.world on 30 Aug 2024 01:19
https://lemmy.world/post/19208217

Does anyone know of a hosting service that offers Silverblue as a possible choice for OS?

It seems to me that for a server running only docker services the greatly reduced attack surface of an immutable distro presents a definitive advantage.

#selfhosted

threaded - newest

just_another_person@lemmy.world on 30 Aug 2024 01:38 next collapse

How would describe the “reduced attack surface” of something running a container?

atzanteol@sh.itjust.works on 30 Aug 2024 01:58 collapse

That phrase has practically lost all meaning.

aordogvan@lemmy.world on 30 Aug 2024 02:17 collapse

Because even if an attacker could gain access even as root he cannot modify system files. This is why immutable OS distros are called immutable.

myersguy@lemmy.simpl.website on 30 Aug 2024 03:23 next collapse

Because even if an attacker could gain access even as root he cannot modify system files.

They 100% can.

MalReynolds@slrpnk.net on 30 Aug 2024 06:36 next collapse

Absitively, use case here IMO is set and forget autoupdate to stay current and SELinux (which actually reduces surface)

asap@lemmy.world on 30 Aug 2024 11:24 collapse

They 100% can.

An attacker escaping from a container can’t be system root as Podman runs rootless (without some other exploit or weak password).

The filesystem itself is also read-only.

/dev/nvme0n1p4 on /sysroot type xfs (ro)
/dev/nvme0n1p4 on /usr type xfs (ro)
/dev/nvme0n1p3 on /boot type ext4 (ro)
myersguy@lemmy.simpl.website on 30 Aug 2024 13:20 collapse

An attacker escaping from a container can’t be system root as Podman runs rootless (without some other exploit or weak password).

That would be true of podman running anywhere, and is not unique to an immutable distribution.

The filesystem itself is also read-only.

You can change that real quick if you have root access.

asap@lemmy.world on 30 Aug 2024 14:10 collapse

edit: “Immutable” means “all of them are the same”, not “unchangeable”.

You sound confident, but the fact that Fedora is using the term “immutable” makes me wonder if you actually have domain expertise here.

Immutable means immutable. It would be strange for them to call it that if it actually means “completely irrelevant from a security perspective”.

Unless you provide some evidence to the contrary I’m going to assume you aren’t correct.

superkret@feddit.org on 30 Aug 2024 14:17 next collapse

The immutability isn’t designed to protect against a malicious attacker with root access.
Any system is fucked if that happens.
It’s designed to reduce the workload of the maintainers, because they effectively only need to test and build for one standard image.

asap@lemmy.world on 30 Aug 2024 14:30 collapse

Makes sense. An “immutable” distro provides no additional security benefit, however CoreOS does have a reduced attack surface area compared to other distros, which itself is a benefit.

myersguy@lemmy.simpl.website on 30 Aug 2024 14:38 collapse

Someone with root can run ostree admin unlock --hotfix to make /usr writable. Someone with root can also delete all restore points.

It would be strange for them to call it that if it actually means “completely irrelevant from a security perspective”.

See the comment by superkret.

asap@lemmy.world on 30 Aug 2024 14:42 next collapse

While you are correct, any system is compromised if you have root, so isn’t that irrelevant at that point?

myersguy@lemmy.simpl.website on 30 Aug 2024 14:52 collapse

While you are correct, any system is compromised if you have root, so isn’t that irrelevant at that point?

The original context for the comment chain was:

Because even if an attacker could gain access even as root he cannot modify system files.

So no, it’s completely relevant.

asap@lemmy.world on 30 Aug 2024 15:04 collapse

My comment in the comment chain was:

An attacker escaping from a container can’t be system root as Podman runs rootless (without some other exploit or weak password).

We could give the op the benefit of the doubt and thinking that they were saying that the attacker inside the container managed to gain root inside the container.

myersguy@lemmy.simpl.website on 30 Aug 2024 15:36 collapse

Your comment also contained

The filesystem itself is also read-only.

Which is what led to the further discussion of root making that not so.

I don’t believe that to be the intent of the OP’s comment, given their second sentence, but they are welcome to state otherwise. I just don’t want them thinking that an immutable distribution gives them some kind of bulletproof security that it doesn’t.

asap@lemmy.world on 30 Aug 2024 15:46 collapse

Very true. The discussion helped me, as I did think it meant not easily editable.

As root of course you can change the system to be any other type of system (layer packages, rebase, whatever), but I did assume it meant not easily modifiable in it’s current state.

aordogvan@lemmy.world on 30 Aug 2024 16:05 collapse

While what you’re saying is theoretically true, don’t forget that as far as I know, most attacks are perpetrated by bots. And while it is true that in a fedora based version one could run ostree admin unlock etc… this particular command would need to be included in the attack script.

Now if the script has to be modified to include all possible different immutable systems that could possibly run it would increase the complexity and most importantly the size of said script making it easier to detect.

I’m not saying that its a bulletproof method, I’m just saying that by itself it greatly minimizes the risk, at least until all servers run immutable systems. And even then it still complicates matters for potential attackers quite a bit. So therefore reducing or at least greatly minimizing the potential of the system being compromised.

myersguy@lemmy.simpl.website on 30 Aug 2024 16:13 collapse

Because even if an attacker could gain access even as root he cannot modify system files.

Your comment was already from the position of if an attacker could gain root access. My responses were to that directly, and nothing else.

possiblylinux127@lemmy.zip on 31 Aug 2024 04:05 collapse

Wait, why wouldn’t they? They could wipe the entire disk if they so choose

StrawberryPigtails@lemmy.sdf.org on 30 Aug 2024 01:58 next collapse

I don’t know about Silverblue, but I know you can use NixOS on pretty much any VPS using the tool nixos-infect.

Not sure how it would reduce your attack surface though. That’s not really the problem that they are trying to solve.

aordogvan@lemmy.world on 30 Aug 2024 02:22 next collapse

Thank you, good to know. Not as straightforward as directly installing distro but certainly worth considering.

As to why it reduces attack surface please see answer provided to other comment.

vividspecter@lemm.ee on 31 Aug 2024 03:04 collapse

nixos-anywhere also works well for this use case.

JadedBlueEyes@programming.dev on 30 Aug 2024 03:07 next collapse

I use fedoraproject.org/coreos/ for my server/website. My host doesn’t offer it as an image so I have to upload it myself, but I use an ISO I made with the CLI to automatically set up everything anyway. It works pretty well, I configured auto updates and I can just forget about it.

aordogvan@lemmy.world on 30 Aug 2024 04:37 collapse

Thank you for the tip. Unless my understanding is wrong both OS are similar, Coreos targeting more precisely Kubernetes and cluster management. Had a quick look, but definitively will read more about it.

deadbeef79000@lemmy.nz on 30 Aug 2024 08:43 collapse

I’ve used coreos happily on homelab bare metal.

PXE booting it with cloudinit/ignition automation for provisioning.

It’s make for an excellent VPS.

cizra@lemm.ee on 30 Aug 2024 06:16 next collapse

I’m using NixOS in Azure - Azure allows creating a VM out of a disk image, and NixOS has tools to create preconfigured disk images. You inject your SSH keys and stuff straight into the image, then upload and create a VM. A bit fiddly, but I got it to work.

Neon@lemmy.world on 30 Aug 2024 07:47 next collapse

If you want MAC (SELinux or Apparmor) (which I highly recommend) then use Silverblue / CoreOS or even SUSE MicroOS

otherwise I use NixOS. (But like I said, I’m possibly looking into switching because of lacking MAC)

possiblylinux127@lemmy.zip on 31 Aug 2024 04:04 next collapse

I think it is likely an option on both Linode and Digital ocean

908musdf@lemmy.one on 05 Sep 2024 08:32 next collapse

I will respond even though this post is several days old because I actually do this. I have some vpses on Hetzner that run Silverblue no problem. It is not an install option available by default there, but support uploaded an iso under my account quickly when asked.

If you do it, change the active firewalld zone. The default is for a desktop, so not great for vps space.

aordogvan@lemmy.world on 05 Sep 2024 09:29 collapse

Thanks, good to know about firewall.