Skip to content

Secure, Fast, and Extensible Sandbox runtime for AI agents.

docs(fast-sandbox-env): tighten comments across the init-mode changes

高然769786ea41a1
diff --git a/scripts/fast-sandbox-env/README.md b/scripts/fast-sandbox-env/README.md
index b5a0656b1..439a4e465 100644
--- a/scripts/fast-sandbox-env/README.md
+++ b/scripts/fast-sandbox-env/README.md
@@ -97,7 +97,7 @@ Everything else comes from the OpenSandbox Helm charts (`manifests/charts`), ren
`up`: preflight → sysctl → fast-sandbox checkout (pinned commit) → build images (6 fast-sandbox images via `manifests/release/build-fast-sandbox.sh` + egress + server + ingress) → XFS StateRoot → kind cluster + node labels (host ports 18080/18081) → RustFS → charts rendered + applied: base + fast-sandbox (CRDs, RBAC, control plane, installer, agent) → credentials → **MITM CA material (Secret + echo leaf cert)** → installer/agent roster asserted → charts rendered + applied: server + ingress gateway → **TLS echo endpoint (kind-network container)** → SandboxTemplate golden image **built through the server `POST /templates` API, CA baked** → SandboxPool (fastlet Ready, egress Ready, pool conditions, actions protocol check, **pinned CA fingerprint**).
-`verify-native`: end-to-end verify (templateId create → signed gateway route → execd `/ping` → delete) → **execd-as-init in-guest process verify** (PID 1 = guest init, execd `--init` as its subreaper child, entrypoint supervised by execd, orphan reparenting, hardening report `init_mode=subreaper`) → pause/resume round-trip (POST pause → poll `Paused` + route released → POST resume → poll `Running` → fresh-route `/ping` → delete) → vault lifecycle → **MITM CA chain verify (pinning three-way, passthrough negative control, SNI credential injection, post-resume injection)** → idle-pause/wake (IDLE_PAUSE profile) → snapshot round trip.
+`verify-native`: end-to-end verify (templateId create → signed gateway route → execd `/ping` → delete) → **execd-as-init in-guest process verify** (PID 1 = guest init; execd `--init` supervises the workload; orphan reparented and reaped; hardening report `init_mode=subreaper`) → pause/resume round-trip (POST pause → poll `Paused` + route released → POST resume → poll `Running` → fresh-route `/ping` → delete) → vault lifecycle → **MITM CA chain verify (pinning three-way, passthrough negative control, SNI credential injection, post-resume injection)** → idle-pause/wake (IDLE_PAUSE profile) → snapshot round trip.
`verify-overlaybd`: overlaybd SandboxTemplate build (oci:// publication) → the same verify matrix against the overlaybd template.
@@ -123,7 +123,7 @@ The RustFS migration replaces the previous `MINIO_*` and `MC_IMAGE` overrides. B
| `POOL_MIN` / `POOL_MAX` | `2` / `2` | pool capacity (auto `1`/`1` when `KIND_SINGLE=1`) |
| `WARM_IMAGES` | `0` | `1` = preheat pool instead of on-demand first-sandbox pull |
| `SBX_IMAGE` / `EXECD` | `opensandbox/fsb-sandbox-golden:latest` / `opensandbox/execd:latest` | template build inputs |
-| `EXECD_RUN_AS_INIT` | `true` | OSEP-0018 execd-as-init: the server config sets `runtime.execd_run_as_init`, so templates bake `EXECD_INIT=1` and the guest boots `bootstrap.sh` into `execd --init` (subreaper under the guest init; pinned by the init-mode verify stage). `false` restores the classic background-and-wait topology — the init-mode verify stage fails by design. |
+| `EXECD_RUN_AS_INIT` | `true` | OSEP-0018 execd-as-init: templates bake `EXECD_INIT=1` (pinned by the init-mode verify stage); `false` = classic topology, that stage fails. |
| `RUSTFS_IMAGE` / `RC_IMAGE` | `rustfs/rustfs:latest` / `rustfs/rc:latest` | RustFS server and CLI images |
| `RUSTFS_PORT` | `19000` | host-side S3 API publish; in-cluster clients use the RustFS container IP on port `9000` |
| `RUSTFS_CONSOLE_PORT` | `19001` | host-side RustFS console publish (human-only; override on port collision) |
diff --git a/scripts/fast-sandbox-env/integration-env.sh b/scripts/fast-sandbox-env/integration-env.sh
index 9d8ca6235..671bee128 100755
--- a/scripts/fast-sandbox-env/integration-env.sh
+++ b/scripts/fast-sandbox-env/integration-env.sh
@@ -30,11 +30,9 @@
# server bakes it into the golden image, the pool pins the keypair into
# mitmdump, and a guest HTTPS request proves the template↔pool fingerprint
# pinning plus per-subject credential injection against a CA-signed TLS echo
-# endpoint, and the execd-as-init in-guest process verify (OSEP-0018: the
-# server config carries runtime.execd_run_as_init, so the guest boots
-# bootstrap.sh into `execd --init`; the stage pins PID 1 = guest init,
-# execd --init as its child, the entrypoint supervised by execd, orphan
-# reparenting to the subreaper, and hardening.init_mode=subreaper).
+# endpoint, and the execd-as-init in-guest process verify (OSEP-0018:
+# `execd --init` as a subreaper under the guest init — topology, reaping,
+# and the hardening report pinned in-guest).
#
# All Kubernetes resources come from the charts via `helm template` + plain
# `kubectl apply` (no helm release state); the only env-owned manifests are
@@ -65,10 +63,8 @@
# SERVER_HOST_PORT / GATEWAY_HOST_PORT host-side publishes (default 18080/18081)
# WARM_IMAGES=1 preheat pool warmImages (default: on-demand first-sandbox pull)
# SBX_IMAGE / EXECD template build inputs (default opensandbox/fsb-sandbox-golden:latest / opensandbox/execd:latest)
-# EXECD_RUN_AS_INIT OSEP-0018 execd-as-init (default true): the server
-# config sets runtime.execd_run_as_init so templates bake
-# EXECD_INIT=1; false restores the classic topology (the
-# init-mode verify stage fails by design)
+# EXECD_RUN_AS_INIT OSEP-0018 execd-as-init (default true); false =
+# classic topology (the init-mode verify stage fails)
# POOL_MIN / POOL_MAX pool capacity (default 2/2; auto 1/1 when KIND_SINGLE=1)
# MAX_SANDBOXES_PER_POD per-fastlet sandbox capacity (default 8)
# XFS_STATEROOT / XFS_SIZE reflink StateRoot on/off and virtual size
@@ -139,12 +135,8 @@ RC_CONFIG_DIR="$WORK/rc-config"
SBX_IMAGE="${SBX_IMAGE:-opensandbox/fsb-sandbox-golden:latest}"
EXECD="${EXECD:-opensandbox/execd:latest}"
-# OSEP-0018 execd-as-init: the server config carries runtime.execd_run_as_init,
-# so every golden-image template bakes EXECD_INIT=1 and the guest boots
-# bootstrap.sh into `execd --init` (execd supervises the workload as a
-# subreaper under the fsb guest init; the init-mode verify stage pins the
-# in-guest process topology). Set EXECD_RUN_AS_INIT=false for the classic
-# background-and-wait topology (the init-mode verify stage will then fail).
+# OSEP-0018: bake EXECD_INIT=1 into templates (the init-mode verify stage
+# pins the in-guest topology); false restores the classic topology.
EXECD_RUN_AS_INIT="${EXECD_RUN_AS_INIT:-true}"
# WARM_IMAGES=1 preheats pool warmImages (keyed by template id); the default
# is the on-demand first-sandbox pull through DART.
@@ -2386,9 +2378,7 @@ level = "INFO"
[runtime]
type = "kubernetes"
execd_image = "@EXECD_IMAGE@"
-# OSEP-0018: templates bake EXECD_INIT=1 so the guest boots bootstrap.sh into
-# `execd --init` (subreaper under the fsb guest init); pinned by the
-# init-mode verify stage.
+# OSEP-0018: bake EXECD_INIT=1 into templates; pinned by the init-mode verify.
execd_run_as_init = @EXECD_RUN_AS_INIT@
[kubernetes]
@@ -2828,17 +2818,14 @@ pause_resume_verify() {
# --- stage: execd-as-init in-guest process verify (OSEP-0018) -------------------
# NOTE: verify/init-mode.sh carries the split-layout copy of this stage; keep
-# the two in sync until the env.sh split is completed and the verify scripts
-# become the single home.
+# the two in sync until the env.sh split is completed.
-# guest_out <words...>: run a command in the sandbox through the CLI; stdout
-# is the guest command's output (framing lines tolerated downstream).
+# guest_out <words...>: run a command in the sandbox via the CLI.
guest_out() {
osb_api command run "$VERIFY_ID" -- "$@" 2>"$LOGS_DIR/init-mode-cmd.err"
}
-# guest_value <key> <words...>: extract the VALUE of the guest's KEY=VALUE
-# line (first match wins; non-matching framing lines are skipped).
+# guest_value <key> <words...>: extract the guest's KEY=VALUE line.
guest_value() { # <key> <probe-words...>
local key="$1" line
shift
@@ -2862,14 +2849,13 @@ init_mode_verify() { # [template-id]
[[ -n "$VERIFY_ID" && "$VERIFY_ID" != "null" ]] || fail "create response carried no id"
wait_for "init-mode target Running" 600 sandbox_running
- # 0. The full in-guest process table, verbatim: the ground truth every
- # assertion below filters, and the first evidence a failure reads.
+ # Full process table first: ground truth + failure evidence.
log "verify (init-mode): in-guest process table (pid ppid pgid sid stat args):"
guest_out sh -c 'ps -eo pid,ppid,pgid,sid,stat,args || ps -ef' \
| tee "$LOGS_DIR/init-mode-processes.txt" >&2 \
|| log "verify (init-mode): process table dump failed (continuing; the probes below carry the diagnostics)"
- # 1. PID 1 is the fsb guest init (not bootstrap.sh, not execd).
+ # 1. PID 1 is the guest init.
probe="$(guest_value PID1 sh -c 'echo "PID1=$(tr "\0" " " < /proc/1/cmdline)"')" \
|| fail "init-mode: /proc/1/cmdline probe failed: $(head -c 300 "$LOGS_DIR/init-mode-cmd.err" 2>/dev/null)"
case "$probe" in
@@ -2877,7 +2863,7 @@ init_mode_verify() { # [template-id]
*) fail "guest PID 1 is not the guest init: /proc/1/cmdline = $probe" ;;
esac
- # 2. execd is present and armed with --init.
+ # 2. execd armed with --init.
execd_pid="$(guest_value EXECD_PID sh -c 'echo "EXECD_PID=$(pgrep -x execd | head -1)"')" \
|| fail "init-mode: execd pgrep probe failed: $(head -c 300 "$LOGS_DIR/init-mode-cmd.err" 2>/dev/null)"
case "$execd_pid" in
@@ -2889,25 +2875,21 @@ init_mode_verify() { # [template-id]
|| fail "execd (pid $execd_pid) does not carry --init (cmdline probe output: $probe)"
pass "execd runs with --init (pid $execd_pid)"
- # 3. execd is a direct child of PID 1 (bootstrap.sh exec'd away).
+ # 3. execd is PID 1's child (bootstrap exec'd away).
probe="$(guest_value EXECD_PPID sh -c "echo \"EXECD_PPID=\$(grep '^PPid:' /proc/$execd_pid/status | grep -o '[0-9]*')\"")" \
|| fail "init-mode: execd PPid probe failed: $(head -c 300 "$LOGS_DIR/init-mode-cmd.err" 2>/dev/null)"
[[ "$probe" == "1" ]] \
|| fail "execd (pid $execd_pid) is not a child of PID 1: PPid=$probe"
pass "execd is a direct child of the guest init (PPid=1)"
- # 4. The baked entrypoint is supervised by execd (its child, not a
- # sibling of bootstrap: the template default is tail -f /dev/null).
+ # 4. The entrypoint is execd's child.
probe="$(guest_value TAIL_PPID sh -c 'p=$(pgrep -f "tail -f /dev/null" | head -1); echo "TAIL_PPID=$(grep "^PPid:" /proc/$p/status | grep -o "[0-9]*")"')" \
|| fail "init-mode: entrypoint PPid probe failed: $(head -c 300 "$LOGS_DIR/init-mode-cmd.err" 2>/dev/null)"
[[ "$probe" == "$execd_pid" ]] \
|| fail "the entrypoint is not a child of execd (pid $execd_pid): entrypoint PPid=$probe"
pass "the baked entrypoint is supervised by execd (entrypoint PPid=$execd_pid)"
- # 5. Subreaper semantics: an orphaned background process reparents to
- # execd (the nearest subreaper ancestor), not to PID 1. The orphan
- # sleeps briefly and is left to exit on its own so assertion 6 can
- # pin the reaping.
+ # 5. The orphan reparents to execd (subreaper); left to exit for #6.
guest_out sh -c 'sleep 6 >/dev/null 2>&1 & echo $! > /tmp/osb-init-mode-orphan.pid' >/dev/null \
|| fail "init-mode: orphan spawn failed: $(head -c 300 "$LOGS_DIR/init-mode-cmd.err" 2>/dev/null)"
probe="$(guest_value ORPHAN_PPID sh -c 'p=$(cat /tmp/osb-init-mode-orphan.pid); echo "ORPHAN_PPID=$(grep "^PPid:" /proc/$p/status | grep -o "[0-9]*")"')" \
@@ -2916,26 +2898,21 @@ init_mode_verify() { # [template-id]
|| fail "the orphan did not reparent to execd (pid $execd_pid): orphan PPid=$probe"
pass "orphaned processes reparent to execd (subreaper; orphan PPid=$execd_pid)"
- # 6. execd reaps the orphan: once it exits, /proc/<pid> must disappear
- # within the poll budget — a non-reaping parent would keep it as a
- # `Z` child forever (the OSEP-0018 reaper is SIGCHLD-driven with a
- # sweep backstop, so latency is well under the budget).
+ # 6. execd reaps the exited orphan (else it stays a Z child forever).
init_mode_orphan_reaped() {
[[ "$(guest_value REAPED sh -c 'p=$(cat /tmp/osb-init-mode-orphan.pid 2>/dev/null); if [ -n "$p" ] && [ ! -e "/proc/$p" ]; then echo "REAPED=1"; else echo "REAPED=0"; fi')" == "1" ]]
}
wait_for "execd reaps the exited orphan (pid gone from /proc)" 20 init_mode_orphan_reaped
guest_out sh -c 'rm -f /tmp/osb-init-mode-orphan.pid' >/dev/null 2>&1 || true
- # 7. The whole process table ends zombie-free.
+ # 7. No zombies left.
probe="$(guest_value ZOMBIES sh -c 'echo "ZOMBIES=$(ps -eo stat | grep -c "^Z" || true)"')" \
|| fail "init-mode: zombie count probe failed: $(head -c 300 "$LOGS_DIR/init-mode-cmd.err" 2>/dev/null)"
[[ "$probe" == "0" ]] \
|| fail "the guest process table carries zombies: $probe in Z state"
pass "guest process table is zombie-free after the orphan round trip"
- # 8. The capabilities endpoint reports the fsb/Pool init tier: execd owns
- # the process tree as a subreaper; the kernel PID 1 signal shield
- # stays with the fsb guest init.
+ # 8. Report: subreaper tier, no signal shield.
local hardening_line
hardening_line="$(guest_out curl -fsS http://127.0.0.1:44772/v1/isolated/capabilities 2>/dev/null \
| while IFS= read -r line || [[ -n "$line" ]]; do
diff --git a/scripts/fast-sandbox-env/verify/init-mode.sh b/scripts/fast-sandbox-env/verify/init-mode.sh
index 15fb4a46a..2b231710a 100644
--- a/scripts/fast-sandbox-env/verify/init-mode.sh
+++ b/scripts/fast-sandbox-env/verify/init-mode.sh
@@ -13,51 +13,27 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-# verify/init-mode.sh — execd-as-init in-guest process verify (OSEP-0018)
+# verify/init-mode.sh — execd-as-init in-guest process verify (OSEP-0018).
#
-# The server config in this environment sets runtime.execd_run_as_init, so
-# every template bakes EXECD_INIT=1 and the golden image's guest init boots
-# bootstrap.sh, which execs `execd --init` (execd supervises the workload
-# through the fsb guest init, which stays PID 1 — subreaper mode, no PID 1
-# signal shield). This stage pins the in-guest process topology that the
-# other verifies cannot see, all through one template sandbox driven by
-# `osb command run`:
+# runtime.execd_run_as_init makes templates bake EXECD_INIT=1, so the guest
+# boots bootstrap.sh into `execd --init`: execd supervises the workload as a
+# subreaper under the fsb guest init (PID 1, no signal shield). This stage
+# dumps the full in-guest process table, then pins: PID 1 is the guest init,
+# execd carries --init as its child, the entrypoint is execd's child, an
+# orphan reparents to execd and gets reaped (no zombies), and the
+# capabilities endpoint reports init_mode=subreaper / signal_shield=false.
#
-# 0. Dump the FULL in-guest process table first (ps pid/ppid/pgid/sid/
-# stat/args) — the human-readable ground truth every assertion below
-# filters, kept verbatim in the stage log and at
-# $LOGS_DIR/init-mode-processes.txt as failure evidence.
-# 1. PID 1 is the fsb guest init (cmdline contains sandbox-init), NOT
-# bootstrap.sh or execd.
-# 2. execd runs with the --init flag (OSEP-0018 init duties armed).
-# 3. execd is a direct child of PID 1 (bootstrap exec'd away).
-# 4. The baked entrypoint (default tail -f /dev/null) is a child of execd
-# — the workload is supervised by execd, not a sibling shell.
-# 5. Subreaper semantics: an orphaned process reparents to execd (nearest
-# subreaper ancestor), not to PID 1.
-# 6. execd REAPS that orphan: after it exits, /proc/<pid> disappears
-# within the poll budget (a non-reaping parent would leave it a `Z`
-# child forever), and the whole process table ends zombie-free.
-# 7. execd /v1/isolated/capabilities reports hardening.init_mode =
-# subreaper and signal_shield = false (the documented fsb/Pool tier).
-#
-# Guest-side tool expectations: the golden image (Debian + procps) provides
-# pgrep/awk/grep/curl; each probe prints one KEY=VALUE line that the host
-# side extracts (the CLI stream may carry non-JSON framing).
-#
-# NOTE: integration-env.sh carries an inline copy of this stage (like
-# vault.sh); keep the two in sync until the env.sh split is completed.
+# NOTE: integration-env.sh carries an inline copy of this stage; keep the
+# two in sync until the env.sh split is completed.
source "$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)/lib.sh"
-# guest_out <words...>: run a command in the sandbox through the CLI; stdout
-# is the guest command's output (framing lines tolerated downstream).
+# guest_out <words...>: run a command in the sandbox via the CLI.
guest_out() {
osb_api command run "$VERIFY_ID" -- "$@" 2>"$LOGS_DIR/init-mode-cmd.err"
}
-# guest_value <key> <words...>: extract the VALUE of the guest's KEY=VALUE
-# line (first match wins; non-matching framing lines are skipped).
+# guest_value <key> <words...>: extract the guest's KEY=VALUE line.
guest_value() { # <key> <probe-words...>
local key="$1" line
shift
@@ -81,14 +57,13 @@ init_mode_verify() { # [template-id]
[[ -n "$VERIFY_ID" && "$VERIFY_ID" != "null" ]] || fail "create response carried no id"
wait_for "init-mode target Running" 600 sandbox_running
- # 0. The full in-guest process table, verbatim: the ground truth every
- # assertion below filters, and the first evidence a failure reads.
+ # Full process table first: ground truth + failure evidence.
log "verify (init-mode): in-guest process table (pid ppid pgid sid stat args):"
guest_out sh -c 'ps -eo pid,ppid,pgid,sid,stat,args || ps -ef' \
| tee "$LOGS_DIR/init-mode-processes.txt" >&2 \
|| log "verify (init-mode): process table dump failed (continuing; the probes below carry the diagnostics)"
- # 1. PID 1 is the fsb guest init (not bootstrap.sh, not execd).
+ # 1. PID 1 is the guest init.
probe="$(guest_value PID1 sh -c 'echo "PID1=$(tr "\0" " " < /proc/1/cmdline)"')" \
|| fail "init-mode: /proc/1/cmdline probe failed: $(head -c 300 "$LOGS_DIR/init-mode-cmd.err" 2>/dev/null)"
case "$probe" in
@@ -96,7 +71,7 @@ init_mode_verify() { # [template-id]
*) fail "guest PID 1 is not the guest init: /proc/1/cmdline = $probe" ;;
esac
- # 2. execd is present and armed with --init.
+ # 2. execd armed with --init.
execd_pid="$(guest_value EXECD_PID sh -c 'echo "EXECD_PID=$(pgrep -x execd | head -1)"')" \
|| fail "init-mode: execd pgrep probe failed: $(head -c 300 "$LOGS_DIR/init-mode-cmd.err" 2>/dev/null)"
case "$execd_pid" in
@@ -108,25 +83,21 @@ init_mode_verify() { # [template-id]
|| fail "execd (pid $execd_pid) does not carry --init (cmdline probe output: $probe)"
pass "execd runs with --init (pid $execd_pid)"
- # 3. execd is a direct child of PID 1 (bootstrap.sh exec'd away).
+ # 3. execd is PID 1's child (bootstrap exec'd away).
probe="$(guest_value EXECD_PPID sh -c "echo \"EXECD_PPID=\$(grep '^PPid:' /proc/$execd_pid/status | grep -o '[0-9]*')\"")" \
|| fail "init-mode: execd PPid probe failed: $(head -c 300 "$LOGS_DIR/init-mode-cmd.err" 2>/dev/null)"
[[ "$probe" == "1" ]] \
|| fail "execd (pid $execd_pid) is not a child of PID 1: PPid=$probe"
pass "execd is a direct child of the guest init (PPid=1)"
- # 4. The baked entrypoint is supervised by execd (its child, not a
- # sibling of bootstrap: the template default is tail -f /dev/null).
+ # 4. The entrypoint is execd's child.
probe="$(guest_value TAIL_PPID sh -c 'p=$(pgrep -f "tail -f /dev/null" | head -1); echo "TAIL_PPID=$(grep "^PPid:" /proc/$p/status | grep -o "[0-9]*")"')" \
|| fail "init-mode: entrypoint PPid probe failed: $(head -c 300 "$LOGS_DIR/init-mode-cmd.err" 2>/dev/null)"
[[ "$probe" == "$execd_pid" ]] \
|| fail "the entrypoint is not a child of execd (pid $execd_pid): entrypoint PPid=$probe"
pass "the baked entrypoint is supervised by execd (entrypoint PPid=$execd_pid)"
- # 5. Subreaper semantics: an orphaned background process reparents to
- # execd (the nearest subreaper ancestor), not to PID 1. The orphan
- # sleeps briefly and is left to exit on its own so assertion 6 can
- # pin the reaping.
+ # 5. The orphan reparents to execd (subreaper); left to exit for #6.
guest_out sh -c 'sleep 6 >/dev/null 2>&1 & echo $! > /tmp/osb-init-mode-orphan.pid' >/dev/null \
|| fail "init-mode: orphan spawn failed: $(head -c 300 "$LOGS_DIR/init-mode-cmd.err" 2>/dev/null)"
probe="$(guest_value ORPHAN_PPID sh -c 'p=$(cat /tmp/osb-init-mode-orphan.pid); echo "ORPHAN_PPID=$(grep "^PPid:" /proc/$p/status | grep -o "[0-9]*")"')" \
@@ -135,27 +106,22 @@ init_mode_verify() { # [template-id]
|| fail "the orphan did not reparent to execd (pid $execd_pid): orphan PPid=$probe"
pass "orphaned processes reparent to execd (subreaper; orphan PPid=$execd_pid)"
- # 6. execd reaps the orphan: once it exits, /proc/<pid> must disappear
- # within the poll budget — a non-reaping parent would keep it as a
- # `Z` child forever (the OSEP-0018 reaper is SIGCHLD-driven with a
- # sweep backstop, so latency is well under the budget).
+ # 6. execd reaps the exited orphan (else it stays a Z child forever).
init_mode_orphan_reaped() {
[[ "$(guest_value REAPED sh -c 'p=$(cat /tmp/osb-init-mode-orphan.pid 2>/dev/null); if [ -n "$p" ] && [ ! -e "/proc/$p" ]; then echo "REAPED=1"; else echo "REAPED=0"; fi')" == "1" ]]
}
wait_for "execd reaps the exited orphan (pid gone from /proc)" 20 init_mode_orphan_reaped
guest_out sh -c 'rm -f /tmp/osb-init-mode-orphan.pid' >/dev/null 2>&1 || true
- # 7. The whole process table ends zombie-free.
+ # 7. No zombies left.
probe="$(guest_value ZOMBIES sh -c 'echo "ZOMBIES=$(ps -eo stat | grep -c "^Z" || true)"')" \
|| fail "init-mode: zombie count probe failed: $(head -c 300 "$LOGS_DIR/init-mode-cmd.err" 2>/dev/null)"
[[ "$probe" == "0" ]] \
|| fail "the guest process table carries zombies: $probe in Z state"
pass "guest process table is zombie-free after the orphan round trip"
- # 8. The capabilities endpoint reports the fsb/Pool init tier: execd owns
- # the process tree as a subreaper; the kernel PID 1 signal shield
- # stays with the fsb guest init.
- local hardening_line hardening
+ # 8. Report: subreaper tier, no signal shield.
+ local hardening_line
hardening_line="$(guest_out curl -fsS http://127.0.0.1:44772/v1/isolated/capabilities 2>/dev/null \
| while IFS= read -r line || [[ -n "$line" ]]; do
printf '%s' "$line" | jq -ce '.hardening // empty' 2>/dev/null && break
diff --git a/server/opensandbox_server/services/templates/template_service.py b/server/opensandbox_server/services/templates/template_service.py
index 058d3c22a..95d47d1a9 100644
--- a/server/opensandbox_server/services/templates/template_service.py
+++ b/server/opensandbox_server/services/templates/template_service.py
@@ -61,13 +61,11 @@ PLURAL = "sandboxtemplates"
# exist in the sandboxtemplate-builder image under this name (builder
# default); execd comes from runtime.execd_image.
TEMPLATE_KERNEL = "vmlinux.bin"
-# OSEP-0018 on fsb: the golden image's guest init sources the baked envs and
-# launches /opt/opensandbox/bootstrap.sh, so a baked EXECD_INIT=1 makes
-# bootstrap.sh exec into `execd --init` and execd becomes the root of the
-# workload tree — a subreaper, since the fsb guest init stays PID 1 (no
-# PID 1 signal shield, same tier as the Kubernetes Pool path). Injected at
-# CRD projection from runtime.execd_run_as_init; the server value wins over
-# a client-provided env of the same name.
+# OSEP-0018 on fsb: the guest init sources the baked envs and launches
+# bootstrap.sh, so a baked EXECD_INIT=1 makes bootstrap.sh exec into
+# `execd --init` — execd runs as a subreaper under the guest init (no PID 1
+# signal shield). Injected at CRD projection from runtime.execd_run_as_init;
+# the server value wins over a client-provided env of the same name.
EXECD_INIT_ENV = "EXECD_INIT"
DEFAULT_VCPU = "1"
DEFAULT_MEMORY = "512Mi"