Skip to content

feat: allow all network access when starting an Enclave session - #16

Open
fismif wants to merge 3 commits into
eclipse-enclave:mainfrom
fismif:feat/start-enclave-unrestricted
Open

fismif wants to merge 3 commits into
eclipse-enclave:mainfrom
fismif:feat/start-enclave-unrestricted

Conversation

@fismif

@fismif fismif commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

What and why

Closes #15. The Container settings of the session start and restart forms get an Allow all network
access
checkbox, directly above Extra allowed domains. It passes Enclave's --allow-all-network.
I found no documented reason why HomeShell left this option out, so this PR adds it.

  • Default: Enclave's resolved allow_all_network, with a caption naming the config layer it
    came from.
  • Overriding the config: unticking it against a config that allows all network passes
    --allow-all-network=false. Like Host config, the setting is recorded and passed only when it
    differs from the config, and Restart and Continue replay it. CLI-started sessions pick it up from
    enclave ps --json.
  • Warning: the description says the agent sees the real tokens, because in unrestricted mode
    Enclave injects secrets with their real values.
  • Domains: while all network is allowed, Extra allowed domains is greyed out and keeps its value,
    and no --allow-domain is passed. Unrestricted mode has no allowlist for them to extend.
    • The form learns this from a generic, daemon-sent schema keyword on the field:
      "x-disabled-when": {"allowAllNetwork": true}. The UI only compares values. The keyword is
      documented in docs/API.md next to x-source and x-inherited.
  • Disabled lists: a disabled list field now mutes its whole box, chips included, not just its
    Add input. Before, the greyed-out domains looked editable.
  • Drift: a session that runs with all network allowed, under a config that allows it too, is
    no longer flagged out of date on allow_domains, as the domains have no effect there.
  • Known limitation: HomeShell does not yet ask enclave network print --json for Enclave's
    network policy mode (enclave network set-mode unrestricted, or a project policy). A session
    under an unrestricted mode runs unrestricted whatever the checkbox says, as
    --allow-all-network=false cannot override that mode. This is documented in docs/PROVIDERS.md.

To try it, run make dev-demo, start a containerized session and open its Container group. With a
real Enclave, set allow_all_network = true in a project config to see the box start ticked.

Changelog

- Enclave sessions can allow all network access: a new checkbox in the Container settings of the
  start and restart forms. It defaults to your Enclave config and greys out Extra allowed domains
  while it is on. With it on, the agent sees your real tokens.
- A list field in a form now looks disabled as a whole while it takes no input, not just its
  Add box.

Checklist

  • Tests added: unit and e2e, or a regression test for a bug fix (see AGENTS.md)
  • Docs updated per the trigger table in AGENTS.md

The Container group of the session create and restart forms gets an
"Allow all network access" checkbox above Extra allowed domains. It
defaults to Enclave's resolved allow_all_network and is locked on under
the QEMU backend. Like hostConfig, it is recorded and passed only when it
differs from the config (--allow-all-network, or =false), and Restart and
Continue replay it. CLI-started sessions pick it up from ps --json.

While all network is allowed, --allow-domain is not passed: nothing
enforces it on Docker, and QEMU rejects it. The form greys the domains
out through a generic daemon-sent schema keyword, x-disabled-when, and
keeps their value.

Refs eclipse-enclave#15
Only the Add input greyed out, so a list disabled by x-disabled-when, or
by a form in flight, kept its enabled look in a screenshot.
@fismif

fismif commented Nov 18, 2026

Copy link
Copy Markdown
Contributor Author

@EclipseSourceAI

@fismif fismif changed the title Allow all network access when starting an Enclave session feat: allow all network access when starting an Enclave session Nov 18, 2026

@EclipseSourceAI EclipseSourceAI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note

Autonomous AI review. May contain mistakes.

Useful comment? React 👍. Disagree? React 👎 to reject it for follow-up reviews. A reply explaining why helps too.

This agent never approves PRs. A maintainer must sign off.

Only a maintainer can re-request a review from this agent.

Powered by Eclipse Enclave via review-guard-mcp

This PR adds an Allow all network access checkbox to the Enclave Container settings. It passes --allow-all-network, or --allow-all-network=false when the session should be stricter than the config. The checkbox defaults to Enclave's resolved allow_all_network, and Restart, Continue and CLI-adopted sessions replay it. It also adds a generic x-disabled-when schema keyword: the daemon states the rule and the form only compares values. The form uses it to grey out Extra allowed domains while all network is allowed, and the daemon stops passing --allow-domain then. The daemon/UI split matches the rest of the schema form, and both unit and e2e tests are included.

What a maintainer should look at:

  • QEMU special case: HomeShell always starts sessions with --background, and Enclave's QEMU backend can't run detached. config --json also already reports the forced value. So the QEMU branch and the read-only lock can't be reached or tested.
  • Network policy mode: the known limitation is documented as something HomeShell can't see. enclave network print --json does report the effective mode.
  • Drift after upgrade: sessions started under an unrestricted config with extra domains will show as out of date on allow_domains once this lands.

UI check in make dev-demo (Playwright):

  • The checkbox sits right above Extra allowed domains, unticked by default, with the token warning.
  • Ticking it greys out the domains box. The chips can't be removed and nothing can be added. The values survive unticking, and they are recorded in the launch config.
  • The only visual issue is the double-dimmed chip × (inline comment).

Comment thread docs/PROVIDERS.md Resolved
- Drop the QEMU case: HomeShell always starts sessions with --background,
  which Enclave's QEMU backend does not support, so it could never run.
- Say HomeShell does not yet ask `enclave network print --json` for the
  network policy mode, rather than that it cannot see it, and that
  --allow-all-network=false cannot override an unrestricted mode.
- An unrestricted session still runs an observing gateway; the domains
  do not apply because unrestricted mode has no allowlist.
- Drift skips allow_domains while both the session and the config allow
  all network, so sessions started that way before are not flagged.
- Keep the chip × at full opacity inside a disabled list box, so the
  box's dimming is the only one.

Refs eclipse-enclave#15

@EclipseSourceAI EclipseSourceAI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note

Autonomous AI review. May contain mistakes.

Useful comment? React 👍. Disagree? React 👎 to reject it for follow-up reviews. A reply explaining why helps too.

This agent never approves PRs. A maintainer must sign off.

Only a maintainer can re-request a review from this agent.

Powered by Eclipse Enclave via review-guard-mcp

Follow-up review of 37f3799, which addresses my earlier review from 8ecca53.

All five points I raised are genuinely fixed, not just argued against:

  • The QEMU branch, its readOnly lock, and the related tests are fully removed (confirmed no qemu references remain anywhere under daemon/ or docs/).
  • docs/PROVIDERS.md and the allowAllNetworkProp comment now say the network policy mode is "not asked for yet" instead of implying it's invisible, and note that --allow-all-network=false can't override an unrestricted policy mode.
  • The schema.go comment no longer claims the gateway disappears in unrestricted mode; it now correctly says unrestricted mode has no allowlist to extend.
  • changedOptions in drift.go now skips allow_domains when both the running session and the current config allow all network, with a table-driven test (TestChangedOptionsAllowDomainsUnderAllNetwork) that correctly still compares when the session reports the option as missing or null.
  • The chip × double-dimming is fixed in schema-fields.module.css by resetting its opacity to 1 inside a disabled box, backed by a new e2e assertion in session-settings.spec.ts.

I tried to re-verify the chip fix live via Playwright this round, but the sandbox has no Go toolchain available to run the daemon half of make dev-demo, so I couldn't exercise the UI. The CSS rule and the new e2e assertion both check out by reading the code and match the selector structure used elsewhere in the same file.

The diff since my last review (8ecca53..37f3799) is scoped entirely to these five fixes, no other changes or new issues to flag.

These previous comments can be resolved as they are now handled:

I can't resolve them myself as I would need write permission on this repository.

@fismif
fismif marked this pull request as ready for review November 18, 2026 14:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow all network access when starting an Enclave session

2 participants