Skip to content

fix: let resource readers read its status - #206

Merged
scotwells merged 1 commit into
mainfrom
fix/status-read-permissions
Oct 16, 2026
Merged

scotwells merged 1 commit into
mainfrom
fix/status-read-permissions

Conversation

@scotwells

Copy link
Copy Markdown
Contributor

Since Milo began enforcing subresource permissions in staging and production, people who can view export policies are refused when they ask for an export policy's status, even though the normal read already shows that status. Portals and command-line tools that read status this way fail with a permission error. After this change anyone who can read export policies can also read their status. Status writes stay with the controllers.

Changes

  • The telemetry viewer role also grants status.get on ExportPolicies, next to the existing get. The admin role inherits it.

Status update and patch are not granted to any role, so only the controllers can change status.

User-facing effect

Before, for a member holding the viewer role:

$ kubectl get exportpolicy my-policy --subresource=status
Error from server (Forbidden): ... cannot get resource "exportpolicies/status" in API group "telemetry.miloapis.com"

After, the same request returns the object with its status, matching a plain kubectl get.

Test plan

  • go test ./queryapi/ passes, including the check that the viewer grants only declared permissions
  • kustomize build config/operator/iam renders the new grant
  • After deploy to staging, a telemetry viewer can GET an export policy's status
  • A telemetry viewer still cannot update or patch that status

Milo now authorizes subresources on their own, with no fallback to the
parent verb. A request for a resource's /status endpoint needs an explicit
status.get grant, and no role granted one, so anyone who can read a resource is
denied its status even though a normal get already returns the same data.

Grant status.get on ExportPolicies to the telemetry viewer role, next to the
existing get grant. The admin role inherits it. Status update and patch stay
controller-only.
@scotwells
scotwells marked this pull request as ready for review October 15, 2026 18:57
@scotwells
scotwells requested a review from a team as a code owner October 15, 2026 18:57
@scotwells
scotwells merged commit e326e37 into main Oct 16, 2026
28 checks passed
@scotwells
scotwells deleted the fix/status-read-permissions branch October 16, 2026 14:56
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.

3 participants