Skip to content

Conversation

@jgallagher
Copy link
Contributor

The primary motivator behind this was to avoid accidentally logging all the trust quorum shares from RSS, so we include some relatively heavy-handed machinery to minimize the chances of reintroducing that in the future.

There are two structural changes here that I believe are correct regardless of the logging issue:

  1. The trust quorum share is now structurally separate from SledAgentRequest. It's still sent alongside SledAgentRequest when RSS initializes a remote sled, but not as part of the same structure.
  2. RSS generates trust quorum shares after creating the rack plan instead of as a part of creating the rack plan. This fixes RSS remembers all trust quorum shares #1361 where all rack shares were written down by RSS as part of the plan.

If you think the avoidance of #[derive(Serialize)] and the use of the danger_serialize_* functions is overboard, I'm certainly not wedded to them, but I think they're a reasonable starting point for discussion in terms of avoiding accidentally reintroducing leakage of the shares.

The primary motivator behind this was to avoid accidentally logging all
the trust quorum shares from RSS, so we include some relatively
heavy-handed machinery to minimize the chances of reintroducing that in
the future.
Copy link
Contributor

@andrewjstone andrewjstone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing this security hole and putting in some safeguards @jgallagher. Logged secret shares are the new logged passwords :)

fn danger_serialize_as_toml(&self) -> Result<String, toml::ser::Error> {
#[derive(Serialize)]
#[serde(remote = "PersistentSledAgentRequest")]
struct PersistentSledAgentRequestDef<'a> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does the Def suffix stand for?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Definition", I think; this is from https://serde.rs/remote-derive.html. In this case we don't need remote derive because we control the original type, but we choose to use it because the original type intentionally doesn't derive Serialize.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, cool it comes from serde example. Stick with it then!

@jgallagher jgallagher merged commit aaa3a58 into main Jul 12, 2022
@jgallagher jgallagher deleted the dont-log-trust-quorum-shares branch July 12, 2022 14:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

RSS remembers all trust quorum shares

3 participants