Skip to content

fix(server): RBAC and auth hardening, plus docs sync#131

Merged
ZingerLittleBee merged 21 commits into
mainfrom
fix/rbac-and-auth-hardening
May 31, 2026
Merged

fix(server): RBAC and auth hardening, plus docs sync#131
ZingerLittleBee merged 21 commits into
mainfrom
fix/rbac-and-auth-hardening

Conversation

@ZingerLittleBee
Copy link
Copy Markdown
Owner

Summary

Hardens the server's authorization model around high-privilege surfaces and brings the documentation in line with the actual implementation.

Security / RBAC hardening

  • Restrict Docker container log WebSocket streaming to admins
  • Restrict file read/download endpoints to admins
  • Unify the password policy and revoke all existing sessions on password change

Documentation

  • Rename the Chinese locale from cn to zh and point README links to the docs site
  • Rework the README with a value-first intro, grouped features, and badges; soften the footprint claim and document install methods (docker for server, binary for agent)
  • Correct the terminal transport description: data is carried in JSON text messages with a base64 data field, not binary WebSocket frames (AGENTS.md, architecture, index, terminal, api-reference)
  • Correct the public status page docs to describe a single /status page
  • Drop the removed SERVERBEE_FEATURE__CUSTOM_THEMES env var from ENV.md
  • Expand the architecture, monitoring, configuration, deployment, agent, alerts, and ping guides with retention tiers, background tasks, upgrade/TLS/backup notes, and API query references
  • Proofread and polish wording across the remaining guides (en + zh)

Chore

  • Sync bun.lock to web 1.0.0-alpha.5

Notes

  • The doc changes were split into focused commits by feature area for easier review.
  • Cleaned up stray </content>/</invoke> artifacts that had leaked into the end of 8 MDX files; verified all affected files keep complete frontmatter, balanced <Cards>/component tags, and even code fences.

Verification

  • Documentation-only changes for the docs portion; MDX structural integrity checked (frontmatter, component pairing, code-fence parity).
  • Server RBAC changes covered by the existing server test suite.

The docker logs WS handler authenticated the user but never checked
role, so any read-only member could stream logs from any container.
Container logs routinely expose env vars, connection strings and tokens,
making this closer to terminal-level access. Require role == "admin"
(with an audit log on denial), matching the terminal WS handler.
The file list/stat/read/download/transfers endpoints lived in
read_router, so read-only members could pull arbitrary files off any
managed host (e.g. /etc/passwd, application secrets). Their effective
access is closer to terminal-level than to read-only monitoring, so move
them into the admin-only file router and drop the read-router merge.
…ange

Two related auth hardening fixes:

- UserService create_user/update_user validated only len >= 6, weaker and
  inconsistent with the >= 8 policy applied to self-chosen passwords. Both
  now call AuthService::validate_password_strength.

- A password change or admin reset left existing sessions valid until
  natural expiry, so a stolen session could outlive the change.
  change_password now revokes the user's other sessions (keeping the
  caller's current cookie/bearer session; an API-key caller has none, so
  all are revoked), and admin update_user revokes the target's sessions
  after a password reset. Adds regression tests covering keep-token,
  no-token, and admin-reset paths.
… proxy

Broaden the bilingual documentation: add OAuth/OIDC and mobile sections,
a hub-and-spoke architecture overview, Caddy reverse-proxy config
alongside the existing nginx example, and assorted updates across the
agent, alerts, server, status-page and configuration pages.
…links to docs site

Use the ISO 639-1 'zh' code instead of the 'cn' country code for the docs
i18n locale, renaming content/docs/cn to content/docs/zh and updating all
internal links, route handlers, and landing translations. README doc links
now point to https://docs.serverbee.app (/en and /zh).
@ZingerLittleBee ZingerLittleBee merged commit 2887ee3 into main May 31, 2026
2 checks passed
@ZingerLittleBee ZingerLittleBee deleted the fix/rbac-and-auth-hardening branch May 31, 2026 10:58
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