Skip to content

Kbs/Admin: modularize admin authentication and authorization#1239

Draft
Xynnn007 wants to merge 6 commits intoconfidential-containers:mainfrom
Xynnn007:kbs/modulize-admin
Draft

Kbs/Admin: modularize admin authentication and authorization#1239
Xynnn007 wants to merge 6 commits intoconfidential-containers:mainfrom
Xynnn007:kbs/modulize-admin

Conversation

@Xynnn007
Copy link
Member

Refactor the admin module from simple monolithic implementations to a modular architecture that separates token verification from authorization decisions.

This work will decouple the token provisioning to outer services. And the inner logic inside KBS will be only

  • Do nothing
  • Deny anything
  • verify token & do filter based on the subject claim of the token

@Xynnn007 Xynnn007 force-pushed the kbs/modulize-admin branch from be3e37e to 22eccb9 Compare March 20, 2026 09:55
Refactor the admin module from simple monolithic implementations to a
modular architecture that separates token verification from authorization
decisions.

Key changes:
- Split admin functionality into two independent modules:
  * token_verifier: Handles token parsing and verification (BearerJwt)
  * authorization: Handles access control decisions (RegexAcl)
- Replace simple backend types (allow_all, deny_all, simple) with
  trait-based architecture for better extensibility
- Update AdminConfig to use "mode" enum (InsecureAllowAll, DenyAll, Enforce)
  instead of "type" for clearer semantics
- Enforce mode requires both token_verifier and authorizer configuration
- Improve error handling with detailed reason messages in AdminAccessDenied

This refactoring improves code organization, maintainability, and makes it
easier to add new token verifiers or authorization strategies in the future.

Signed-off-by: Xynnn007 <xynnn@linux.alibaba.com>
Admin authorization internals were refactored, but deployment and test
configs still encoded the old model, which risks silent policy drift
during upgrades.  This change keeps existing operator intent and
environment behavior stable while adopting the new schema, so users can
move forward without changing trust assumptions.

Signed-off-by: Xynnn007 <xynnn@linux.alibaba.com>
…ver-side JWT enforcement

KBS admin auth moved to explicit bearer-token verification, so having
the client mint JWTs from private keys caused local tooling and
integration tests to diverge from real deployment boundaries. This
switches config operations to consume admin tokens directly (with
sensible local fallback), keeping test coverage aligned with production
trust assumptions while preserving developer ergonomics.

Signed-off-by: Xynnn007 <xynnn@linux.alibaba.com>
… enforced admin mode

As admin configuration shifted to explicit token verification, first-run
local environments became easy to misconfigure even when keys were
present. Generating a reusable admin token from configured signer
material keeps `trustee run` secure-by-default for development and
reduces setup footguns without weakening production guidance.

Signed-off-by: Xynnn007 <xynnn@linux.alibaba.com>
… dedicated config scope

Shared config paths made compose-only generated credentials easy to mix
with other environments, which increases accidental leakage and brittle
automation in CI/local runs. This moves compose materials into a
dedicated subtree and centralizes key/token bootstrapping in one script
so test and deployment flows consume the same predictable artifacts.

Signed-off-by: Xynnn007 <xynnn@linux.alibaba.com>
…act to prevent stale operator guidance

After the admin model moved from persona-key signing to token
verification, legacy examples would silently teach flows that no longer
represent expected behavior and increase onboarding failures. This
updates operational docs and test fixtures together so local validation,
CI expectations, and user-facing instructions all reinforce the same
security model.

Signed-off-by: Xynnn007 <xynnn@linux.alibaba.com>
@Xynnn007 Xynnn007 force-pushed the kbs/modulize-admin branch from 22eccb9 to 2c2ede2 Compare March 20, 2026 10:02
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