Skip to content

The only tool you need to know what is happening and how to fix it.

added: bubblewrap for container isolation for playwright runners

narrow-adventure650bf4cf1e27
diff --git a/CLAUDE.md b/CLAUDE.md
index cd289b28..27939900 100644
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@ -269,6 +269,7 @@ OUTBOX_POLL_SECONDS=15 # notification outbox drain interval; mini
# Synthetics (synthetic uptime monitoring: backend/app/synthetics, /synthetics frontend route)
SYNTHETICS_POLL_SECONDS=15 # scheduler tick for due checks; minimum 5, invalid values fall back to 15. The scheduler enqueues due checks into the check_runs queue (main DB, outbox-style guarded claims, advisory lock 824737004) and records expired queued runs as `missed` in telemetry — a probe is never executed late. In-process executors claim http/tcp runs always, browser runs only when mode=embedded.
SYNTHETICS_BROWSER_MODE=off # off | embedded | remote. Browser checks are real @playwright/test specs executed by spawning Node against a harness dir (no npm/npx at runtime; allowlisted env so user scripts never see server secrets). `embedded` requires the :browser image (Dockerfile.browser, DuckDB base + Node + Chromium) and fails fast at startup otherwise; `remote` queues browser runs for traceway-runner binaries that long-poll /api/runners/poll authenticating with SYNTHETICS_RUNNER_SECRET. Hard-blocked in cloud mode (startup panic + 422 at check creation).
+SYNTHETICS_BROWSER_SANDBOX=auto # auto | bwrap | off. Isolation for the Playwright subprocess in embedded mode and in traceway-runner. The env allowlist alone does not contain a spec: node runs as the same uid as its parent, so unconfined it can read the parent's /proc/<pid>/environ (the runner secret), overwrite node_modules in the shared harness to backdoor later runs, and read a sibling run's directory. `bwrap` gives each run its own pid/ipc/uts/user namespace with a fresh /proc, a read-only harness bind with only that run's dir writable, an empty tmpfs over the .runs container so sibling run dirs are hidden (not exposed by the wholesale harness bind), and no /etc beyond DNS/CA/locale (so a secret in the unit file or EnvironmentFile is unreachable); the network namespace stays shared since probes must reach the internet. `auto` uses bubblewrap when the host can and degrades to off with a warning; explicit `bwrap` fails fast at startup instead. Resolved once via browserexec.ResolveSandbox, which probes by running `node --version` through the real bind set.
SYNTHETICS_RUNNER_SECRET= # shared bearer credential for the operator's runner fleet; required for remote mode (fail-fast at startup). Runners are deployment infrastructure, NOT tenant entities: no dashboard CRUD, no per-runner tokens. A runner self-registers a liveness row in synthetic_runners under its X-Traceway-Runner-Name on first poll (upsert throttled to 1/min via an in-memory cache; claim identity is "runner:<name>"). Rotation = change the secret + restart runners. Runner-side env: TRACEWAY_URL, TRACEWAY_RUNNER_SECRET, TRACEWAY_RUNNER_NAME (default hostname), RUNNER_WORKERS (default 2, max 16), and optional TRACEWAY_RUNNER_MONITORING (<project_token>@<url>/api/report) which self-instruments the runner with the Traceway Go SDK: default server metrics, a "browser_run" task trace per executed run (tags check_id/run_id/status, server_name = runner name), and CaptureException on infra failures (start/report errors, per-job panics recovered without killing the worker).
HEALTH_DEEP_TOKEN= # operator bearer secret gating GET /api/health/deep (its payload is instance-wide: cross-tenant queue depth, runner fleet, storage engine stats). Unset = endpoint disabled with a 401 pointing here.
SYNTHETICS_HTTP_CONCURRENCY=8 # concurrent in-process http/tcp probes
diff --git a/Dockerfile.browser b/Dockerfile.browser
index c7a4b210..fd0bd180 100644
--- a/Dockerfile.browser
+++ b/Dockerfile.browser
@@ -74,7 +74,7 @@ RUN npx playwright install chromium --only-shell
# ==============================================================================
FROM debian:bookworm-slim
-RUN apt-get update -o Acquire::Retries=3 -o APT::Update::Error-Mode=any && apt-get install -y --no-install-recommends ca-certificates tzdata wget libstdc++6 && rm -rf /var/lib/apt/lists/*
+RUN apt-get update -o Acquire::Retries=3 -o APT::Update::Error-Mode=any && apt-get install -y --no-install-recommends ca-certificates tzdata wget libstdc++6 bubblewrap && rm -rf /var/lib/apt/lists/*
# Node runtime + the Playwright harness + the downloaded Chromium build.
COPY --from=playwright-builder /usr/local/bin/node /usr/local/bin/node
@@ -101,6 +101,7 @@ ENV GIN_MODE=release \
STORAGE_PATH=/data/storage \
PLAYWRIGHT_BROWSERS_PATH=/opt/ms-playwright \
SYNTHETICS_BROWSER_MODE=embedded \
+ SYNTHETICS_BROWSER_SANDBOX=auto \
SYNTHETICS_PLAYWRIGHT_DIR=/opt/traceway-playwright
EXPOSE 80 8082
diff --git a/Dockerfile.sandboxtest b/Dockerfile.sandboxtest
new file mode 100644
index 00000000..1b2b2091
--- /dev/null
+++ b/Dockerfile.sandboxtest
@@ -0,0 +1,16 @@
+FROM golang:1.26-bookworm
+
+RUN apt-get update && apt-get install -y --no-install-recommends \
+ bubblewrap curl ca-certificates \
+ && rm -rf /var/lib/apt/lists/*
+
+RUN curl -fsSL https://deb.nodesource.com/setup_22.x | bash - \
+ && apt-get install -y --no-install-recommends nodejs \
+ && rm -rf /var/lib/apt/lists/*
+
+WORKDIR /opt/harness
+ENV PLAYWRIGHT_BROWSERS_PATH=/opt/harness/browsers
+RUN npm init -y >/dev/null && npm i @playwright/[email protected]
+RUN npx playwright install --with-deps chromium
+
+WORKDIR /src/backend
diff --git a/backend/app/config/config.go b/backend/app/config/config.go
index 9f8e33c8..4b5e1299 100644
--- a/backend/app/config/config.go
+++ b/backend/app/config/config.go
@@ -59,6 +59,7 @@ type Cfg struct {
SyntheticsPollSeconds string
SyntheticsBrowserMode string
+ SyntheticsBrowserSandbox string
SyntheticsHTTPConcurrency string
SyntheticsBrowserConcurrency string
SyntheticsAllowPrivateTargets string
@@ -188,6 +189,7 @@ func LoadFromEnv() *Cfg {
SyntheticsPollSeconds: os.Getenv("SYNTHETICS_POLL_SECONDS"),
SyntheticsBrowserMode: os.Getenv("SYNTHETICS_BROWSER_MODE"),
+ SyntheticsBrowserSandbox: os.Getenv("SYNTHETICS_BROWSER_SANDBOX"),
SyntheticsHTTPConcurrency: os.Getenv("SYNTHETICS_HTTP_CONCURRENCY"),
SyntheticsBrowserConcurrency: os.Getenv("SYNTHETICS_BROWSER_CONCURRENCY"),
SyntheticsAllowPrivateTargets: os.Getenv("SYNTHETICS_ALLOW_PRIVATE_TARGETS"),
diff --git a/backend/app/controllers/synthetic_check.controller.go b/backend/app/controllers/synthetic_check.controller.go
index b073bce4..2f379686 100644
--- a/backend/app/controllers/synthetic_check.controller.go
+++ b/backend/app/controllers/synthetic_check.controller.go
@@ -12,7 +12,6 @@ import (
"time"
"github.com/gin-gonic/gin"
- "github.com/tracewayapp/traceway/backend/app/config"
"github.com/tracewayapp/traceway/backend/app/db"
"github.com/tracewayapp/traceway/backend/app/middleware"
"github.com/tracewayapp/traceway/backend/app/models"
@@ -39,7 +38,7 @@ var validHttpMethods = map[string]bool{
const maxBrowserScriptBytes = 100 << 10
-const browserModeOffMessage = "Browser checks require SYNTHETICS_BROWSER_MODE=embedded (the :browser image) or a connected remote runner (SYNTHETICS_BROWSER_MODE=remote)."
+const browserModeOffMessage = "This instance is not running in a mode that can execute browser checks. An operator needs to enable SYNTHETICS_BROWSER_MODE=embedded (the :browser image) or connect a runner fleet with SYNTHETICS_BROWSER_MODE=remote. See https://docs.tracewayapp.com/server/runner"
type checkRequest struct {
Name string `json:"name"`
@@ -95,9 +94,6 @@ func validateCheckRequest(req *checkRequest) string {
return "Port must be between 1 and 65535."
}
case models.CheckTypeBrowser:
- if config.Config.CloudMode == "true" {
- return "Browser checks are not available in cloud mode."
- }
var cfg models.BrowserCheckConfig
if err := json.Unmarshal(req.Config, &cfg); err != nil {
return "The check configuration is not valid JSON."
diff --git a/backend/app/synthetics/browserexec/browserexec.go b/backend/app/synthetics/browserexec/browserexec.go
index 57214f07..3963e0b1 100644
--- a/backend/app/synthetics/browserexec/browserexec.go
+++ b/backend/app/synthetics/browserexec/browserexec.go
@@ -31,6 +31,7 @@ type Options struct {
// Timeout bounds the whole run; the per-test Playwright timeout is set
// slightly below it so test failures surface as test errors, not kills.
Timeout time.Duration
+ Sandbox Sandbox
}
type Result struct {
@@ -113,8 +114,23 @@ func Run(ctx context.Context, opts Options) (*Result, error) {
reportPath := filepath.Join(runDir, "report.json")
cli := filepath.Join(opts.HarnessDir, "node_modules", "@playwright", "test", "cli.js")
- cmd := exec.CommandContext(ctx, "node", cli, "test", "--config", configPath)
- cmd.Dir = opts.HarnessDir
+ browsers := browsersPath()
+
+ node, err := exec.LookPath("node")
+ if err != nil {
+ return nil, fmt.Errorf("node is not on PATH: %w", err)
+ }
+ cmd, err := buildCommand(ctx, opts.Sandbox, commandSpec{
+ NodePath: node,
+ CLIPath: cli,
+ ConfigPath: configPath,
+ HarnessDir: opts.HarnessDir,
+ RunDir: runDir,
+ BrowsersPath: browsers,
+ })
+ if err != nil {
+ return nil, err
+ }
// A leaked descendant holding the output pipe (a daemon the user script
// spawned, or Chromium surviving the plain kill on Windows) must not wedge
// this worker forever: force the pipes closed shortly after node exits or
@@ -127,12 +143,6 @@ func Run(ctx context.Context, opts Options) (*Result, error) {
"TMPDIR=" + runDir,
"PLAYWRIGHT_JSON_OUTPUT_NAME=" + reportPath,
}
- // HOME is sandboxed to the run dir, which would also hide Playwright's
- // default per-user browser cache; resolve it from the REAL home first.
- browsers := os.Getenv("PLAYWRIGHT_BROWSERS_PATH")
- if browsers == "" {
- browsers = defaultBrowsersPath()
- }
if browsers != "" {
env = append(env, "PLAYWRIGHT_BROWSERS_PATH="+browsers)
}
@@ -297,6 +307,13 @@ func firstErrorMessage(result jsonTestResult) string {
return "test " + result.Status
}
+func browsersPath() string {
+ if path := os.Getenv("PLAYWRIGHT_BROWSERS_PATH"); path != "" {
+ return path
+ }
+ return defaultBrowsersPath()
+}
+
// defaultBrowsersPath mirrors Playwright's per-OS registry default, needed
// because the subprocess runs with a sandboxed HOME.
func defaultBrowsersPath() string {
diff --git a/backend/app/synthetics/browserexec/sandbox.go b/backend/app/synthetics/browserexec/sandbox.go
new file mode 100644
index 00000000..855bd93c
--- /dev/null
+++ b/backend/app/synthetics/browserexec/sandbox.go
@@ -0,0 +1,159 @@
+package browserexec
+
+import (
+ "context"
+ "fmt"
+ "os"
+ "os/exec"
+ "path/filepath"
+ "runtime"
+ "strings"
+ "time"
+)
+
+type Sandbox string
+
+const (
+ SandboxAuto Sandbox = "auto"
+ SandboxBwrap Sandbox = "bwrap"
+ SandboxOff Sandbox = "off"
+)
+
+const sandboxProbeTimeout = 15 * time.Second
+
+var etcBinds = []string{
+ "/etc/resolv.conf",
+ "/etc/hosts",
+ "/etc/nsswitch.conf",
+ "/etc/localtime",
+ "/etc/ssl",
+ "/etc/pki",
+ "/etc/ca-certificates",
+ "/etc/ca-certificates.conf",
+ "/etc/fonts",
+ "/etc/passwd",
+ "/etc/group",
+ "/etc/machine-id",
+}
+
+var systemBinds = []string{"/usr", "/bin", "/sbin", "/lib", "/lib32", "/lib64"}
+
+func ResolveSandbox(configured string, harnessDir string) (Sandbox, error) {
+ switch Sandbox(strings.ToLower(strings.TrimSpace(configured))) {
+ case SandboxOff:
+ return SandboxOff, nil
+ case SandboxBwrap:
+ if err := probeBwrap(harnessDir); err != nil {
+ return SandboxOff, err
+ }
+ return SandboxBwrap, nil
+ case "", SandboxAuto:
+ if probeBwrap(harnessDir) != nil {
+ return SandboxOff, nil
+ }
+ return SandboxBwrap, nil
+ default:
+ return SandboxOff, fmt.Errorf("unknown sandbox %q: expected auto, bwrap, or off", configured)
+ }
+}
+
+func probeBwrap(harnessDir string) error {
+ if runtime.GOOS != "linux" {
+ return fmt.Errorf("bubblewrap is Linux-only (this host is %s)", runtime.GOOS)
+ }
+ bwrap, err := exec.LookPath("bwrap")
+ if err != nil {
+ return fmt.Errorf("bubblewrap (bwrap) is not on PATH: %w", err)
+ }
+ node, err := exec.LookPath("node")
+ if err != nil {
+ return fmt.Errorf("node is not on PATH: %w", err)
+ }
+ // Probe from under .runs, the same container real runs use, so the probe
+ // exercises the sibling-hiding tmpfs too.
+ runsDir := filepath.Join(harnessDir, ".runs")
+ if err := os.MkdirAll(runsDir, 0o755); err != nil {
+ return fmt.Errorf("failed to create the runs dir in the harness: %w", err)
+ }
+ probeDir, err := os.MkdirTemp(runsDir, ".probe-*")
+ if err != nil {
+ return fmt.Errorf("failed to create a probe dir in the harness: %w", err)
+ }
+ defer os.RemoveAll(probeDir)
+
+ ctx, cancel := context.WithTimeout(context.Background(), sandboxProbeTimeout)
+ defer cancel()
+
+ args := append(bwrapArgs(commandSpec{
+ NodePath: node,
+ HarnessDir: harnessDir,
+ RunDir: probeDir,
+ BrowsersPath: browsersPath(),
+ }), node, "--version")
+ output, err := exec.CommandContext(ctx, bwrap, args...).CombinedOutput()
+ if err != nil {
+ return fmt.Errorf("the bubblewrap probe failed (%v): %s", err, firstOutputLines(string(output), 3))
+ }
+ return nil
+}
+
+type commandSpec struct {
+ NodePath string
+ CLIPath string
+ ConfigPath string
+ HarnessDir string
+ RunDir string
+ BrowsersPath string
+}
+
+func buildCommand(ctx context.Context, sandbox Sandbox, spec commandSpec) (*exec.Cmd, error) {
+ if sandbox != SandboxBwrap {
+ cmd := exec.CommandContext(ctx, spec.NodePath, spec.CLIPath, "test", "--config", spec.ConfigPath)
+ cmd.Dir = spec.HarnessDir
+ return cmd, nil
+ }
+ bwrap, err := exec.LookPath("bwrap")
+ if err != nil {
+ return nil, fmt.Errorf("bubblewrap (bwrap) is not on PATH: %w", err)
+ }
+ args := append(bwrapArgs(spec), spec.NodePath, spec.CLIPath, "test", "--config", spec.ConfigPath)
+ return exec.CommandContext(ctx, bwrap, args...), nil
+}
+
+func bwrapArgs(spec commandSpec) []string {
+ args := []string{
+ "--die-with-parent",
+ "--new-session",
+ "--unshare-user",
+ "--unshare-pid",
+ "--unshare-ipc",
+ "--unshare-uts",
+ "--unshare-cgroup-try",
+ "--proc", "/proc",
+ "--dev", "/dev",
+ "--tmpfs", "/tmp",
+ "--tmpfs", "/dev/shm",
+ }
+ for _, dir := range systemBinds {
+ args = append(args, "--ro-bind-try", dir, dir)
+ }
+ args = append(args, "--ro-bind-try", "/sys", "/sys")
+ for _, path := range etcBinds {
+ args = append(args, "--ro-bind-try", path, path)
+ }
+ if dir := filepath.Dir(spec.NodePath); dir != "" && dir != "." && dir != "/" {
+ args = append(args, "--ro-bind-try", dir, dir)
+ }
+ args = append(args, "--ro-bind", spec.HarnessDir, spec.HarnessDir)
+ if spec.BrowsersPath != "" {
+ args = append(args, "--ro-bind-try", spec.BrowsersPath, spec.BrowsersPath)
+ }
+ // The read-only harness bind also exposes concurrent sibling run dirs
+ // under .runs. Overlay that container with an empty tmpfs, then bind back
+ // only this run's dir. node_modules is above the container, so resolution
+ // still works. Removing this line silently reintroduces a cross-run leak.
+ args = append(args, "--tmpfs", filepath.Dir(spec.RunDir))
+ args = append(args, "--bind", spec.RunDir, spec.RunDir)
+ args = append(args, "--chdir", spec.RunDir)
+ return args
+}
diff --git a/backend/app/synthetics/browserexec/sandbox_live_test.go b/backend/app/synthetics/browserexec/sandbox_live_test.go
new file mode 100644
index 00000000..6ebdf05a
--- /dev/null
+++ b/backend/app/synthetics/browserexec/sandbox_live_test.go
@@ -0,0 +1,240 @@
+package browserexec
+
+import (
+ "context"
+ "net/http"
+ "net/http/httptest"
+ "os"
+ "os/exec"
+ "path/filepath"
+ "testing"
+ "time"
+)
+
+const (
+ sentinelPrefix = "traceway-sentinel-"
+ sentinelSuffix = "8f3a1c2e"
+)
+
+func TestSandboxLive(t *testing.T) {
+ harness := os.Getenv("TRACEWAY_BROWSEREXEC_LIVE_HARNESS")
+ if harness == "" {
+ t.Skip("TRACEWAY_BROWSEREXEC_LIVE_HARNESS not set")
+ }
+ if err := Validate(harness); err != nil {
+ t.Fatalf("harness invalid: %v", err)
+ }
+ sandbox, err := ResolveSandbox("bwrap", harness)
+ if err != nil {
+ t.Skipf("this host cannot sandbox: %v", err)
+ }
+ if sandbox != SandboxBwrap {
+ t.Fatalf("expected bwrap, got %q", sandbox)
+ }
+
+ server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
+ w.Header().Set("Content-Type", "text/html")
+ w.Write([]byte(`<html><head><title>Traceway Sandbox</title></head><body><h1 id="msg">sandboxed</h1></body></html>`))
+ }))
+ defer server.Close()
+
+ t.Run("a real spec runs inside the sandbox", func(t *testing.T) {
+ script := `import { test, expect } from '@playwright/test';
+
+test('page loads', async ({ page }) => {
+ await page.goto(process.env.TARGET_URL!);
+ await expect(page).toHaveTitle(/Traceway Sandbox/);
+ await expect(page.locator('#msg')).toContainText('sandboxed');
+});
+`
+ result, err := Run(context.Background(), Options{
+ HarnessDir: harness,
+ Script: script,
+ Env: map[string]string{"TARGET_URL": server.URL},
+ Timeout: 90 * time.Second,
+ Sandbox: SandboxBwrap,
+ })
+ if err != nil {
+ t.Fatalf("run: %v", err)
+ }
+ if !result.Passed {
+ t.Fatalf("Chromium could not run under the sandbox, the bind set is probably incomplete: %q\noutput: %s", result.ErrorMsg, result.Output)
+ }
+ })
+
+ const scanScript = `import { test, expect } from '@playwright/test';
+import * as fs from 'fs';
+
+test('parent environment', async () => {
+ const sentinel = process.env.SENTINEL_A! + process.env.SENTINEL_B!;
+ let found = false;
+ for (const name of fs.readdirSync('/proc')) {
+ if (!/^\d+$/.test(name)) continue;
+ try {
+ if (fs.readFileSync('/proc/' + name + '/environ', 'utf8').includes(sentinel)) {
+ found = true;
+ break;
+ }
+ } catch { /* not readable, keep going */ }
+ }
+ expect(found).toBe(process.env.EXPECT_FOUND === 'true');
+});
+`
+
+ scanEnv := func(expectFound string) map[string]string {
+ return map[string]string{
+ "SENTINEL_A": sentinelPrefix,
+ "SENTINEL_B": sentinelSuffix,
+ "EXPECT_FOUND": expectFound,
+ }
+ }
+
+ holder := exec.Command("sleep", "120")
+ holder.Env = []string{"TRACEWAY_SENTINEL=" + sentinelPrefix + sentinelSuffix}
+ if err := holder.Start(); err != nil {
+ t.Fatalf("failed to start the sentinel holder: %v", err)
+ }
+ defer func() {
+ holder.Process.Kill()
+ holder.Wait()
+ }()
+
+ t.Run("the scan detects a leak when unconfined", func(t *testing.T) {
+ result, err := Run(context.Background(), Options{
+ HarnessDir: harness,
+ Script: scanScript,
+ Env: scanEnv("true"),
+ Timeout: 90 * time.Second,
+ Sandbox: SandboxOff,
+ })
+ if err != nil {
+ t.Fatalf("run: %v", err)
+ }
+ if !result.Passed {
+ t.Fatalf("the scan could not observe the sentinel even unconfined, so it cannot prove the sandbox works: %q", result.ErrorMsg)
+ }
+ })
+
+ t.Run("the parent environment is unreachable when sandboxed", func(t *testing.T) {
+ result, err := Run(context.Background(), Options{
+ HarnessDir: harness,
+ Script: scanScript,
+ Env: scanEnv("false"),
+ Timeout: 90 * time.Second,
+ Sandbox: SandboxBwrap,
+ })
+ if err != nil {
+ t.Fatalf("run: %v", err)
+ }
+ if !result.Passed {
+ t.Fatalf("a sandboxed spec could still read the parent environment: %q", result.ErrorMsg)
+ }
+ })
+
+ t.Run("the harness cannot be poisoned", func(t *testing.T) {
+ probe := filepath.Join(harness, "node_modules", ".traceway-poison-probe")
+ defer os.Remove(probe)
+
+ script := `import { test, expect } from '@playwright/test';
+import * as fs from 'fs';
+
+test('harness is read-only', async () => {
+ let blocked = false;
+ try {
+ fs.writeFileSync(process.env.PROBE_PATH!, 'poisoned');
+ } catch {
+ blocked = true;
+ }
+ expect(blocked).toBe(true);
+});
+`
+ result, err := Run(context.Background(), Options{
+ HarnessDir: harness,
+ Script: script,
+ Env: map[string]string{"PROBE_PATH": probe},
+ Timeout: 90 * time.Second,
+ Sandbox: SandboxBwrap,
+ })
+ if err != nil {
+ t.Fatalf("run: %v", err)
+ }
+ if !result.Passed {
+ t.Fatalf("a sandboxed spec could write into the shared harness: %q", result.ErrorMsg)
+ }
+ if _, err := os.Stat(probe); err == nil {
+ t.Fatal("the poison probe reached the harness on disk")
+ }
+ })
+
+ t.Run("a sibling run dir is unreadable", func(t *testing.T) {
+ // Plant a sibling run dir with a secret next to where this run's dir
+ // will be created, exactly as a concurrent check would.
+ runsDir := filepath.Join(harness, ".runs")
+ if err := os.MkdirAll(runsDir, 0o755); err != nil {
+ t.Fatalf("failed to create the runs dir: %v", err)
+ }
+ sibling, err := os.MkdirTemp(runsDir, "sibling-*")
+ if err != nil {
+ t.Fatalf("failed to create the sibling run dir: %v", err)
+ }
+ defer os.RemoveAll(sibling)
+ secret := sentinelPrefix + "sibling-" + sentinelSuffix
+ if err := os.WriteFile(filepath.Join(sibling, "creds.txt"), []byte(secret), 0o600); err != nil {
+ t.Fatalf("failed to write the sibling secret: %v", err)
+ }
+
+ script := `import { test, expect } from '@playwright/test';
+import * as fs from 'fs';
+import * as path from 'path';
+
+test('sibling run dirs are hidden', async () => {
+ const runs = path.dirname(process.cwd());
+ const own = path.basename(process.cwd());
+ const siblings = fs.readdirSync(runs).filter((e) => e !== own);
+ let leaked = '';
+ for (const e of siblings) {
+ try { leaked += fs.readFileSync(path.join(runs, e, 'creds.txt'), 'utf8'); } catch { /* expected: not present */ }
+ }
+ expect(siblings).toHaveLength(0);
+ expect(leaked).toBe('');
+});
+`
+ result, err := Run(context.Background(), Options{
+ HarnessDir: harness,
+ Script: script,
+ Timeout: 90 * time.Second,
+ Sandbox: SandboxBwrap,
+ })
+ if err != nil {
+ t.Fatalf("run: %v", err)
+ }
+ if !result.Passed {
+ t.Fatalf("a sandboxed run could see or read a sibling run dir: %q\noutput: %s", result.ErrorMsg, result.Output)
+ }
+ })
+
+ t.Run("the run dir stays writable", func(t *testing.T) {
+ script := `import { test, expect } from '@playwright/test';
+import * as fs from 'fs';
+import * as path from 'path';
+
+test('scratch writes work', async () => {
+ const file = path.join(process.cwd(), 'scratch.txt');
+ fs.writeFileSync(file, 'ok');
+ expect(fs.readFileSync(file, 'utf8')).toBe('ok');
+});
+`
+ result, err := Run(context.Background(), Options{
+ HarnessDir: harness,
+ Script: script,
+ Timeout: 90 * time.Second,
+ Sandbox: SandboxBwrap,
+ })
+ if err != nil {
+ t.Fatalf("run: %v", err)
+ }
+ if !result.Passed {
+ t.Fatalf("the run dir is not writable inside the sandbox: %q", result.ErrorMsg)
+ }
+ })
+}
diff --git a/backend/app/synthetics/browserexec/sandbox_test.go b/backend/app/synthetics/browserexec/sandbox_test.go
new file mode 100644
index 00000000..3d7c87de
--- /dev/null
+++ b/backend/app/synthetics/browserexec/sandbox_test.go
@@ -0,0 +1,169 @@
+package browserexec
+
+import (
+ "context"
+ "slices"
+ "strings"
+ "testing"
+)
+
+func testSpec() commandSpec {
+ return commandSpec{
+ NodePath: "/usr/local/bin/node",
+ CLIPath: "/opt/harness/node_modules/@playwright/test/cli.js",
+ ConfigPath: "/opt/harness/.runs/run-1/traceway.config.cjs",
+ HarnessDir: "/opt/harness",
+ RunDir: "/opt/harness/.runs/run-1",
+ BrowsersPath: "/opt/ms-playwright",
+ }
+}
+
+func indexOfBind(args []string, op, src string) int {
+ for i := 0; i+2 < len(args); i++ {
+ if args[i] == op && args[i+1] == src && args[i+2] == src {
+ return i
+ }
+ }
+ return -1
+}
+
+func indexOfSingle(args []string, op, val string) int {
+ for i := 0; i+1 < len(args); i++ {
+ if args[i] == op && args[i+1] == val {
+ return i
+ }
+ }
+ return -1
+}
+
+func TestBwrapArgsBindsHarnessReadOnlyBeforeRunDir(t *testing.T) {
+ args := bwrapArgs(testSpec())
+
+ harness := indexOfBind(args, "--ro-bind", "/opt/harness")
+ if harness < 0 {
+ t.Fatalf("the harness is not bound read-only: %v", args)
+ }
+ runDir := indexOfBind(args, "--bind", "/opt/harness/.runs/run-1")
+ if runDir < 0 {
+ t.Fatalf("the run dir is not bound writable: %v", args)
+ }
+ if harness > runDir {
+ t.Fatalf("the read-only harness bind must precede the run dir bind, got %d and %d", harness, runDir)
+ }
+ if indexOfBind(args, "--bind", "/opt/harness") >= 0 {
+ t.Fatal("the harness must never be bound writable: a spec could poison node_modules for the next tenant")
+ }
+}
+
+func TestBwrapArgsHidesSiblingRunDirsWithTmpfs(t *testing.T) {
+ args := bwrapArgs(testSpec())
+
+ // testSpec's run dir is /opt/harness/.runs/run-1, so its container is
+ // /opt/harness/.runs. That container must be overlaid with an empty tmpfs
+ // so a concurrent sibling run dir under it is not exposed by the harness
+ // read-only bind.
+ tmpfs := indexOfSingle(args, "--tmpfs", "/opt/harness/.runs")
+ if tmpfs < 0 {
+ t.Fatalf("the run-dir container must be overlaid with a tmpfs to hide sibling runs: %v", args)
+ }
+ harness := indexOfBind(args, "--ro-bind", "/opt/harness")
+ runDir := indexOfBind(args, "--bind", "/opt/harness/.runs/run-1")
+ if harness < 0 || runDir < 0 {
+ t.Fatalf("expected both the harness ro-bind and the run-dir bind: %v", args)
+ }
+ if !(harness < tmpfs && tmpfs < runDir) {
+ t.Fatalf("the tmpfs must come after the harness ro-bind and before the run-dir bind, got harness=%d tmpfs=%d runDir=%d", harness, tmpfs, runDir)
+ }
+ // The tmpfs must never land on the harness root itself: that would bury
+ // node_modules and break module resolution.
+ if indexOfSingle(args, "--tmpfs", "/opt/harness") >= 0 {
+ t.Fatal("the harness root must never be overlaid with a tmpfs: it holds node_modules")
+ }
+}
+
+func TestBwrapArgsNeverBindsEtcWholesale(t *testing.T) {
+ args := bwrapArgs(testSpec())
+
+ for _, op := range []string{"--bind", "--ro-bind", "--ro-bind-try", "--dev-bind"} {
+ if indexOfBind(args, op, "/etc") >= 0 {
+ t.Fatalf("%s /etc exposes the unit file and EnvironmentFile holding the runner secret", op)
+ }
+ }
+ if indexOfBind(args, "--ro-bind-try", "/etc/resolv.conf") < 0 {
+ t.Fatal("DNS resolution needs /etc/resolv.conf bound")
+ }
+}
+
+func TestBwrapArgsIsolatesProcessesAndKeepsNetwork(t *testing.T) {
+ args := bwrapArgs(testSpec())
+
+ if !slices.Contains(args, "--unshare-pid") {
+ t.Error("expected --unshare-pid")
+ }
+ if indexOfBind(args, "--proc", "/proc") < 0 && !slices.Contains(args, "--proc") {
+ t.Error("expected a fresh /proc")
+ }
+ if !slices.Contains(args, "--die-with-parent") {
+ t.Error("expected --die-with-parent so a killed run leaves nothing behind")
+ }
+ if slices.Contains(args, "--unshare-net") {
+ t.Error("the network namespace must stay shared")
+ }
+}
+
+func TestBwrapArgsBindsNodeAndBrowsers(t *testing.T) {
+ args := bwrapArgs(testSpec())
+
+ if indexOfBind(args, "--ro-bind-try", "/usr/local/bin") < 0 {
+ t.Error("node's directory must be bound: it is often outside the system dirs")
+ }
+ if indexOfBind(args, "--ro-bind-try", "/opt/ms-playwright") < 0 {
+ t.Error("the browser registry must be bound, HOME is sandboxed away from it")
+ }
+}
+
+func TestBuildCommandOffSpawnsNodeDirectly(t *testing.T) {
+ spec := testSpec()
+ cmd, err := buildCommand(context.Background(), SandboxOff, spec)
+ if err != nil {
+ t.Fatalf("build: %v", err)
+ }
+ if cmd.Path != spec.NodePath {
+ t.Errorf("expected node to be spawned directly, got %q", cmd.Path)
+ }
+ if cmd.Dir != spec.HarnessDir {
+ t.Errorf("expected the harness as cwd, got %q", cmd.Dir)
+ }
+ if !slices.Contains(cmd.Args, spec.ConfigPath) {
+ t.Errorf("expected the generated config in the argv, got %v", cmd.Args)
+ }
+}
+
+func TestResolveSandboxOff(t *testing.T) {
+ sandbox, err := ResolveSandbox("off", t.TempDir())
+ if err != nil {
+ t.Fatalf("resolve: %v", err)
+ }
+ if sandbox != SandboxOff {
+ t.Errorf("expected off, got %q", sandbox)
+ }
+}
+
+func TestResolveSandboxUnknownValue(t *testing.T) {
+ _, err := ResolveSandbox("docker", t.TempDir())
+ if err == nil {
+ t.Fatal("expected an error for an unknown sandbox")
+ }
+ if !strings.Contains(err.Error(), "auto, bwrap, or off") {
+ t.Errorf("expected the error to list the valid modes, got %q", err)
+ }
+}
+
+func TestResolveSandboxAutoNeverErrors(t *testing.T) {
+ if _, err := ResolveSandbox("", t.TempDir()); err != nil {
+ t.Fatalf("empty: %v", err)
+ }
+ if _, err := ResolveSandbox("auto", t.TempDir()); err != nil {
+ t.Fatalf("auto: %v", err)
+ }
+}
diff --git a/backend/app/synthetics/runner_browser.go b/backend/app/synthetics/runner_browser.go
index 483bab0d..6d7c86c5 100644
--- a/backend/app/synthetics/runner_browser.go
+++ b/backend/app/synthetics/runner_browser.go
@@ -42,6 +42,7 @@ func probeBrowser(ctx context.Context, check *models.SyntheticCheck) Outcome {
Script: cfg.Script,
Env: cfg.Env,
Timeout: EffectiveTimeout(check),
+ Sandbox: BrowserSandbox(),
})
if err != nil {
outcome.LatencyMs = float64(time.Since(started).Microseconds()) / 1000
diff --git a/backend/app/synthetics/scheduler.go b/backend/app/synthetics/scheduler.go
index 584db996..79f27e11 100644
--- a/backend/app/synthetics/scheduler.go
+++ b/backend/app/synthetics/scheduler.go
@@ -20,10 +20,8 @@ var missedTotal uint64
// Start runs the scheduler and the in-process executor.
func Start(ctx context.Context) {
- // Browser checks are arbitrary code execution on the server; they must be
- // impossible to enable in cloud mode.
- if config.Config.CloudMode == "true" && BrowserMode() != BrowserModeOff {
- panic("SYNTHETICS_BROWSER_MODE must be off in cloud mode: browser checks execute user-authored scripts on the server")
+ if config.Config.CloudMode == "true" && BrowserMode() == BrowserModeEmbedded {
+ panic("SYNTHETICS_BROWSER_MODE=embedded is not allowed in cloud mode: browser checks would execute user-authored scripts on the API host. Use SYNTHETICS_BROWSER_MODE=remote with a runner fleet")
}
// Fail fast instead of failing every browser run: embedded mode is only
// meaningful with the Node harness present (the :browser image).
@@ -31,13 +29,18 @@ func Start(ctx context.Context) {
if err := browserexec.Validate(PlaywrightDir()); err != nil {
panic(fmt.Sprintf("SYNTHETICS_BROWSER_MODE=embedded but the Playwright harness is unusable (%v); use the ghcr.io/tracewayapp/traceway:browser image or point SYNTHETICS_PLAYWRIGHT_DIR at a directory with @playwright/test installed", err))
}
+ sandbox, err := browserexec.ResolveSandbox(config.Config.SyntheticsBrowserSandbox, PlaywrightDir())
+ if err != nil {
+ panic(fmt.Sprintf("SYNTHETICS_BROWSER_SANDBOX=%s is unusable: %v; install bubblewrap or set SYNTHETICS_BROWSER_SANDBOX=off to accept unconfined check scripts", config.Config.SyntheticsBrowserSandbox, err))
+ }
+ browserSandbox = sandbox
}
// Same fail-fast principle for remote mode: without the shared secret no
// runner can ever authenticate, so every browser run would expire missed.
if BrowserMode() == BrowserModeRemote && config.Config.SyntheticsRunnerSecret == "" {
panic("SYNTHETICS_BROWSER_MODE=remote requires SYNTHETICS_RUNNER_SECRET so runners can authenticate")
}
- config.Logf("Starting synthetics scheduler (interval: %s, browser mode: %s)", pollInterval(), BrowserMode())
+ config.Logf("Starting synthetics scheduler (interval: %s, browser mode: %s, sandbox: %s)", pollInterval(), BrowserMode(), BrowserSandbox())
go func() {
defer traceway.Recover()
diff --git a/backend/app/synthetics/synthetics.go b/backend/app/synthetics/synthetics.go
index 193a85ad..92bd36d3 100644
--- a/backend/app/synthetics/synthetics.go
+++ b/backend/app/synthetics/synthetics.go
@@ -16,6 +16,7 @@ import (
"github.com/tracewayapp/traceway/backend/app/config"
"github.com/tracewayapp/traceway/backend/app/models"
+ "github.com/tracewayapp/traceway/backend/app/synthetics/browserexec"
)
const (
@@ -50,6 +51,12 @@ func pollInterval() time.Duration {
return config.PollSeconds(config.Config.SyntheticsPollSeconds, 15)
}
+var browserSandbox = browserexec.SandboxOff
+
+func BrowserSandbox() browserexec.Sandbox {
+ return browserSandbox
+}
+
// BrowserMode returns the validated SYNTHETICS_BROWSER_MODE, defaulting to off.
func BrowserMode() string {
switch config.Config.SyntheticsBrowserMode {
diff --git a/backend/cmd/run.go b/backend/cmd/run.go
index 6f34d064..e65954a9 100644
--- a/backend/cmd/run.go
+++ b/backend/cmd/run.go
@@ -308,6 +308,7 @@ func applyEnvOverrides(cfg *config.Cfg) {
{"OUTBOX_POLL_SECONDS", &cfg.OutboxPollSeconds},
{"SYNTHETICS_POLL_SECONDS", &cfg.SyntheticsPollSeconds},
{"SYNTHETICS_BROWSER_MODE", &cfg.SyntheticsBrowserMode},
+ {"SYNTHETICS_BROWSER_SANDBOX", &cfg.SyntheticsBrowserSandbox},
{"SYNTHETICS_HTTP_CONCURRENCY", &cfg.SyntheticsHTTPConcurrency},
{"SYNTHETICS_BROWSER_CONCURRENCY", &cfg.SyntheticsBrowserConcurrency},
{"SYNTHETICS_ALLOW_PRIVATE_TARGETS", &cfg.SyntheticsAllowPrivateTargets},
diff --git a/backend/cmd/traceway-runner/main.go b/backend/cmd/traceway-runner/main.go
index d1a95671..417f5393 100644
--- a/backend/cmd/traceway-runner/main.go
+++ b/backend/cmd/traceway-runner/main.go
@@ -20,6 +20,7 @@
// exceptions for infrastructure failures.
// RUNNER_WORKERS concurrent browser runs (default 2)
// SYNTHETICS_PLAYWRIGHT_DIR harness dir with @playwright/test (default .)
+// SYNTHETICS_BROWSER_SANDBOX auto (default) | bwrap | off
//
// Harness setup (once): npm init -y && npm i @playwright/test && npx playwright install chromium
package main
@@ -49,12 +50,14 @@ import (
const version = "1.0.0"
type runnerConfig struct {
- baseURL string
- secret string
- name string
- monitoring string
- workers int
- harnessDir string
+ baseURL string
+ secret string
+ name string
+ monitoring string
+ workers int
+ harnessDir string
+ sandbox string
+ resolvedSandbox browserexec.Sandbox
}
type job struct {
@@ -70,6 +73,14 @@ func main() {
if err := browserexec.Validate(cfg.harnessDir); err != nil {
log.Fatalf("Playwright harness unusable at %s: %v\nSet it up with:\n npm init -y && npm i @playwright/test && npx playwright install chromium\nor point SYNTHETICS_PLAYWRIGHT_DIR at an existing harness.", cfg.harnessDir, err)
}
+ sandbox, err := browserexec.ResolveSandbox(cfg.sandbox, cfg.harnessDir)
+ if err != nil {
+ log.Fatalf("SYNTHETICS_BROWSER_SANDBOX=%s is unusable: %v\nInstall bubblewrap (apt install bubblewrap / dnf install bubblewrap), or set SYNTHETICS_BROWSER_SANDBOX=off to accept unconfined check scripts.", cfg.sandbox, err)
+ }
+ cfg.resolvedSandbox = sandbox
+ if sandbox == browserexec.SandboxOff {
+ log.Print("WARNING: check scripts run unconfined. They can read this host's filesystem and process table, including this runner's own secret, and they can see each other's runs. Install bubblewrap and set SYNTHETICS_BROWSER_SANDBOX=bwrap before pointing this runner at a shared instance.")
+ }
ctx, stop := signal.NotifyContext(context.Background(), os.Interrupt, syscall.SIGTERM)
defer stop()
@@ -85,7 +96,7 @@ func main() {
}
}
- log.Printf("traceway-runner %s (%s): polling %s (workers: %d, harness: %s)", version, cfg.name, cfg.baseURL, cfg.workers, cfg.harnessDir)
+ log.Printf("traceway-runner %s (%s): polling %s (workers: %d, harness: %s, sandbox: %s)", version, cfg.name, cfg.baseURL, cfg.workers, cfg.harnessDir, cfg.resolvedSandbox)
jobs := make(chan job)
var wg sync.WaitGroup
@@ -113,6 +124,7 @@ func loadConfig() runnerConfig {
monitoring: strings.TrimSpace(os.Getenv("TRACEWAY_RUNNER_MONITORING")),
workers: 2,
harnessDir: os.Getenv("SYNTHETICS_PLAYWRIGHT_DIR"),
+ sandbox: os.Getenv("SYNTHETICS_BROWSER_SANDBOX"),
}
if cfg.baseURL == "" || cfg.secret == "" {
log.Fatal("TRACEWAY_URL and TRACEWAY_RUNNER_SECRET are required (the secret must match the server's SYNTHETICS_RUNNER_SECRET)")
@@ -223,6 +235,7 @@ func execute(ctx context.Context, cfg runnerConfig, j job) {
Script: j.Script,
Env: j.Env,
Timeout: timeout,
+ Sandbox: cfg.resolvedSandbox,
})
payload := map[string]any{"status": "down", "latencyMs": float64(time.Since(started).Microseconds()) / 1000}
diff --git a/docs/pages/server/browser.mdx b/docs/pages/server/browser.mdx
index 56d42ec5..253f7e8e 100644
--- a/docs/pages/server/browser.mdx
+++ b/docs/pages/server/browser.mdx
@@ -10,6 +10,7 @@ Operational notes on top of the DuckDB image:
- **Chromium needs shared memory.** Docker's default 64MB `/dev/shm` crashes tabs on heavier pages; run with `--shm-size=1g` (the compose file sets it). The backend also passes `--disable-dev-shm-usage` as a fallback.
- **Leave memory headroom.** Each concurrent browser check runs a Chromium instance (roughly 300 to 500MB); `SYNTHETICS_BROWSER_CONCURRENCY` defaults to 2. Budget `DUCKDB_MEMORY_LIMIT` accordingly.
- **Browser checks execute user-authored scripts** inside this container, as root with Chromium's sandbox off (the standard containerized-Playwright trade-off). Anyone with write access to a project can author them; if that trust model does not fit, use `remote` mode instead.
+- **The bubblewrap sandbox usually cannot start inside Docker.** The image ships `bubblewrap` and `SYNTHETICS_BROWSER_SANDBOX=auto`, but creating a user namespace inside a container is the host's decision, not the image's. Measured on Docker with an Ubuntu 24.04 host kernel, it is refused under the default security options, under `--security-opt seccomp=unconfined`, and under `--cap-add SYS_ADMIN`. It works only with `--privileged` **and** `sysctl -w kernel.apparmor_restrict_unprivileged_userns=0` on the host. Expect `sandbox: off` in the startup log on a normal Docker host, which is the same isolation this image has always had: the container boundary and the env allowlist. Check the log line if you care which one you got. When check authors are not fully trusted, `remote` mode on a dedicated host is the configuration that actually sandboxes.
## Quick Start
diff --git a/docs/pages/server/runner.mdx b/docs/pages/server/runner.mdx
index 5d3fa473..46cdb7c5 100644
--- a/docs/pages/server/runner.mdx
+++ b/docs/pages/server/runner.mdx
@@ -20,7 +20,7 @@ Runners are deployment infrastructure, not dashboard entities. There is nothing
- A runner self-registers a liveness row under its `TRACEWAY_RUNNER_NAME` (defaults to the hostname) on first poll. The name is also its claim identity, so give each runner a unique name.
- Traffic is outbound only. The runner long-polls the server (each poll is held up to 25 seconds), so it works behind NAT with no inbound ports and no firewall changes.
- Rotation: change the secret on the server, restart it, update the runners, restart them. A runner presenting a stale secret exits immediately with a clear error.
-- The runner receives only the check script and the env vars configured on that check. Scripts run with an allowlisted environment, so they can never read the server's env or the runner's own secret.
+- The runner receives only the check script and the env vars configured on that check. Scripts run with an allowlisted environment, so they never inherit the server's env or the runner's own. Everything else about what a script can reach depends on the sandbox below.
- If a runner dies mid-run, the server reclaims the stale run after 5 minutes. An expired run is recorded as `missed`, never executed late.
## 1. Enable remote mode on the server
@@ -54,6 +54,16 @@ PLAYWRIGHT_BROWSERS_PATH=/opt/traceway-runner/browsers npx playwright install --
`--with-deps` installs Chromium's system libraries on apt-based distros (Ubuntu, Debian). On Amazon Linux or other rpm-based distros, run `npx playwright install chromium` and install the shared libraries with your package manager instead.
+**Install bubblewrap.** Check scripts are code someone else wrote, and the env allowlist alone does not contain them. Without a sandbox, node runs as the same user as the runner, which means a script can read the runner's own `/proc/<pid>/environ` and recover the shared secret, overwrite `@playwright/test` in the harness to backdoor every later run, and read the run directory of a check executing beside it. On a fleet serving more than one team, all three are cross-tenant leaks.
+
+```bash
+sudo apt install bubblewrap # or: sudo dnf install bubblewrap
+```
+
+Then set `SYNTHETICS_BROWSER_SANDBOX=bwrap`. Each run gets its own pid, ipc, uts and user namespace with a fresh `/proc`, so the runner's process table and environment are not merely unreadable, they are absent. The harness is bind-mounted read-only and only that run's directory is writable, so poisoning fails with `EROFS`. The other runs' scratch directories are masked behind an empty overlay, so a run cannot read what a check working beside it downloaded or captured. Nothing under `/etc` is mounted except DNS, CA certificates and locale data, so a secret in the unit file or an `EnvironmentFile` is out of reach. The network namespace is deliberately shared, since probes exist to reach the internet.
+
+The default is `auto`, which uses bubblewrap when the host can run it and falls back to unconfined with a startup warning. Set `bwrap` explicitly in production: a host whose kernel forbids unprivileged user namespaces then fails at startup instead of quietly running scripts unconfined. The runner probes the sandbox at boot by executing `node --version` through the real bind set, so a broken host is caught before the first check.
+
## 3. Run it as a service
Run the binary under a dedicated non-root user: it executes user-authored scripts. A systemd unit:
@@ -73,6 +83,7 @@ Environment=TRACEWAY_RUNNER_NAME=prod-runner-1
Environment=RUNNER_WORKERS=2
Environment=SYNTHETICS_PLAYWRIGHT_DIR=/opt/traceway-runner
Environment=PLAYWRIGHT_BROWSERS_PATH=/opt/traceway-runner/browsers
+Environment=SYNTHETICS_BROWSER_SANDBOX=bwrap
Restart=always
RestartSec=5
@@ -93,6 +104,7 @@ Shutdown is graceful: on SIGTERM the runner stops polling, lets in-flight runs f
| `TRACEWAY_RUNNER_NAME` | hostname | Unique name; the runner registers and claims runs under it. |
| `RUNNER_WORKERS` | `2` | Concurrent browser runs (max 16). |
| `SYNTHETICS_PLAYWRIGHT_DIR` | `.` | Harness dir containing `node_modules/@playwright/test`. |
+| `SYNTHETICS_BROWSER_SANDBOX` | `auto` | `auto`, `bwrap` or `off`. Isolates each spec in a bubblewrap namespace. Set `bwrap` on any fleet serving more than one team. |
| `TRACEWAY_RUNNER_MONITORING` | unset | Optional `<project_token>@<url>/api/report`. The runner then reports its own CPU/memory metrics, one `browser_run` task per executed check, and exceptions for infra failures. |
## 4. Verify
diff --git a/frontend/src/routes/monitors/monitor-sheet.svelte b/frontend/src/routes/monitors/monitor-sheet.svelte
index a644320b..9bff7e17 100644
--- a/frontend/src/routes/monitors/monitor-sheet.svelte
+++ b/frontend/src/routes/monitors/monitor-sheet.svelte
@@ -70,12 +70,10 @@
let browserScript = $state('');
let envRows = $state<{ key: string; value: string }[]>([]);
- // Browser checks execute user scripts server-side and are hard-blocked in
- // cloud mode, so the cloud build does not offer the type at all.
const checkTypeOptions = [
{ value: 'http', label: 'HTTP' },
{ value: 'tcp', label: 'TCP' },
- ...(__CLOUD_MODE__ ? [] : [{ value: 'browser', label: 'Browser (Playwright)' }])
+ { value: 'browser', label: 'Browser (Playwright)' }
];
const intervalOptions = [