Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.stacyide.xyz/llms.txt

Use this file to discover all available pages before exploring further.

Threat Model

This threat model is the Phase 7 baseline. It focuses on StacyVM as a self-hosted sandbox control plane with local providers, live previews, SDK access, and an admin dashboard.

Assets

  • Host access to Docker, KVM, Firecracker, PRoot, and filesystem paths.
  • Sandbox filesystem contents and user workspaces.
  • API and admin API keys.
  • SQLite database, audit logs, quotas, templates, environments, and registry metadata.
  • Live-preview traffic and routing metadata.
  • Registry credentials and build artifacts.

Trust Boundaries

BoundaryRisk
API client to StacyVM serverUnauthorized lifecycle, file, exec, or admin operations
StacyVM server to provider runtimeContainer escape, VM misconfiguration, stale runtime ownership
Sandbox to host filesystemPath traversal, workspace breakout, shared pool leakage
Live preview proxy to sandboxHost header abuse, accidental exposure, cross-tenant preview routing
Admin dashboard to APIKey leakage from browser storage, overbroad operator access
Registry/environment builderSecret leakage, malicious image build inputs, supply-chain drift

Primary Threats

ThreatCurrent mitigationRemaining work
Regular API key accesses admin routesAdmin key separation, admin:* scope enforcement, OIDC/JWT RS256 Bearer auth with group-to-role mapping (viewer/operator/admin/tenant_admin), and per-resource policy enforcement for image/provider/network controlsExpand per-route policy tests for every provider type
Missing operator attributionX-User-ID, admin fallback attribution, and OIDC sub/email claims injected into AuthIdentity and written to audit recordsNone; OIDC actor claims implemented
Sandbox file path traversalManager pool scoping rejects traversal; Docker/PRoot/provider tests cover traversal casesContinue platform conformance on live runtimes
Shell command injectionExplicit shell/argv execution modes; argv mode avoids shell interpolationExpand SDK examples and conformance tests for every provider
Docker container escapeDropped caps/seccomp/resource config supportedHarden defaults and certify gVisor/Kata
Stale runtime after restartStartup reconciliationDistributed leases for multi-worker
Worker impersonationWorker RPC contract separates worker identity from user/admin identity; signed worker tokens enforce worker ID, token ID, audience, expiry, revocation, and worker-only scopes; worker RPC mTLS is wired for transport identity; centralized token issuance via /api/v1/admin/worker-tokens removes the need for workers to hold the signing key directlyTarget-network mTLS smoke with deployment-issued certificates
Audit gapsAdmin audit and operation audit persisted for sandbox lifecycle, exec, and file operationsExtend operation audit to every env/registry mutation route
Live preview exposureTraefik label routing and docsHost allowlist and preview auth options
Secret leakage in diagnosticsRedaction in diagnosticsSupport bundle redaction tests
Single-node database lossSQLite backup docsBackup/restore test automation

Phase 7 Security Objectives

  • Make production misconfiguration visible through stacyvm doctor --production.
  • Remove ambiguous command execution semantics before recommending public workloads.
  • Increase file API path traversal coverage. Done for manager scoping and provider boundaries.
  • Extend persisted audit beyond admin routes. Done for sandbox lifecycle, exec, and file operations.
  • Convert runtime conformance docs into repeatable host checks. Done with scripts/certify-runtime.sh.

Non-Goals For Phase 7

  • Multi-worker scheduling.
  • Full OIDC/SSO implementation.
  • Postgres store.
  • Enterprise RBAC.
Those belonged to later production stages after the single-node release candidate was hardened.

Phase 14 Security Additions

  • OIDC/JWT RS256 Bearer token auth with JWKS and configurable issuer, audience, and group-to-role mapping.
  • RBAC roles: viewer, operator, admin, tenant_admin with scoped permission sets.
  • Tenant/project model: resource isolation per tenant, per-tenant audit export.
  • Policy controls: image, provider, and network allow-deny enforcement at spawn time.
  • Centralized worker token issuance: workers obtain signed tokens from the control plane without holding the signing key.
  • Sandbox tenant scoping: List and Get enforce tenant boundaries for OIDC-authenticated callers.