From: Alyssa Ross <hi@alyssa.is>
To: devel@spectrum-os.org
Cc: Yureka Lilian <yureka@cyberchaos.dev>,
Demi Marie Obenour <demiobenour@gmail.com>
Subject: [PATCH v2 3/3] host/rootfs: run router as non-root
Date: Tue, 9 Dec 2025 12:05:06 +0100 [thread overview]
Message-ID: <20251209110503.674499-6-hi@alyssa.is> (raw)
In-Reply-To: <20251209110503.674499-2-hi@alyssa.is>
Signed-off-by: Alyssa Ross <hi@alyssa.is>
Message-ID: <20251209003813.553461-3-hi@alyssa.is>
---
v2: no change
host/rootfs/image/etc/group | 1 +
host/rootfs/image/etc/passwd | 1 +
.../vm-services/template/data/service/spectrum-router/run | 4 +++-
3 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/host/rootfs/image/etc/group b/host/rootfs/image/etc/group
index e3ade468..299ea68a 100644
--- a/host/rootfs/image/etc/group
+++ b/host/rootfs/image/etc/group
@@ -13,3 +13,4 @@ disk:x:11:
cdrom:x:12:
tape:x:13:
kvm:x:14:
+router:x:15:router
diff --git a/host/rootfs/image/etc/passwd b/host/rootfs/image/etc/passwd
index 29f3b252..8c579ce8 100644
--- a/host/rootfs/image/etc/passwd
+++ b/host/rootfs/image/etc/passwd
@@ -1 +1,2 @@
root:x:0:0:System administrator:/:/bin/sh
+router:x:15:15::/:/bin/nologin
diff --git a/host/rootfs/image/etc/s6-linux-init/run-image/service/vm-services/template/data/service/spectrum-router/run b/host/rootfs/image/etc/s6-linux-init/run-image/service/vm-services/template/data/service/spectrum-router/run
index ec26b76f..2c6626e3 100755
--- a/host/rootfs/image/etc/s6-linux-init/run-image/service/vm-services/template/data/service/spectrum-router/run
+++ b/host/rootfs/image/etc/s6-linux-init/run-image/service/vm-services/template/data/service/spectrum-router/run
@@ -11,13 +11,15 @@ fdmove -c 3 0
s6-ipcserver-socketbinder -a 0770 /run/router/${VM}
fdmove -c 4 0
+redirfd -r 0 /dev/null
+
# Notify readiness.
if {
fdmove -c 5 1
echo
}
-redirfd -r 0 /dev/null
+s6-setuidgid router
bwrap
--unshare-all
--
2.51.0
next prev parent reply other threads:[~2025-12-09 11:06 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-09 11:05 [PATCH v2 1/3] tools/router: use socket activation Alyssa Ross
2025-12-09 11:05 ` [PATCH v2 2/3] host/rootfs: put router app sockets in own dir Alyssa Ross
2025-12-09 11:05 ` Alyssa Ross [this message]
2025-12-09 11:20 ` [PATCH v2 1/3] tools/router: use socket activation Yureka
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20251209110503.674499-6-hi@alyssa.is \
--to=hi@alyssa.is \
--cc=demiobenour@gmail.com \
--cc=devel@spectrum-os.org \
--cc=yureka@cyberchaos.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://spectrum-os.org/git/crosvm
https://spectrum-os.org/git/doc
https://spectrum-os.org/git/mktuntap
https://spectrum-os.org/git/nixpkgs
https://spectrum-os.org/git/spectrum
https://spectrum-os.org/git/ucspi-vsock
https://spectrum-os.org/git/www
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).