fix(core/api): gate token mint + revoke on sentinel:all#80
Merged
Conversation
POST /core/token and DELETE /core/token/:id were entirely ungated. Anyone reaching the API could mint a JWT claiming any entity at any scope (including sentinel:all itself) or revoke arbitrary tokens by ID. These are the highest-blast-radius operations in core; any mitigating factor (network segmentation, etc) was the only thing saving us. Both now require sentinel:all on the bearer — same convention used elsewhere for first-party-only operations. No new audit surface added; just turning on the gate.
7 tasks
This was referenced Jun 17, 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.
Audit hole
The most severe gap from the post-s2s-auth audit:
Fix
Both now `Require(c, RequestTokenHasScope(c, "sentinel:all"))`. Internal services (sentinel-core/discord/oauth/saml) already carry `sentinel:all` after PR #79, so they keep working. Any third-party caller or unauthed request is now 401.
This is the first in a stack of "harden core API gates" PRs. After this lands:
Test plan