docs(design-proposals): add tenant host delegation proposal - #70
Open
mattia-eleuteri wants to merge 1 commit into
Open
mattia-eleuteri wants to merge 1 commit into
mattia-eleuteri wants to merge 1 commit into
Conversation
Tenant.spec.host is gated on caller identity alone, so on a multi-tenant platform no non-empty value is reachable by a tenant user: their own delegated subdomain is refused by the platform's API denylist and their own domain by the admission policy. Every hostname becomes a support ticket, and a control panel that has already verified DNS ownership has nowhere to record that fact. The proposal separates applying a verdict from producing one: Cozystack checks a host against a per-tenant allowlist and a platform reserved list, while ownership verification stays outside admission. Writing the allowlist is itself gated, so the grant cannot be self-signed by a tenant that holds a kubeconfig and apps.cozystack.io/* in its own namespace. Signed-off-by: Mattia Eleuteri <mattia@hidora.io> Assisted-by: LLM
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Team Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This was referenced Sep 7, 2026
Author
|
Implementation and its verification, opened as a draft so the design can be discussed here first: cozystack/cozystack#4132 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a design proposal for delegating
Tenant.spec.hostto tenants, so a hostname the platform has assigned to a tenant can be set without a cluster-admin.Today layer 4 of the hostname security model (
cozystack-tenant-host-policy) gatesspec.hoston the caller's identity alone:system:mastersor acozy-*service account. That gate is correct in intent — the value becomes thenamespace.cozystack.io/hostlabel that layers 2, 7 and 8 all trust — but it leaves a tenant user with no reachable non-empty value, so every hostname is a manual operation and a component that has already verified DNS ownership has nowhere to record that fact.The proposal separates applying a verdict from producing one. Cozystack checks a host against a per-tenant allowlist (carried by a
namespace.cozystack.io/allowed-hostsnamespace annotation, inherited through the existing_namespacechannel) and a platform reserved list that no allowlist can override. Ownership verification stays outside admission. Writing the allowlist is itself gated by a new policy, because tenants receive a kubeconfig andapps.cozystack.io/*in their own namespace by design, so a self-written allowlist would be self-signed.Two points the proposal argues explicitly, since both are easy to get backwards:
spec.hostare deliberately disjoint sets. The reserved list is what keeps that disjointness meaningful, not the reverse — with the reserved list empty, a grant account can hand out the platform's own apex.namespace.cozystack.io/hostlabel reaches consumers "normalised by nothing", asexternal-database-exposuredocuments independently; a comparison that skipped it would let a grantedexample.comreach a reservedinternal.example.comviasvc.INTERNAL.example.com, which downstream consumers then match all-lowercase.The four open questions at the end are the ones I would most like reviewer input on — in particular whether it is acceptable that a grant is inoperative on
Tenant/root(the safe behaviour, but it means a level-1 tenant's own host stays a trusted-caller field), and whether the delegation-seeded entry should be strict-subdomain rather than apex-inclusive.An implementation exists and is verified against the design, which is where the failure and edge-case lists come from; it is not part of this PR and will be proposed separately once the design has been discussed.
Before review
decisions/directory, or says below why none is needed.This is a new proposal, not a revision of a merged one, so there is no design to record a change against. The
Decisionssection is left empty per the template.DCO
git commit --signoff).