Repository navigation
feat: set owners and reviewers in admission, register feedback with Milo IAM - #33
Merged
Merged
Conversation
…ilo IAM The owner webhook sets spec.userRef on votes, follows, submissions, security reports and profiles from the request, so a user can only create their own; only the operator creates them for others, and the Security Team logs external reports with no owner. The reviewer webhook records who decided on a SubmissionReview. Milo config: ProtectedResources and roles for every CRD, Kubernetes RBAC for the operator, sync and uploads identities, and the webhook config. A test checks the config against the CRDs.
5 tasks done
scotwells
previously approved these changes
Nov 17, 2026
|
The ownership and access-control design looks sound. Before enabling this for users, please ensure the Metadata-only audit policy for submissions, reviews, security reports and triage is deployed, along with the user/public-reader bindings. Otherwise private report content could enter audit logs, or intended users will have no access. These are rollout prerequisites, not blockers in this PR; the later PRs cover the email and attachment checks. |
2 of 3 tasks
Contributor
Author
|
Agreed. They're now listed in the README's "Before enabling for users" section (#32):
None of them are blockers in this PR, so no change here. |
mattdjenkinson
dismissed
scotwells’s stale review
November 18, 2026 03:47
The base branch was changed.
scotwells
approved these changes
Nov 18, 2026
This was referenced Nov 18, 2026
Open
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.
Part of #10. Stacked on #32; merge that first and this PR will retarget to
main.Makes sure a user can only create feedback as themselves, and registers the feedback CRDs with Milo IAM.
Admission webhooks
The operator serves them; Milo calls them through
config/milo/webhook. Milo already trusts certificates from thedatum-control-planeissuer, so the config has no CA bundle.ownerruns on creates of votes, subscriptions, submissions, security reports and feedback profiles.spec.userRefto that user, whatever the client sent.reviewerruns onSubmissionReviewcreates and updates. When a request setsspec.decision, it recordsspec.reviewerandspec.reviewedAtfrom the request. Before a decision is set, it clears them, so a client can't name someone else.Milo's mutating admission runs before the CRD's CEL rules. So when a user names another user's vote, the owner is replaced and the
<post>.<user>name rule then rejects it. The envtest confirms this.Milo config
Userparent, andpostsdeclares thehiddensubresource that the Milo filter checks.userloses the old attachment and PostQuery permissions and gains feedback profiles.reviewerdecides throughsubmissionreviewsinstead of subresources.security-teamgainssecurityreporttriages.viewergains profiles and digests.system:feedback-operator@…can read everything. It writes only what it owns: post, vote and submission status; the votes, follows and reports it creates for users; reviews, acknowledgements and digests.system:feedback-sync@…is unchanged apart from reading reviews instead of writing submission status.system:feedback-uploads@…can read submissions and reports, and create TokenReviews and SubjectAccessReviews.Tests
test/config: every CRD has a ProtectedResource, with its status subresource, hidden subresource and User parent matching the CRD.task test,go vet ./..., andtask generatewith no diff