fix(security): restrict tenant gateway hostnames - #2740
Conversation
|
|
@cursor review |
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_5b762fe0-4e15-42e5-894e-8b96263412a6) |
devantler
left a comment
There was a problem hiding this comment.
🤖 Generated by the Agentic Engineer
Static exact-head review of db37ba3d5b047a86044c3a43d8ff605137e0c66e; the branch was not checked out or executed. The inline P1 is blocking.
| kinds: | ||
| - HTTPRoute | ||
| namespaces: | ||
| - wedding-app |
There was a problem hiding this comment.
[P1] Cover every tenant-edit reconciler namespace
This policy only matches wedding-app, but at this exact head the ascoachingogvaner Flux Kustomization reconciles every minute as a ServiceAccount bound to tenant-edit, and this PR deliberately leaves that role's HTTPRoute create/update/patch verbs intact. A compromised or over-broadly signed ascoachingogvaner artifact can therefore still claim an arbitrary hostname on the same shared wildcard Gateway, so the stated tenant hostname boundary remains open outside Wedding. Apply an enforced allowlist to every tenant-edit reconciler namespace (or make the policy data-driven from tenant ownership), and add negative admission coverage showing another tenant cannot claim a sibling/platform hostname.
Motivation
editsurface and adding an enforced hostname restriction for the wedding tenant.Description
rbac.authorization.k8s.io/aggregate-to-editaggregation fromgateway-tenant-editso Gateway API route verbs are not automatically added to the built-ineditrole.ClusterPolicy(restrict-wedding-app-route-hostnames) that EnforcesHTTPRoutehostnames in thewedding-appnamespace to the approved valueswedding.platform.lanandwedding.platform.devantler.tech, and denies routes with no hostnames.k8s/bases/infrastructure/cluster-policies/kustomization.yamlso it is applied as part of the infrastructure policies set.Testing
rubyquick-check) and the YAML parsing succeeded.python3 scripts/validate-naming.py) and it passed.git diff --checkto ensure no whitespace/merge issues and it passed.kubectl kustomizeandksail workload validatewere not run in this environment becausekubectlandksailare not installed, so full kustomize/ksail static validation should be run in CI or locally before merge.Codex Task