How to secure non-yunohost server, the same as yunohost server?


[FRANÇAIS] (english below)

Je pose cette question, à propos d’un serveur qui n’est pas sur yunohost, sur ce forum yunohost, car c’est à propos de yunohost quand-même :stuck_out_tongue:

Si je veux installer plusieurs instances de yunohost sur mon serveur (cf ma question ici), je peux avoir besoin de gerer la securité de mon serveur ‘hôte’, sur lequel je n’ai pas installé yunohost (j’y installe par exemple proxmox pour gerer des containers linux avec yunohost installé dessus)

Quand on installe yunohost, il met en place certaines configurations de securité, qui j’imagine ont été bien réflechis pour être de bonne qualité (en tout cas, bien meilleure que ce que je pourrais faire avec mon niveau de connaissance de débutant). Cette page de la documentation explique seulement comment on peut changer certains reglages pour augmenter la securité, mais pas ce qui est déjà implémenté.

Ce que j’aimerai avoir, c’est le même niveau de sécurité qu’avec yunohost, mais sur un serveur debian11 sans yunohost (puisque si j’ai bien compris, je ne dois pas faire tourner proxmox dans un OS yunohost ?).


[ENGLISH]

I’m asking this question, about a server that isn’t on yunohost, on this yunohost forum, because it’s about yunohost anyway :stuck_out_tongue:

If I want to install several instances of yunohost on my server (cf my question here), I may need to manage the security of my ‘host’ server, on which I have not installed yunohost (for example, I install proxmox to manage linux containers with yunohost installed on it).

When you install yunohost, it sets up certain security configurations, which I imagine have been well thought out to be of good quality (in any case, much better than what I could do with my beginner’s level of knowledge). This page of the documentation only explains how you can change certain settings to increase security, but not what is already implemented.

What I’d like to have is the same level of security as with yunohost, but on a debian11 server without yunohost (since, if I’ve understood correctly, I must not run proxmox on a yunohost OS ?).

Short answer : firewall (ufw for example), fail2ban, don’t allow ssh from outside unless you need it. Will add more details later

1 Like

i wouldn’t open port 22 on firewall. i’d setup tailscale and ssh from there. setup ssh key.

1 Like

Details here:

  • firewall : choose the firewall you know the most. UFW is the one used by yunohost and is very easy to use from the cli. But there are other options like webmin and cockpit that have web interface for managing a firewall (and more).
  • fail2ban : I don’t have a big knowledge about it but as I understand, it blocks the IPs of failed connections improving the system security (brute force attacks). Other users may have better informations.
  • keep your servers up to date : host os, proxmox, yunohost VMs… Apticron is very helpful to get notified when new updates are available.
  • if your server is at home, I recommend to not allow ssh port on the router. You will need to ssh to your server, do it from home. But if ever you really need to get access from outside, change the ssh port and prefer passwordless access, using an ssh key.
  • avoid low quality app, unmaintained, not very popular ones…
  • have a good backup strategy.

Hope this helps. I may have missed some points and missexplained others since I’m not an expert in security, but this is a good starting point for your project.
Good luck

1 Like

thank you for your answers ! I’ll try all that (in 3 weeks unfortunately, I wanted to try it now but i have no time left) and maybe come back with new questions about it :slight_smile:

Bonjour,

La 1ère des sécurités pour proxmox est de n’accepter les connexions qu’en local ou via un VPN. Il ne faut en aucun cas laisser proxmox accessible directement sur son interface Web sur le net vu la sensibilité de cet outil.

Fail2ban me semble dans ce cas inutile. Je l’avais installé par méconnaissance et comme je n’ai accès à proxmox qu’à domicile et très exceptionnellement à travers un vpn (j’utilise un RPI3B+ pour ça occasionnellement si j’avais besoin d’intervenir lors d’une absence prolongée) , les logs de F2B me confirme qu’il n’y a jamais eu quelconque tentative de brute force, ce qui est normal vu que l’interface n’est disponible qu’en local.

La mise à jour peut se fait simplement via l’interface graphique. Apticron peut notifier quand il y en a.

Proxmox embarque une solution parefeu par défaut qui peut se gérer au niveau du datacenter, du noeud ou de la VM. Il y a aussi moyen de créer des Vlan pour isoler les VMS du réseau local.
Il te faudra également un reverse proxy pour accéder aux VM Yunohost qu’il faudra sécuriser. ET Yunohost permet justement de le faire moyennant quelques manipulations (conf SSO à copier sur le reverse + Appli redirect). Par contre si tu souhaites utiliser le mail sur tous les Yunohost, je n’ai aucune idée comment on le fait (du reverse-proxy mail, Nginx le permet normalement)

1 Like