Repository navigation
Conversation
Issue #173 - Isolation stage S1: Home gets only the permissions it needs Design draft covering: - Root-free Browser networking (#165) - Hash-verified capsule assets (#171) - Provider confinement and keys (#166) - Runtime as a limited service (#183) Includes concrete technical approaches, files that would change, testable acceptance criteria, and open questions for security review. Read-only design only - no code changes per instructions. Co-authored-by: Anders <andersalm@users.noreply.github.com>
|
Review of head 4c0b3c1 on base ac7d018 (develop); scope: docs/isolation/S1_DESIGN.md. Verdict: needs changes before it goes to Irzhy.
|
Per review feedback: - Remove Component 1 (#165) - already done, needs only release checks - Focus on #171 (hash-verified assets), #166 (provider confinement), #183 (limited service) - Reduce to 2 open questions: Linux Landlock/seccomp profile shape, derived-key migration - Cite actual code: browser_capsules.rs, server_infra.rs, bridge.rs, carrier.rs - Remove new docs/isolation tree per AGENTS.md (design notes in issue) - Fix title: S1 is isolation foundations, not "Home permissions" (that's S2/T2) - Include 11 Oct plan: systemd user unit, NoNewPrivileges, Carrier keeps 0.0.0.0:4433 Co-authored-by: Anders <andersalm@users.noreply.github.com>
|
Independent second-reviewer pass on the S1 design ( Critical
High An A+ version would keep the device key out of every provider process (sign over IPC), bind storage keys to provider identity, hold the migration flag in the Runtime with crash-safe and downgrade-safe migration, and run listener audits on fresh and upgraded installs. Posted at Sash's request. |
Overview
Minimal design for Issue #173 S1: root-free runtime, confined providers, verified capsule assets, localhost-only default.
Issue: #173
Scope: Three components (#171, #166, #183)
Open Questions: Two (for @irzhywau)
S1 Components
#171: Hash-Verified Capsule Assets
Current:
components.jsoncarriesbrowser_assetswith sha256 (lines 105–121, produced bystamp-source-home-capsule-metadata.py).Gap:
api/browser_capsules.rsserves assets without verifying bytes against hash.Design: Before serving any
browser_assetspath, hash the bytes and compare tocomponents.json. Refuse on mismatch. Serve only listed paths.Test: Edit one Home asset file. Launch Home. Asset serve must fail.
#166: Provider Confinement and Keys
Current:
server_infra.rshands device key to did/localhost/object/wallet providers (lines 749, 792, 892, 1305). Model-provider has partial macOS seatbelt (provider/bridge.rs:333–393); other providers run unconfined.Gap: No Linux confinement. No per-provider storage key derivation. Coords file readable by all providers.
Design:
runtime-coords.json.no_new_privs+seccomp+ Landlock (kernel 5.13+). Fail closed if unavailable.Test: Confined provider attempts
open("../runtime-coords.json"). Must fail withEACCES, logged by Runtime.#183: Runtime as Limited Service
Current:
main.rs:2053–2060already binds loopback. Coords 0600 atruntime_control.rs:583.Gaps:
capsules/ipfs-provider/src/main.rs:705–723)DEFAULT_CARRIER_BIND_ADDR0.0.0.0:4433 (carrier.rs:1733)Design (per 11 Oct plan):
NoNewPrivileges=true. Binary in data folder.Test: Launch Runtime.
ss -tulpnshows only 127.0.0.1 binds except Carrier 4433.Open Questions for Security Reviewer
1. Linux Landlock/seccomp profile shape per provider
Landlock (kernel 5.13+) gives path-based read/write rules. Seccomp denies syscalls.
Question: Which seccomp syscalls to deny? Model: Docker default seccomp profile, or systemd
SystemCallFilter=@privileged @resources?Related: Landlock unavailable (kernel <5.13) means fail-closed. Acceptable to refuse provider launch on old kernel?
2. Derived-key migration
Each provider gets derived storage key (
HKDF(root, "provider:<name>", 32)). Existing data encrypted under old key must migrate.Question: Migration timing: on first provider start (read old, write new), or offline migration tool before upgrade?
Concern: First-start migration means provider holds both keys briefly. Offline tool requires downtime.
Changes from Previous Review
Per andersalm review:
browser_capsules.rs,server_infra.rs,bridge.rs,carrier.rsdocs/isolation/tree (design notes live in issue per AGENTS.md)