this post was submitted on 26 Jun 2023
13 points (88.2% liked)

Selfhosted

40005 readers
827 users here now

A place to share alternatives to popular online services that can be self-hosted without giving up privacy or locking you into a service you don't control.

Rules:

  1. Be civil: we're here to support and learn from one another. Insults won't be tolerated. Flame wars are frowned upon.

  2. No spam posting.

  3. Posts have to be centered around self-hosting. There are other communities for discussing hardware or home computing. If it's not obvious why your post topic revolves around selfhosting, please include details to make it clear.

  4. Don't duplicate the full text of your blog or github here. Just post the link for folks to click.

  5. Submission headline should match the article title (don’t cherry-pick information from the title to fit your agenda).

  6. No trolling.

Resources:

Any issues on the community? Report it using the report flag.

Questions? DM the mods!

founded 1 year ago
MODERATORS
 

Hello friends, I am considering self hosting on my desktop computer, which already has gentoo Linux installed. But my concern is that my regular desktop use could compromise the security of self hosted applications, which tend to handle private user data.

What can I do to secure myself against this threat?

For example, browsers on their own are a security nightmare. You are running arbitrary remote scripts, and there's no telling the extent of damage they do (most websites out there doing extensive tracking).

What can I do to secure my self hosted applications while running them on the same machine? Is there something I can do to somehow isolate browsers and other sketchy applications from the damage they could possibly do?

top 5 comments
sorted by: hot top controversial new old
[–] Perhyte 6 points 1 year ago* (last edited 1 year ago)

Maybe just don't run your services under your regular user account?

Create one or more new user accounts and run them that way. Make sure not to give your regular user account any access to the data in the new accounts.

That doesn't stop all attacks: side-channel attacks (Spectre?) can still happen, and your machine can for example still run out of memory and break your services that way, but it's a solid start.

[–] [email protected] 2 points 1 year ago

Flatpak and Docker. Containerize your applications and ensure they have the least amount of permissions. Flatpak will let you control what files an app can access with the Flatseal app, and Docker will keep your self-hosted apps isolated. Or even better: use rootless podman containers.

[–] [email protected] 1 points 1 year ago

You could run your self hosted services in a VM. The rest of your system can't access that so it's about as secure as it gets. That's kind of what VMs are really good at. The downside is that are pretty much running another operating system inside your operating system so you need the RAM and CPU to support it. If you are running Gnome on that Gentoo box then look at Gnome Boxes.

[–] [email protected] 1 points 1 year ago

Setup multiple Virtual Machines on your desktop. Have a VM for web browsing and a VM for hosting your services. If either get compromised it would be much harder to jump into the other VM or access the host machine.

[–] [email protected] 1 points 1 year ago

One option could be running your browsers and stuff with Flatpak, then you can isolate them much more easily to only have access to specific parts of the filesystem.

Otherwise you could run all the self hosted apps inside a VM, that would heavily limit what the host apps could access.