oxidecomputer / oxidecomputer/omicron

Audit log `logout` (session delete) endpoint

Open
#9,774 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
572
Forks
97
Avg merge
2d 12h
Merged PRs (30d)
96

Description

Followup to #9773 — logout is currently the only API operation that needs audit logging but doesn't have it. This sounds more urgent than it is because sessions are a lot more likely to be deleted due to expiry (an event that is not currently logged because it is not a discrete API operation) than they are to be deleted by a call to logout — any request that comes in with an expired session causes that session to be hard deleted:

https://github.com/oxidecomputer/omicron/blob/10f6883efb4eb5cbaa5a3e8189e8302ab93f548c/nexus/auth/src/authn/external/session_cookie.rs#L134-L138

https://github.com/oxidecomputer/omicron/blob/10f6883efb4eb5cbaa5a3e8189e8302ab93f548c/nexus/src/context.rs#L529-L532

Audit logging logout requires a tiny bit of work because the endpoint does auth in a funny way: we just try to delete a session matching the provided token. If the token doesn't match anything, it's a noop, and the request goes through fine. In order to make logging work we'd probably have to separate the lookup of the session from the delete in order to have a session ID to write down:

  1. Look up session by token
  2. Log logout call with session ID
  3. Delete token
  4. Complete log

https://github.com/oxidecomputer/omicron/blob/10f6883efb4eb5cbaa5a3e8189e8302ab93f548c/nexus/src/external_api/http_entrypoints.rs#L8125-L8144

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the logout handler in nexus/src/external_api/http_entrypoints.rs at lines 8125-8144, then read the session deletion paths in nexus/auth/src/authn/external/session_cookie.rs and nexus/src/context.rs. Trace how the token lookup and deletion work, preserving the no-op behavior for unknown tokens. Done means logout writes an audit event containing the session ID and completes the deletion flow.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
api, authentication, security
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.