Skip to content

fix: let resource readers read its status - #125

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 resource index policies are refused when they ask for a 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 resource index policies can also read their status. Status writes stay with the controllers.

Changes

  • The search viewer role also grants status.get on ResourceIndexPolicies, next to the existing get. The editor and admin roles inherit 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 resourceindexpolicy my-policy --subresource=status
Error from server (Forbidden): ... cannot get resource "resourceindexpolicies/status" in API group "search.miloapis.com"

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

Test plan

  • kustomize build config/milo renders the new grant
  • The new permission is declared on the ResourceIndexPolicy ProtectedResource
  • After deploy to staging, a search viewer can GET a policy's status
  • A search 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 ResourceIndexPolicies to the search viewer role, next to
the existing get grant. The editor and admin roles inherit it. Status update
and patch stay controller-only.
@scotwells
scotwells marked this pull request as ready for review October 15, 2026 18:57
@github-project-automation github-project-automation Bot moved this from Backlog to Ready in Searching Resources in Milo Oct 16, 2026
@scotwells
scotwells merged commit d245375 into main Oct 16, 2026
6 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.

2 participants