Repository navigation
fix(security): scope on-call override deletion to its schedule and org - #714
Merged
Merged
Conversation
Deleting an override now resolves the organization, loads the schedule within it and deletes the override only when it belongs to that schedule; anything else answers 404. The database methods to read and delete an override take the schedule UID (SQLite and Postgres). Creating an override also loads its schedule within the organization, and the users of an override or a schedule roster must be members of the organization (400 otherwise). Co-Authored-By: Claude Opus 5.5 <[email protected]>
fclairamb
enabled auto-merge (squash)
October 30, 2026 05:53
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #714 +/- ##
==========================================
+ Coverage 89.75% 89.78% +0.02%
==========================================
Files 1297 1297
Lines 132215 132272 +57
==========================================
+ Hits 118675 118755 +80
+ Misses 13531 13508 -23
Partials 9 9
🚀 New features to boost your workflow:
|
Merged
fclairamb
added a commit
that referenced
this pull request
Oct 30, 2026
🤖 I have created a release *beep* *boop* --- ## [0.42.1](v0.42.0...v0.42.1) (2026-10-30) ### Bug Fixes * **checkicmp:** socket-open failure is an infrastructure error ([#712](#712)) ([208ff0a](208ff0a)) * **dash0:** explain chart Full range switch and status page visibility hint ([#702](#702)) ([9c6141b](9c6141b)) * **deps:** update github.com/dop251/goja digest to 5f913d1 ([#697](#697)) ([146cb22](146cb22)) * **deps:** update github.com/dop251/goja digest to 85be141 ([#706](#706)) ([c6abd8e](c6abd8e)) * **deps:** update github.com/dop251/goja digest to d535508 ([#696](#696)) ([7529c15](7529c15)) * **deps:** update github.com/dop251/goja digest to f818168 ([#709](#709)) ([7d03f42](7d03f42)) * **deps:** update go dependencies (non-major) ([#690](#690)) ([6de8ac7](6de8ac7)) * **deps:** update go dependencies (non-major) ([#694](#694)) ([0838916](0838916)) * **deps:** update go dependencies (non-major) ([#698](#698)) ([ea540e8](ea540e8)) * **deps:** update go dependencies (non-major) to v0.37.2 ([#704](#704)) ([67da7f7](67da7f7)) * **deps:** update module github.com/posthog/posthog-go to v1.39.0 ([#711](#711)) ([b2a7f2c](b2a7f2c)) * **deps:** update module github.com/prometheus/common to v0.73.0 ([#703](#703)) ([1ac4dc8](1ac4dc8)) * **deps:** update module github.com/slack-go/slack to v0.32.0 ([#707](#707)) ([74db3d2](74db3d2)) * ICMP capability for workers, escalation targets on events, login bug report and degraded incident fixes ([#701](#701)) ([9613f98](9613f98)) * **security:** device consent phishing guard and 2FA disable throttle ([#693](#693)) ([822186f](822186f)) * **security:** instance-wide budget and retention for anonymous bug-report screenshots ([#708](#708)) ([2be7787](2be7787)) * **security:** PAT org binding, subscribe throttle, invite lookup, SNMP secret ([#699](#699)) ([cdf59bb](cdf59bb)) * **security:** scope on-call override deletion to its schedule and org ([#714](#714)) ([6708f03](6708f03)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
fclairamb
added a commit
that referenced
this pull request
Nov 9, 2026
Follow-up to GHSA-rh8v-28gv-2q57. The authorization part of that advisory (deleting an override must stay within its org and schedule) shipped in #714 and is in v0.42.1 and later. This PR closes the remaining point: override changes left no audit trace. ## What changed - Creating or deleting an on-call override now records an `oncall_schedule.updated` audit event on the schedule. The event has `changed_fields: ["overrides"]` plus `override_action` (`created` / `deleted`), `override_uid`, `override_user_uid`, `override_start_at` and `override_end_at`. This follows the pattern `maintenance_window.updated` uses for its attached checks. The free-text reason is not recorded. - `DeleteOverride` now loads the override within its schedule (`GetOnCallScheduleOverride`) before deleting it, so the event can name whose cover was removed. The delete itself stays scoped to the schedule. - No new event type, no migration, no config change. dash0 already renders `oncall_schedule.*` through the generic configuration-event path. ## Docs - `web/docs/docs/features/audit-log.md`: the on-call row now mentions overrides. - `web/docs/docs/features/on-call.md`: overrides section says changes are audited. - `wiki/api-specification/events-catalogue.md`: the payload keys are documented. ## Tests New `server/internal/handlers/oncallschedules/audit_test.go` (SQLite): - Table-driven create/delete: each writes exactly one attributed row with the expected target and payload, and without the reason. - A refused cross-org delete records nothing in either org. Positive control: the same caller deleting their own override is recorded. Both tests fail on `main` and pass with this change. `go test -short` on `oncallschedules`, `events`, `audit` and `db/...` passes, and `golangci-lint run ./...` reports 0 issues. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 5.5 <[email protected]>
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.
Fixes GHSA-rh8v-28gv-2q57 (severity: high).
What changed
DELETE /api/v1/orgs/:org/on-call-schedules/:uid/overrides/:overrideUidnow resolves the org, loads the schedule within that org, and deletes the override only if it belongs to that schedule. Otherwise it answers 404 and deletes nothing.db.Service.DeleteOnCallScheduleOverrideandGetOnCallScheduleOverridenow take the schedule UID and filter onschedule_uid(SQLite and Postgres). Delete returnssql.ErrNoRowswhen no row matched.POST .../overrides: the service now loads the schedule within the org itself, and the override'suserUidmust be a member of the org (400VALIDATION_ERRORotherwise).userUidson create and PATCH) must also list org members only. Before this, another org's user could be put on a roster or an override and then show up incurrentlyOnCall.Service.ReplaceUsers, which skipped the membership check.List, get, preview, iCal and the other schedule endpoints were already scoped to the org.
Tests
oncallschedules/handler_test.go(HTTP, SQLite):main.dbcontract.runOnCall, which runs on both SQLite and Postgres) now checks that reads and deletes through another schedule fail and leave the row in place.go testpasses foroncallschedules,db/sqlite,db/postgres(testcontainers) andnotifications.golangci-lint run ./...reports 0 issues.🤖 Generated with Claude Code