Files
tailscale/cmd/k8s-operator/e2e
Mike JensenandTom Meadows 6aea659f96 Legacy proxy ServiceAccount: narrow its Secret access (#22750) (#22763)
* cmd/k8s-operator,k8s-operator,ipn/store/kubestore: add per-proxy RBAC

Proxies for Services, Ingresses, Connectors and PeerRelays run as the
shared proxies ServiceAccount, whose Role allows every verb on every
Secret in the operator namespace, so each proxy can read and change the
Secrets of the operator and of other proxies. This fixes this by giving
each of those proxies its own ServiceAccount, Role and RoleBinding, where
the Role names only that proxy's state Secrets, and the chart no longer
installs the proxies Role. It also removes the list and watch on every
Secret from ProxyGroup Roles, and the Secret rule with no resourceNames
that ProxyGroup and Recorder Roles got at zero replicas, so kubestore
read replicas now get cert Secrets by name. Existing proxy Pods restart
once on upgrade.

Updates tailscale/corp#51011



* cmd/k8s-operator,k8s-operator,ipn/store/kubestore: test per-proxy RBAC

Adds tests for the ServiceAccount, Role and RoleBinding that each Service
proxy and PeerRelay gets, including copied imagePullSecrets, and for the
ProxyGroup Role rules, including zero replicas. Adds an e2e test that
uses SubjectAccessReviews to check that a Service proxy and a ProxyGroup
can get their own state Secret, but cannot get the operator's OAuth
Secret or each other's state Secret, and cannot list Secrets. Also adds
tests for reloading shared TLS certs by name on read replicas, including
a cert Secret that is deleted and then recreated, and removes the test
for the Secret list that read replicas no longer do.

Updates tailscale/corp#51011



* kubestore: fix test lint failure

Change-Id: Ia988256dfe611a64b46cdb81d4e1d68bd7873ca4


---------

Change-Id: I9dd176c3f171deb3d6c49b190c6f58cf72085857



(cherry picked from commit e3f1d5ccbd)

Signed-off-by: chaosinthecrd <[email protected]>
Signed-off-by: Mike Jensen <[email protected]>
Co-authored-by: Tom Meadows <[email protected]>
2026-11-30 18:58:59 -05:00
..