Skip to content

harden singleton security boundaries - #217

Open
deathbyknowledge wants to merge 7 commits into
mainfrom
harden-singleton-boundaries
Open

harden singleton security boundaries#217
deathbyknowledge wants to merge 7 commits into
mainfrom
harden-singleton-boundaries

Conversation

@deathbyknowledge

@deathbyknowledge deathbyknowledge commented Jul 22, 2026

Copy link
Copy Markdown
Owner

Summary

  • make uid 0 the only root authority for bootstrap, human creation, global packages, and foreign repositories; revoke persisted non-root wildcard/bootstrap grants
  • canonicalize bounded ASCII usernames, allocate uid/gid values from one monotonic SQLite counter, and refresh hibernated connection authority from current account state
  • add admin-gated gsv user create, gsv user register, and gsv user permissions commands through a typed user.admin Kernel boundary
  • add equivalent native user create, user register, and user permissions commands on the gsv target; they re-enter normal syscall dispatch so authorization and live-authority refresh remain centralized
  • require uid 0 or a direct primary-gid user.admin grant before credentials are read or mutations begin; apply permission batches atomically and refresh live connection/process authority after changes
  • keep new native-shell passwords out of argv with --password-stdin and document a verified mode-0600 staging flow
  • revalidate delegated process and schedule run-as authority from current group membership
  • reject wildcard, malformed, and non-string package-agent profile capabilities before provisioning can mutate account state
  • preserve R2 ownership and extra metadata on overwrite, protect create-only directory/symlink markers, and hide inaccessible device paths
  • consume OAuth callback state atomically and generate link codes with Web Crypto

Scope

This deliberately keeps the current singleton Kernel architecture. Public self-registration and admission policy remain closed.

Rust gsv user register creates the account and replaces the local CLI session. Native-shell user register provisions the account and instructs the caller to start a new login; a shell command does not replace the identity of its already-authenticated WebSocket.

There is no user-Kernel split, routing change, AppRunner redesign, admission/rate-limit system, or legacy runtime-data movement.

The single v15 migration only revokes persisted authority that changed meaning and initializes the uid/gid allocator; it does not copy or delete user runtime data.

Size

  • total: +2,930 / -135 (net +2,795)
  • non-test/docs files: +1,427 / -109 (net +1,318)
  • dedicated test/docs files: +1,503 / -26 (net +1,477); CLI unit tests embedded beside command code are included in the non-test/docs figure

Validation

  • cd gateway && npx tsc --noEmit
  • cd gateway && npm run test:run — 83 files, 1,360 passed, 5 skipped
  • focused native-shell suite — 117 passed
  • npm run gsv:check && npm test --workspace packages/gsv — 49 passed
  • cd cli && cargo fmt --check && cargo test — 102 passed
  • git diff --check origin/main...HEAD

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6781df5c74

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread gateway/src/kernel/capabilities.ts
@deathbyknowledge

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. More of your lovely PRs please.

Reviewed commit: 1afc0e8595

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

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.

1 participant