notifications (3/5): notification:read and notification:manage permissions#454
notifications (3/5): notification:read and notification:manage permissions#454illegalprime wants to merge 3 commits into
Conversation
🔐 Codex Security Review
Review SummaryOverall Risk: LOW Findings[LOW] Notification RPCs Are Classified Before They Are Registered or Enforced
NotesThe new permission catalog entries and Generated by Codex Security Review | |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 507a4e593d
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| @@ -0,0 +1,15 @@ | |||
| -- Seed notification permission rows and backfill them onto existing ADMIN roles (the catalog reconciler is additive and won't re-assert onto already-seeded roles). | |||
There was a problem hiding this comment.
Renumber the notification seed after existing 000088
This stack's base already contains 000088_notification_history_keyset_index, and runMigrations advances the DB with m.Up(). Any environment that has already run that parent stack will have schema_migrations at version 88, so adding this backfill as a new lower-numbered 000087 migration means it will not run there. In that upgrade path the new notification:* gates are present, but existing ADMIN roles never receive these grants, so the notifications RPCs/UI will be denied for current org admins; make this the next migration after 000088 instead of inserting it below the current version.
Useful? React with 👍 / 👎.
507a4e5 to
3bd492f
Compare
|
Codex finding [MEDIUM] services in RBAC contract but not mounted is a split artifact: this PR adds the permission map + |
d9857a9 to
c49d919
Compare
3bd492f to
66e55db
Compare
|
Re the re-review:
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 66e55db8f5
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| {notificationsv1connect.ChannelServiceName, reflect.TypeOf((*notificationsv1connect.ChannelServiceHandler)(nil)).Elem()}, | ||
| {notificationsv1connect.RuleServiceName, reflect.TypeOf((*notificationsv1connect.RuleServiceHandler)(nil)).Elem()}, | ||
| {notificationsv1connect.SilenceServiceName, reflect.TypeOf((*notificationsv1connect.SilenceServiceHandler)(nil)).Elem()}, | ||
| {notificationsv1connect.HistoryServiceName, reflect.TypeOf((*notificationsv1connect.HistoryServiceHandler)(nil)).Elem()}, |
There was a problem hiding this comment.
Drop unmounted notification services from contract list
These entries make TestRPCContract_RegisteredServicesMatchMainMux fail in this stack because that test compares registeredServices against the handlers actually mounted in cmd/fleetd/main.go, and the current mux has no notificationsv1connect.New...ServiceHandler registrations (the commit message says wiring lands in stack 4). Until the notification handlers are mounted in main.go, listing them here leaves missingFromMux populated for all four services and blocks the middleware package tests.
Useful? React with 👍 / 👎.
…to the mount PR Two review fixes: - Renumber the permission-seed migration 000087 -> 000088 so it sits above the keyset-index migration (now 000087) that merges first in the stack, keeping numeric order aligned with merge order (see #453). - Move the notification entries out of registeredServices (the RBAC contract fixture): TestRPCContract_RegisteredServicesMatchMainMux compares it against the handlers mounted in main.go, and the mounts land in the next stack PR, so listing them here failed the test standalone. The ProcedurePermissions policy map (and its catalog keys) stay here; only the mount-coupled registration moves to the server PR. Addresses Codex connector findings (P1/P2) on #454. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
66e55db to
d2685fc
Compare
|
codex-connector triage (both fixed):
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d2685fc9dd
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| {PermNotificationRead, "View notification channels, alert rules, silences, and delivery history.", ResourceNotification}, | ||
| {PermNotificationManage, "Create, edit, test, and delete notification channels; pause and resume alert rules; create and lift silences.", ResourceNotification}, |
There was a problem hiding this comment.
Wire notification permissions into the role builder
When the ListPermissions response includes these new ResourceNotification entries, the ProtoFleet role builder currently drops any resource not listed in RESOURCE_TO_GROUP and iterates only GROUP_ORDER (client/src/protoFleet/features/settings/utils/permissionCatalog.ts:29-62); CreateEditRoleModal then builds visibleKeys from those groups and filters role permissions through it before saving (client/src/protoFleet/features/settings/components/CreateEditRoleModal.tsx:121-125). As a result, custom roles cannot be granted notification:read/notification:manage in the UI, and editing an existing custom role with those keys will remove them on save; add notification to the client group mapping/order with this catalog addition.
Useful? React with 👍 / 👎.
6076695 to
03bb87c
Compare
…to the mount PR Two review fixes: - Renumber the permission-seed migration 000087 -> 000088 so it sits above the keyset-index migration (now 000087) that merges first in the stack, keeping numeric order aligned with merge order (see #453). - Move the notification entries out of registeredServices (the RBAC contract fixture): TestRPCContract_RegisteredServicesMatchMainMux compares it against the handlers mounted in main.go, and the mounts land in the next stack PR, so listing them here failed the test standalone. The ProcedurePermissions policy map (and its catalog keys) stay here; only the mount-coupled registration moves to the server PR. Addresses Codex connector findings (P1/P2) on #454. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
d2685fc to
23cd610
Compare
Adds the notification resource and its read/manage permissions to the authz catalog, maps every notifications RPC procedure to the right permission (reads on :read, all mutations incl. TestChannel on :manage), and seeds the permissions via migration. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…to the mount PR Two review fixes: - Renumber the permission-seed migration 000087 -> 000088 so it sits above the keyset-index migration (now 000087) that merges first in the stack, keeping numeric order aligned with merge order (see #453). - Move the notification entries out of registeredServices (the RBAC contract fixture): TestRPCContract_RegisteredServicesMatchMainMux compares it against the handlers mounted in main.go, and the mounts land in the next stack PR, so listing them here failed the test standalone. The ProcedurePermissions policy map (and its catalog keys) stay here; only the mount-coupled registration moves to the server PR. Addresses Codex connector findings (P1/P2) on #454. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Part of the Silences -> Maintenance Windows rename. Updates the procedure-> permission map to the renamed MaintenanceWindowService procedures. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
03bb87c to
b89405f
Compare
23cd610 to
8cd5d9a
Compare
Stack 3/5 — base: `eden/notifications-2-history-store`
Adds authz for the notifications surface.
Stack
🤖 Generated with Claude Code