Repository navigation
feat(auth): classify rejected gateway credentials in authentication events - #4655
Merged
Merged
Conversation
TaylorMutch
previously approved these changes
Oct 16, 2026
…vents Authenticators now return the mechanism and a reason category with the status they reject a request with, and the gateway router records both in the Authentication event. Callers still receive the original status. Refs #2912 Signed-off-by: Kris Hicks <[email protected]>
krishicks
force-pushed
the
feat/2912-classify-auth-failures/krishicks
branch
from
October 16, 2026 19:51
ddd9687 to
fb6be6d
Compare
TaylorMutch
approved these changes
Oct 16, 2026
Compatibility review (advisory)New or updated breaking changes; see the full report for all findings. 1. api-behavior — No explicit risk acceptance foundGateway OCSF Authentication output changes from two documented
Review details
Advisory review; publication gates are unchanged. |
Collaborator
These are new changes on top of recent work and have yet to be released, no compatibility issue. |
8 tasks
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
When an authenticator rejects a presented credential, the gateway now emits an OCSF Authentication event that names the mechanism and a low-cardinality reason category. Previously only credential-less requests were recorded (#4632). Callers receive exactly the same gRPC status as before.
Related Issue
Refs #2912
This is the second of several PRs that together satisfy #2912, so it does not close the issue. The remaining work is listed under Follow-ups.
Changes
AuthRejection(mechanism, reason, and the status sent to the caller) instead of a bareStatus. There is no blanket conversion toStatus, so dropping the classification has to be explicit.Declinedoutcome lets an authenticator report a credential it rejected while the chain still falls through to other authenticators. A decline only classifies the request when no other authenticator accepts or rejects it. The peer authenticator declines tokens thatTokenReviewrejects.OpenID): expired, issuer/audience mismatch, malformed, invalid signature/key/algorithm, and JWKS refresh failures asidentity_provider_unavailable.sandbox_jwt: session token verification errors, plus persisted-identity checks (unknown_identityfor deleted sandboxes,stale_identityfor replaced runtimes, revoked epochs, and consumed tokens).k8s_service_account: TokenReview/pod lookup outages, audience mismatch, wrong service account or labels, replaced pods, and invalid pod bindings.compute_driver: classified by the driver's gRPC status code.RefreshSandboxTokendefers lineage checks to its handler, which now emits the same event for its own authentication rejections.AuthMechanismandAuthFailureReasonlive with the authentication model. Category strings, severities, and OCSF protocol mapping stay inauth/audit.rs.ocsf-json-export.mdxlists mechanism labels and the reason/severity table.Events never include presented credentials, headers, or verification error text. An unverified token payload is never used for classification.
Testing
cargo nextest run -p openshell-server -p openshell-ocsf(2465 passed)cargo clippy --workspace --all-targets -- -D warningsFollow-ups
IssueSandboxTokenChecklist