Scope the bridge's Secret access to the referenced per-App Secrets (per-client RBAC grants) #55
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
lab/authz-bridge#55
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
Security architecture review, 18 Sep 2026 (candidate 1, "Strong"). The bridge's ServiceAccount currently carries a cluster-wide
secretsrule (read for every replica, write for the leader) because the mirror watches the referenced per-App client Secrets in arbitrary App namespaces. That is strictly broader than ADR 0005's stated consequence ("every replica needs RBAC to read the referenced per-App Secrets (in App namespaces)"): a compromised manager pod can read — and, for the leader, rewrite — every Secret in the cluster, not just the client Secrets of the Apps the bridge serves.What to build
Scope the bridge's Secret access to exactly the referenced per-App Secrets, using per-client RBAC grants: one Role + RoleBinding per OauthClient, in the client's namespace, granting get/watch on exactly the referenced client Secret name. Follow the existing per-client grant pattern the repo already runs for ReferenceGrants (ownership labels, deterministic names, GC on client deletion). The leader's referenced-Secret check and the replica mirror's watch operate through these scoped grants; the leader keeps a narrow by-name rule for the two managed Secrets (Registry + Cookie key) in the bridge namespace. The cluster-wide
secretsRBAC markers are removed.Sequence as expand–contract: add the grant mechanism first (nothing breaks while the old rule exists), then switch the mirror/leader over, then narrow the markers.
Acceptance criteria
secretsRBAC markers are gone; the leader's checkSecrets and the replica mirror's watch operate through the per-App Rolesmake manifestsregenerates the RBAC; tests cover grant reconciliation (create, update on ref change, GC)Blocked by