10
submitted 1 year ago by azukaar@alien.top to c/main@selfhosted.forum

Link: github.com/azukaar/cosmos-Server/

Cosmos 0.11.0 is out with a new backup system to export all your docker containers! The Linux and Mac clients are also out for some early testing, please share your feedback!

https://preview.redd.it/htjbg0ze5rvb1.jpg?width=1695&format=pjpg&auto=webp&s=944ae33ae00c67159eddecf4ff923a1a0141e106

The new backup system works by reading the list of containers on your server and exporting a single compose file, with all the setup you need to recreate (in case of crash) or migrate your server.

The backup system triggers on every docker change, including changes you've made outside of Cosmos (ex. Portainer, etc...).

It outputs to a single file in your config folder, which you can backup with various strategy to keep a history of your docker containers state!

As a reminder, this exists alongside the existing features:

  • App Store ๐Ÿ“ฆ๐Ÿ“ฑ To easily install and manage your applications, with simple installers, automatic updates and security checks
  • Customizable Homepage ๐Ÿ ๐Ÿ–ผ To access all your applications from a single place, with a beautiful and customizable UI
  • Reverse-Proxy ๐Ÿ”„๐Ÿ”— Targeting containers, other servers, or serving static folders / SPA with automatic HTTPS, and a nice UI
  • VPN ๐ŸŒ๐Ÿ”’ To securely access your applications from anywhere, without having to open ports on your router.
  • Authentication Server ๐Ÿ‘ฆ๐Ÿ‘ฉ With strong security, multi-factor authentication and multiple strategies (OpenId, forward headers, HTML)
  • Container manager ๐Ÿ‹๐Ÿ”ง To easily manage your containers and their settings, keep them up to date as well as audit their security. Includes docker-compose support!
  • Identity Provider ๐Ÿ‘ฆ๐Ÿ‘ฉ To easily manage your users, invite your friends and family to your applications without awkardly sharing credentials. Let them request a password change with an email rather than having you unlock their account manually!
  • SmartShield technology ๐Ÿง ๐Ÿ›ก Automatically secure your applications without manual adjustments (see below for more details). Includes anti-bot and anti-DDOS strategies.

โ€‹

As always, eager to get some feedback on this release, here's the rest of the changelog:

- Docker export feature for backups on every docker event
- Disable support for X-FORWARDED-FOR incoming header (needs further testing)
- Compose Import feature now supports skipping creating existing resources
- Compose Import now overwrite containers if they are differents
- Added support for cosmos-persistent-env, to persist password when overwriting containers (useful for encrypted or password protected volumes, like databases use)
- Fixed bug where import compose would try to revert a previously created volume when errors occurs
- Terminal for import now has colours
- Fix a bug where ARM CPU would not be able to start Constellation

โ€‹

happy hosting!

you are viewing a single comment's thread
view the rest of the comments
[-] geo38@alien.top 1 points 1 year ago

The readme is all about security and holes and other bad things that hackers/miscreants/bots can do and how Cosmos can prevent them, but the example run command has this which pretends none of those things actually exist:

--privileged  -v /:/mnt/host

Any sort of security lapse/hole in Cosmos or the software it builds upon gives a miscreant/bot/hacker full read/write access to the entire host system!

It's ironic as the readme has many bolded statements about how cosmos protects docker containers from one another in case one is breached, but makes the bold assumption that the Cosmos container itself is completely secure.

Mounting '/' from the host is a bad suggestion. Yes, the readme says it's optional, but holy heck don't make it the suggested method as many of the folks using Cosmos are doing so because they don't understand security and they'll use the suggested run command. They don't know this is a BAD suggestion.

[-] azukaar@alien.top 1 points 1 year ago

Cosmos is a fully fledged server management platform, as such it requires those access to the host server in order to operate.

"--privileged -v /:/mnt/host" is not as bad of a thing as you would think in that context, in fact it is equivalent to running a daemon like you would with any other alternative (CasaOS, Umbrel, etc..) those are just requirement for Cosmos to run with the same level of exposure as those alternatives who are not docker containers.

My only alternative would have been to make Cosmos a daemon and not a container, but then it would make install and maintenance harder

I understand your point, and yes ideally it would run as an isolated container, but it's just not possible to have a supervisor software managing your server running in an isolated container with no container, it is contradictory

I propose as alternative to run Cosmos with lower privilege, in which case some features will not work but the default is to run cosmos with the privileges it requires for all features to work as expected.

And the bottom line, the security benefits behind Cosmos for your average home-server outweigh by far this "--privileged -v /:/mnt/host". Slight reminder than a very large portion of people running alternatives like Casa, Umbrel, etc... Also expose those root daemon without even HTTPS or anything!

[-] geo38@alien.top 1 points 1 year ago

I think you're missing the point. My issue is sharing / with the container as root. I understand some parts of Cosmos require --privileged. That is not my issue.

To be super repetitive, my issue is the combination of --privileged with -v /:/mnt/host

The very next statement in your documentation after this says:

in this command, -v /:/mnt/host is optional and allow to manage folders from Cosmos, you can remove it if you don't want it but you will have to create your container's bind folders manually.

If it's optional, then don't give it in the sample command that 99% of users will run. You can't tell me that it's not a risk.

And saying "other programs have risks, too" is pretty cowardly defense against suggesting users do something as unsafe as mapping their entire host file system to Cosmos when Cosmos doesn't need it.

[-] azukaar@alien.top 1 points 1 year ago

Another way of seeing it is, if Cosmos wasn't a container it would see `/` anyway. It's not extra access, it's just a workaround for Docker

[-] xIndirect@alien.top 1 points 1 year ago

I think other poster is more of pointing out why not have -v /CasaFolder:/mnt/host or something similar. I've been in the IT sector for a while and I view that if you have to use a workaround instead of actually solving the problem, there is an issue with your tooling or solution. Secondly, I see your point but I also agree with the other poster. There's tons of security vulnerabilities announced and used on a daily basis and you should never have permissions to things you don't need. Is there a reason why the user couldn't just have a note in docs to say if you want to do X then mount this way? It's a few more lines and doesn't give an insecure by default config right from the get go for users that otherwise wouldn't know better.

[-] azukaar@alien.top 1 points 1 year ago

Don't get me wrong, I am fully aware that you need to reduce as much as possible the amount of access something has but as you said:

you should never have permissions to things you don't need

well Cosmos needs to see your files if you want Cosmos to manage your files. It's that simple. By default its on because it is needed for Cosmos to function. You can remove it, but at the expense of some of the functionalities of the server.

By the way Cosmos, as a Docker management software, has access to your docker socket. Which mean, you can remove anything you want from the container, technically, it can add it back itself. Having access to the socket means being able to manage the containers, including itself. In other words, having this mount in the docker run command is just a comfort thing, but in term of privilege, whether it's Cosmos or Portainer or any other docker manager, they have full root access to your system and that's unavoidable.

why not have -v /CasaFolder:/mnt/host or something similar

Because it would require users to always update their Cosmos containers to add additional folders all the time, giving a terrible and very error prone user experience.

If there is a solution out there, that solves that problem (as in allows Cosmos to continue to work the same without that mount) then I will gladly implement it. But as far as I can see there isn't such solution

load more comments (3 replies)
this post was submitted on 22 Oct 2023
10 points (100.0% liked)

Self-Hosted Main

504 readers
1 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.

For Example

We welcome posts that include suggestions for good self-hosted alternatives to popular online services, how they are better, or how they give back control of your data. Also include hints and tips for less technical readers.

Useful Lists

founded 1 year ago
MODERATORS