Repository navigation
feat(auth): emit OCSF events for credential-less gateway requests - #4632
Merged
Merged
Conversation
|
🌿 Preview your docs: https://nvidia-preview-pr-4632.docs.buildwithfern.com/openshell |
Requests the gateway rejects before consulting any authenticator now emit an OCSF Authentication [3002] event: no credential presented, mTLS required without a client certificate, or an operator certificate combined with an authorization header. Each event carries a reason category in status_detail and never the presented credential. The response returned to the caller is unchanged. openshell-ocsf gains the Authentication class with user and service objects, and a shared OcsfCapture test layer. Schema validation now rejects attributes the class does not define and profile attributes whose profile the event does not declare. Refs #2912 Signed-off-by: Kris Hicks <khicks@nvidia.com>
krishicks
force-pushed
the
feat/2912-gateway-auth-failure-events/krishicks
branch
from
October 16, 2026 00:04
adb1456 to
99f8ad1
Compare
TaylorMutch
approved these changes
Oct 16, 2026
5 of 6 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
The gateway now emits an OCSF Authentication [3002] event when it rejects a gRPC request before consulting any authenticator. This is the first of several PRs for #2912: it adds the Authentication event class and emits it for the rejections the router makes on its own.
Related Issue
Refs #2912
This is one of several PRs that together satisfy #2912, so it does not close the issue. The remaining work is listed under Follow-ups.
Changes
Events:
AuthGrpcRouteremits an Authentication failure event for three rejections. The response returned to the caller is unchanged.status_detailmissing_credentialmissing_credentialmtlsauthorizationheaderconflicting_credentialsmtlsNo identity is established in these cases, so
useris a fixed placeholder,{name: "unknown", type_id: 0}. Events never include presented credentials or headers.openshell-ocsf:UserandServiceobjects,AuthProtocolIdandUserTypeIdenums, shorthand output (AUTH:LOGON ...), and vendored 1.8 schemas forauthentication,userandservice.auth_protocol_other(), which records 99 Other.test_support::OcsfCapture, a tracing layer that records the OCSF events emitted during a test. It replaces the test-localProbeLayerinservice_routing.rs.Schema validation:
validate_known_fieldsrejects attributes the class doesn't define, and profile attributes whose profilemetadata.profilesdoesn't declare.apion Authentication belongs to thecloudprofile, so the gRPC method goes inhttp_request.url.pathinstead. The top-levelcontainerattribute is invalid in every OCSF version, so this builder omits it.container. Fixing them is separate work.Docs:
logging.mdxandocsf-json-export.mdxget theAUTH:/ 3002 class rows, a shorthand example, and a note on the reason categories.Follow-ups
Later PRs for #2912 will add:
device.os.type_idis missing from every OpenShell event and will be fixed separately.Testing
cargo nextest runonopenshell-ocsfand every crate that depends on it: 4361 passed. One environment-dependent proxy test failed twice, then passed onmain, on this commit in a separate checkout, and three times on rerun here.-D warningson every target inrust:lint(workspace, sandboxperf-harness, e2e, two examples)cargo check --workspace --all-targetsOcsfCaptureChecklist