From dfd120537d6b2ceb0e7afc3323bdb4bda71b1f06 Mon Sep 17 00:00:00 2001 From: Anna Aurora Date: Tue, 10 Oct 2023 18:46:52 +0200 Subject: [PATCH] nixos/meme-bingo-web: fixed documentation, service description and did further hardening --- nixos/modules/services/web-apps/meme-bingo-web.nix | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/nixos/modules/services/web-apps/meme-bingo-web.nix b/nixos/modules/services/web-apps/meme-bingo-web.nix index ab123ba8ef9c..4623bc22c26f 100644 --- a/nixos/modules/services/web-apps/meme-bingo-web.nix +++ b/nixos/modules/services/web-apps/meme-bingo-web.nix @@ -17,7 +17,7 @@ in { baseUrl = mkOption { description = '' - URL to be used for the HTML element on all HTML routes. + URL to be used for the HTML \ element on all HTML routes. ''; type = types.str; default = "http://localhost:41678/"; @@ -36,7 +36,7 @@ in { config = mkIf cfg.enable { systemd.services.meme-bingo-web = { - description = "A web app for playing meme bingos."; + description = "A web app for playing meme bingos"; wantedBy = [ "multi-user.target" ]; environment = { @@ -59,6 +59,7 @@ in { # Hardening CapabilityBoundingSet = [ "" ]; DeviceAllow = [ "/dev/random" ]; + InaccessiblePaths = [ "/dev/shm" "/sys" ]; LockPersonality = true; PrivateDevices = true; PrivateUsers = true; @@ -73,6 +74,7 @@ in { ProtectKernelTunables = true; ProtectProc = "invisible"; RestrictAddressFamilies = [ "AF_INET" "AF_INET6" ]; + RestrictFilesystems = [ "@basic-api" "~sysfs" ]; RestrictNamespaces = true; RestrictRealtime = true; SystemCallArchitectures = "native";