Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/aien-sovereign-core-mv/blob/main/docs/security/cockpit-access.md # aien-sovereign-core-mv AienOS host runtime: inference scheduling, paged KV state, the aien CLI and Spark verification tooling. Its inference engine is in alpha testing (DGX Spark GB10); Omega is the implementation destination. Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `aien-sovereign-core-mv / docs / security / cockpit-access.md` 46 lines ยท 3516 bytes Raw Blame History Rendered 1 # Cockpit operator access 2 3 ## Opening the cockpit on the Spark (plain steps) 4 5 The cockpit now asks for a password-like access token before it shows anything or lets anyone press a button. Only the Spark itself can reach it. 6 7 1. Open a terminal on the Spark and type: 8 9 ``` 10 atlas-vault get AIEN_COCKPIT_TOKEN 11 ``` 12 13 It prints one long line of letters and numbers. Select it and copy it. That line is the cockpit key; do not paste it into chats, issues or screenshots. 14 2. Open a web browser on the Spark and go to `http://127.0.0.1:18095` (or `http://localhost:18095`). 15 3. The browser shows a page titled "Sign in to AIEN". Paste the key into the box and press "Sign in". 16 4. The normal cockpit appears. The sign-in lasts one hour, and restarting the cockpit service also signs you out. After that, the browser returns to the sign-in page; repeat steps 1 to 3. 17 18 From the MacBook, open a tunnel first (Terminal on the Mac: `ssh -L 18095:127.0.0.1:18095 `, leave it open), then follow steps 2 to 4 in a Mac browser at `http://127.0.0.1:18095`. The LAN address and the Tailscale address no longer work on purpose. 19 20 ## Token provisioning 21 22 Both keys live in atlas-vault, the machine's TPM-sealed key store (encrypted by the Spark's security chip, kept under `~/.config/atlas/vault` with owner-only permissions). They never sit in a repository or a plain text file, and the services never print them to logs. 23 24 | Key | Who reads it | 25 | --- | --- | 26 | `AIEN_COCKPIT_TOKEN` | spark-cockpit-rs at start; Drake pastes it at `/login` | 27 | `AIEN_MAIL_API_TOKEN` | spark-mail (checks it) and the cockpit (sends it when forwarding mail requests) | 28 29 Create or rotate a key, then restart the service that reads it: 30 31 ``` 32 head -c 48 /dev/urandom | base64 | tr -d '/+=\n' | atlas-vault add AIEN_COCKPIT_TOKEN 33 ``` 34 35 Store `AIEN_COCKPIT_TOKEN` and `AIEN_MAIL_API_TOKEN` with `atlas-vault add `, which reads the value from standard input. Use a random token of at least 32 ASCII characters. The cockpit and mail service resolve these through process memory or `atlas-vault get `. Plaintext token files are not supported. Missing credentials fail closed. Restart the cockpit after rotating its token; existing sessions are cleared. 36 37 ## What is protected 38 39 - Listener: `127.0.0.1:18095` by default. `AIEN_COCKPIT_ADDR` changes it explicitly. 40 - Allowed browser origins: `http://127.0.0.1:18095` and `http://localhost:18095`. `AIEN_COCKPIT_ORIGINS` (comma separated, exact origins) replaces the list. Use HTTPS for any remote browser origin. 41 - Every route except `/login` and `/auth/session` needs either `Authorization: Bearer ` or a signed-in browser session. Browser sessions are random, HttpOnly, SameSite=Strict cookies with a server-enforced one-hour lifetime; HTTPS origins also get Secure cookies. 42 - Browser mutations (anything other than GET/HEAD) and terminal upgrades additionally need an allowed Origin. A request carrying a foreign Origin gets 403. 43 - The terminal (`/ws/terminal`) keeps its own check on top: exact loopback Origin and a loopback peer address. Remote origins cannot open a shell. 44 - Health reads stay open for local monitors: `GET /api/pulse` and `GET /api/status` answer without a token, but only when the request's Host is `127.0.0.1`, `localhost` or `[::1]` (blocks DNS-rebinding pages) and it carries no foreign Origin. aien-cli, spark-debugger and spark-supervisor only use these reads. 45 46 The token authorizes the operator's administrative surface, not an untrusted agent principal.