Repository navigation
feat: register feedback with Milo IAM - #29
Open
mattdjenkinson wants to merge 1 commit into
Open
mattdjenkinson wants to merge 1 commit into
mattdjenkinson wants to merge 1 commit into
Conversation
Every resource now has a ProtectedResource, with the user as parent where users act, and roles for users, the website, staff viewers, reviewers, editors, admins and a separate Security Team. - Hidden posts are visible only to callers allowed get on the posts/hidden virtual subresource, checked through the apiserver's delegated authorizer. Platform context alone no longer reveals them, which matters because the website reads there. - feedback-sync, feedback-controller and the apiserver get Kubernetes RBAC in Milo scoped to their own reads and writes, as client-certificate users. The identity defaults now match those usernames. - The discovery policy covers the platform and user contexts. - An optional bindings component adds the feedback-security-team group and binds the reviewer role to staff-users. - Staff can list votes and subscriptions but not change or delete them, and FeedbackSource refuses non-platform contexts in the apiserver too. - A test keeps roles, RBAC, discovery and bindings consistent with the declared resources, and keeps security reports out of every role but the Security Team's and the user's. Part of datum-cloud/enhancements#943. Closes #10.
This was referenced Nov 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Registers feedback with Milo IAM, and closes a gap where the website could see hidden posts. Closes #10.
Stacked on #28 (security reports), which is on #27, #26, #25, #23, #22 and #16.
The hidden-post gap
The design lets any authenticated principal read posts, including datum.net's service account, which reads in the platform context. Until now the platform context alone was enough to see hidden posts, so the website would have shown them.
Hidden posts are now visible only to callers allowed
geton aposts/hiddenvirtual subresource, checked through the apiserver's delegated authorizer (a SubjectAccessReview to Milo, cached by the apiserver). Staff, feedback-sync and feedback-controller have it; users and the website don't. Milo enforces subresource permissions separately becauseENABLE_SUBRESOURCE_AUTHORIZATIONis on in staging and production. Without an authorizer, as in tests and local development, the old platform-context rule applies.Milo IAM (
config/milo/iam)ProtectedResources: one per kind, with subresources:
status,posts/hidden,submissions/review,submissions/attachment,submissions/to-security-reportandsecurityreports/attachment. User-facing kinds takeUseras a parent, so a user's own permissions apply in their user context.FeedbackSourcehas no parent, so it's platform-only.Roles:
userpublic-readerPostQuery, acknowledgementsviewerreviewerto-security-report, hiding postseditor/adminFeedbackSourcemanagement; admin also inherits reviewersecurity-teamsecurityreportsService identities (
config/milo/rbac)Milo authorizes with
RBAC,Webhook, so the service's own components get Kubernetes RBAC in Milo as client-certificate users, scoped to their own work rather thansystem:masters:system:feedback-sync@feedback.miloapis.com:posts/hidden;system:feedback-controller@feedback.miloapis.com:posts/hidden;postqueries.system:feedback-apiserver@feedback.miloapis.com:resourcesearchqueries;organizationmembershipsanduseridentities;system:auth-delegatorand the authentication reader for delegated auth.identity.Defaultnow uses these usernames, replacing the guessed service account names from #23.Discovery and bindings
feedbacksourcesonly in the platform context.config/milo/bindings(optional): thefeedback-security-teamGroup with security-team bindings, and reviewer bindings forstaff-users, one per kind. Who holds which role is a deployment decision, so this component isn't included by default.Context rules in the apiserver
Milo enforces these first. The apiserver now checks them as well:
FeedbackSourcerefuses non-platform contexts on every verb.The rest of the API-contexts table was already enforced by #4 to #9.
For #13
iam-user-self-manageto addfeedback.miloapis.com-usertoinheritedRoles, keeping activity's audit-log querier, since a strategic merge replaces the list.config/miloand decide onbindings/.public-readerto datum.net's identity.system:masters.Testing
TestMiloConfigchecks that:security-teamandusertouchessecurityreports.Adding
posts.watchandsecurityreports.listto the viewer role makes it fail on both.Unit tests: hidden posts with an authorizer (the website gets NotFound on get and list; staff and sync read and update); staff are read-only on votes and subscriptions; FeedbackSource refuses the user context on every verb.
Kind cluster, with the real
config/milo/rbacapplied and sync and the controller running as their certificate users:PostQueryleft out the hidden post.