oxidecomputer / oxidecomputer/omicron
Wrap console session tokens and access tokens in `secrect::SecretString` or similar
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 572
- Forks
- 97
- Avg merge
- 2d 12h
- Merged PRs (30d)
- 96
Description
What
The console session token should be in a type that will zeroize the memory when it is dropped, so that it isn't at risk of accidental exposure due to something like Heartbleed, and that will obscure derived Debug impls, so it isn't accidentally logged. The secrecy crate provides a type to make handling a little easier, which is already a dependency in omicron, though it's not a hard requirement in case something else is desired.
Notes
A couple things I noticed:
- the public
ConsoleSessiontype can't exactly just swaptoken: Stringfortoken: SecretString, because the latter can't be used for derivingdiesel::Insertable. ConsoleSessionis used for other things that the database insert, such as session update. I presume that only the update operation would need a type that has the actual session token secret, while other operations such as update would only need to reference a session via a non-secret identified, which was brought up in https://github.com/oxidecomputer/omicron/issues/7818.
I imagine the above is true for the access tokens as well.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with nexus/src/app/session.rs, nexus/db-model/src/device_auth.rs, and nexus/db-model/src/console_session.rs, then read issue 7818 for the session identity discussion. Trace the session and access-token database and update operations, and determine how secret-bearing values can avoid accidental Debug exposure while remaining compatible with persistence. Done means both token types have safe handling without breaking their existing uses.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- authentication, security
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100