feat(snuba): send service auth for snuba deletes - #122094
Draft
phacops wants to merge 1 commit into
Draft
Conversation
Mint a short-lived audience-bound JWT after Sentry has already authorized the delete. Attach it only on HTTP DELETE and EndpointDeleteTraceItems. Claims come from server-side project/org ids, never request-body passthrough. Read paths are unchanged.
Contributor
Backend Test FailuresFailures on
|
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.
summary
Sentry now mints a short-lived
aud=snuba-deletesJWT for Snuba destructive calls only.DELETE /{storage}via_raw_delete_queryEndpointDeleteTraceItemsviadelete_trace_items_rpcproject_ids/organization_idstaken from the already-authorized server-side delete request, not from a user body passthroughSENTRY_SNUBA_DELETE_AUTH_SECRETis unset, no header is sent so this PR can land before snuba enforcePairs with getsentry/snuba#8310 (AuthN) and #8311 (predicate AuthZ).
threat addressed
Without this, snuba AuthN has no legitimate caller and product deletes 401 after #8310. Tokens carry the tenant ids AuthZ will check.
non-goals
rollout
SENTRY_SNUBA_DELETE_AUTH_SECRETto the same value as snubaSNUBA_DELETE_SERVICE_AUTH_SECRET.rollback
Revert this PR. If snuba AuthN is already enforced, deletes 401 until the secret/header path is restored.
test plan
test_mint_token_contains_authorized_idstest_auth_headers_are_bearertest_missing_secret_omits_headerstest_missing_secret_mint_fails_closedresidual risk
sentry-queryvssentry-deleteidentities (PR F).delete_request,delete_groups_from_eap_rpc, preprod artifact delete) build those ids from trusted server-side arguments.