From 473e233933c86c63656cadede7bdb375f189066a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Mon, 17 Jun 2024 18:52:55 +0200 Subject: [PATCH 1/3] add sanboxing --- conf/systemd.service | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/conf/systemd.service b/conf/systemd.service index cf70664..e497297 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -13,5 +13,39 @@ Environment=PORT=__PORT__ ExecStart=__YNH_NPM__ run start Restart=on-failure +### Depending on specificities of your service/app, you may need to tweak these +### .. but this should be a good baseline +# Sandboxing options to harden security +# Details for these options: https://www.freedesktop.org/software/systemd/man/systemd.exec.html +NoNewPrivileges=yes +PrivateTmp=yes +PrivateDevices=yes +RestrictAddressFamilies=AF_UNIX AF_INET AF_INET6 AF_NETLINK +RestrictNamespaces=yes +RestrictRealtime=yes +DevicePolicy=closed +ProtectClock=yes +ProtectHostname=yes +ProtectProc=invisible +ProtectSystem=full +ProtectControlGroups=yes +ProtectKernelModules=yes +ProtectKernelTunables=yes +LockPersonality=yes +SystemCallArchitectures=native +SystemCallFilter=~@clock @debug @module @mount @obsolete @reboot @setuid @swap @cpu-emulation @privileged + +# Denying access to capabilities that should not be relevant for webapps +# Doc: https://man7.org/linux/man-pages/man7/capabilities.7.html +CapabilityBoundingSet=~CAP_RAWIO CAP_MKNOD +CapabilityBoundingSet=~CAP_AUDIT_CONTROL CAP_AUDIT_READ CAP_AUDIT_WRITE +CapabilityBoundingSet=~CAP_SYS_BOOT CAP_SYS_TIME CAP_SYS_MODULE CAP_SYS_PACCT +CapabilityBoundingSet=~CAP_LEASE CAP_LINUX_IMMUTABLE CAP_IPC_LOCK +CapabilityBoundingSet=~CAP_BLOCK_SUSPEND CAP_WAKE_ALARM +CapabilityBoundingSet=~CAP_SYS_TTY_CONFIG +CapabilityBoundingSet=~CAP_MAC_ADMIN CAP_MAC_OVERRIDE +CapabilityBoundingSet=~CAP_NET_ADMIN CAP_NET_BROADCAST CAP_NET_RAW +CapabilityBoundingSet=~CAP_SYS_ADMIN CAP_SYS_PTRACE CAP_SYSLOG + [Install] WantedBy=multi-user.target From b16fda64ccd38cfcfc4d97d045eb3e536e4c741b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Mon, 17 Jun 2024 22:06:44 +0200 Subject: [PATCH 2/3] Update manifest.toml --- manifest.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.toml b/manifest.toml index 5ad536c..72a0699 100644 --- a/manifest.toml +++ b/manifest.toml @@ -7,7 +7,7 @@ name = "BorgWarehouse" description.en = "WebUI for a BorgBackup's central repository server" description.fr = "WebUI pour BorgBackup" -version = "2.3.0~ynh2" +version = "2.3.0~ynh3" maintainers = [] From 2570687ba2c814a43925df69f7e6b3f32f8c7472 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Mon, 17 Jun 2024 20:06:49 +0000 Subject: [PATCH 3/3] Auto-update READMEs --- README.md | 2 +- README_es.md | 2 +- README_eu.md | 2 +- README_fr.md | 2 +- README_gl.md | 2 +- README_zh_Hans.md | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index c05489e..b0613a2 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ It shall NOT be edited by hand. BorgWarhouse is a fast and modern WebUI for a BorgBackup's central repository server. -**Shipped version:** 2.3.0~ynh2 +**Shipped version:** 2.3.0~ynh3 ## Screenshots diff --git a/README_es.md b/README_es.md index 97eb0b5..3873a10 100644 --- a/README_es.md +++ b/README_es.md @@ -19,7 +19,7 @@ No se debe editar a mano. BorgWarhouse is a fast and modern WebUI for a BorgBackup's central repository server. -**Versión actual:** 2.3.0~ynh2 +**Versión actual:** 2.3.0~ynh3 ## Capturas diff --git a/README_eu.md b/README_eu.md index af52fe2..83d896a 100644 --- a/README_eu.md +++ b/README_eu.md @@ -19,7 +19,7 @@ EZ editatu eskuz. BorgWarhouse is a fast and modern WebUI for a BorgBackup's central repository server. -**Paketatutako bertsioa:** 2.3.0~ynh2 +**Paketatutako bertsioa:** 2.3.0~ynh3 ## Pantaila-argazkiak diff --git a/README_fr.md b/README_fr.md index 579b1c7..be63738 100644 --- a/README_fr.md +++ b/README_fr.md @@ -18,7 +18,7 @@ Il NE doit PAS être modifié à la main. BorgWarhouse est une interface Web rapide et moderne pour BorgBackup. -**Version incluse :** 2.3.0~ynh2 +**Version incluse :** 2.3.0~ynh3 ## Captures d’écran diff --git a/README_gl.md b/README_gl.md index 306d7b2..3d55a1a 100644 --- a/README_gl.md +++ b/README_gl.md @@ -19,7 +19,7 @@ NON debe editarse manualmente. BorgWarhouse is a fast and modern WebUI for a BorgBackup's central repository server. -**Versión proporcionada:** 2.3.0~ynh2 +**Versión proporcionada:** 2.3.0~ynh3 ## Capturas de pantalla diff --git a/README_zh_Hans.md b/README_zh_Hans.md index 964b3fa..142fbbe 100644 --- a/README_zh_Hans.md +++ b/README_zh_Hans.md @@ -19,7 +19,7 @@ BorgWarhouse is a fast and modern WebUI for a BorgBackup's central repository server. -**分发版本:** 2.3.0~ynh2 +**分发版本:** 2.3.0~ynh3 ## 截图