Local gateway security
Bound the future loopback bridge to approved roots, methods, origins, and a scrubbed child process.
Outcome
The future personal bridge can access an approved local project without exposing local credentials or an inbound cloud-reachable port.
Prerequisites
The local-gateway slice must exist and pin a compatible CLI protocol. Until then, no gateway process or network endpoint is part of Lumen.
Steps
- Bind only to loopback and require the exact approved
Hostand browserOrigin. - Store a rotatable per-install secret in OS-protected credential storage.
- Launch the child over stdio with a minimal environment and positive method allowlist.
- Resolve every approved root and file-bearing path with
realpath; reject symlink escapes before and after creation. - Normalize allowed events into product contracts and preserve user approvals.
- Use an outbound authenticated bridge when a cloud API needs local capability.
Verify
Reject unknown methods, bad origin/host, replayed secret, unapproved root, symlink escape, scrubbed secret canary, and destructive thread/config/auth actions. Kill and restart the gateway and confirm a clear recoverable state.
Recover
Use the adapter kill switch, rotate the install secret, stop the child process group, and inspect local logs for exposure. Do not expose the experimental network transport as a shortcut.