Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

first implementation of the teamchain auditor #13544

Closed
wants to merge 7 commits into from
Closed

Conversation

maxtaco
Copy link
Contributor

@maxtaco maxtaco commented Aug 31, 2018

  • the goal of the teamchain auditor is to prevent the server from pulling off an "odd/even" attack. That is, when showing team acme to
    alice, the server sends even merkle roots, that show view A of the team. When showing team acme to bob, the server sends odd
    merkle roots, that show view B of the team. Where A and B might not agree at all. The server can hide these patterns in the
    merkle tree in arbitrary ways, with the goal to get alice and bob to see two different ideas of the same team, without forking
    the merkle tree globally.
  • our approach is for alice and bob to make random "probes". probe the time before the team was created, the time after the
    team was created, and ensure a consistent view.
  • after 1000 new merkle roots, the audit repeats, with alice and bob idependently auditing the recent roots.
  • for now, we've hardcoded parameters, but we'll likely want to tune them in the future.
  • write all audit results to disk cache.
  • also, while we're there, clean up the merkle client "first root with skip" logic

@maxtaco
Copy link
Contributor Author

maxtaco commented Sep 4, 2018

There's a bug somewhere in here that CI just found, likely in kbweb, so I added more debugging here: https://github.com/keybase/keybase/commit/3b566ab66f8290f5d39e44ff0a3d6e763883d3d0

go/teams/audit.go Outdated Show resolved Hide resolved
go/teams/audit.go Outdated Show resolved Hide resolved
@heronhaye
Copy link
Contributor

heronhaye commented Sep 5, 2018 via email

go/teams/ftl.go Outdated Show resolved Hide resolved
go/teams/ftl.go Show resolved Hide resolved
// ProbabilisticMerkleTeamAudit runs an audit on the links of the given team chain (or subchain).
// The security factor of the audit is a function of the platform type, and the amount of time
// since the last audit. This method should use some sort of long-lived cache (via local DB) so that
// previous audits can be combined with the current one.
func ProbabilisticMerkleTeamAudit(m libkb.MetaContext, id keybase1.TeamID, startMerkleSeqno keybase1.Seqno, chain []SCChainLink) (err error) {
return errors.New("stubbed out")
func (a *Auditor) AuditTeam(m libkb.MetaContext, id keybase1.TeamID, isPublic bool, headMerkle keybase1.MerkleRootV2, chain map[keybase1.Seqno]keybase1.LinkID, maxSeqno keybase1.Seqno) (err error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Comment ProbabilisticMerkleTeamAudit -> AuditTeam

Copy link
Contributor

Choose a reason for hiding this comment

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

Does subchain in the comment mean slice like for users or pick and choose like high set?

Copy link
Contributor

Choose a reason for hiding this comment

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

comment to remember what these args are

  • headMerkle: merkle root claimed by the first link in the team
  • maxSeqno: seqno of the tail of the team sigchain

Copy link
Contributor Author

Choose a reason for hiding this comment

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

no, it's just the most recent chain links we got from the server.

protocol/avdl/keybase1/teams.avdl Outdated Show resolved Hide resolved
protocol/avdl/keybase1/teams.avdl Outdated Show resolved Hide resolved
go/teams/audit.go Show resolved Hide resolved
go/libkb/merkle_client.go Show resolved Hide resolved
go/teams/audit.go Outdated Show resolved Hide resolved
go/teams/audit.go Show resolved Hide resolved
go/teams/audit.go Outdated Show resolved Hide resolved
@maxtaco
Copy link
Contributor Author

maxtaco commented Sep 6, 2018

@mlsteele / @heronhaye ok or do you guys want to keep reviewing?

- the goal of the teamchain auditor is to prevent the server from pulling off an "odd/even" attack. That is, when showing team acme to
alice, the server sends even merkle roots, that show view A of the team. When showing team acme to bob, the server sends odd
merkle roots, that show view B of the team. Where A and B might not agree at all. The server can hide these patterns in the
merkle tree in arbitrary ways, with the goal to get alice and bob to see two different ideas of the same team, without forking
the merkle tree globally.
- our approach is for alice and bob to make random "probes". the probe the team before the team was created, the time after the
team was created, and ensure a consistent view.
- after 1000 new merkle roots, the audit repeats, with alice and bob idependently auditing the recent roots.
- for now, we've hardcoded parameters, but we'll likely want to tune them in the future.
- write all audit results to disk cache.
maxtaco added a commit that referenced this pull request Sep 6, 2018
- the goal of the teamchain auditor is to prevent the server from pulling off an "odd/even" attack. That is, when showing team acme to
alice, the server sends even merkle roots, that show view A of the team. When showing team acme to bob, the server sends odd
merkle roots, that show view B of the team. Where A and B might not agree at all. The server can hide these patterns in the
merkle tree in arbitrary ways, with the goal to get alice and bob to see two different ideas of the same team, without forking
the merkle tree globally.
- our approach is for alice and bob to make random "probes". the probe the team before the team was created, the time after the
team was created, and ensure a consistent view.
- after 1000 new merkle roots, the audit repeats, with alice and bob idependently auditing the recent roots.
- for now, we've hardcoded parameters, but we'll likely want to tune them in the future.
- write all audit results to disk cache.
- merge by hand since github is down
- also @mlsteele might have further comments
brayoh pushed a commit that referenced this pull request Sep 6, 2018
- the goal of the teamchain auditor is to prevent the server from pulling off an "odd/even" attack. That is, when showing team acme to
alice, the server sends even merkle roots, that show view A of the team. When showing team acme to bob, the server sends odd
merkle roots, that show view B of the team. Where A and B might not agree at all. The server can hide these patterns in the
merkle tree in arbitrary ways, with the goal to get alice and bob to see two different ideas of the same team, without forking
the merkle tree globally.
- our approach is for alice and bob to make random "probes". the probe the team before the team was created, the time after the
team was created, and ensure a consistent view.
- after 1000 new merkle roots, the audit repeats, with alice and bob idependently auditing the recent roots.
- for now, we've hardcoded parameters, but we'll likely want to tune them in the future.
- write all audit results to disk cache.
- merge by hand since github is down
- also @mlsteele might have further comments
mmaxim pushed a commit that referenced this pull request Sep 6, 2018
- the goal of the teamchain auditor is to prevent the server from pulling off an "odd/even" attack. That is, when showing team acme to
alice, the server sends even merkle roots, that show view A of the team. When showing team acme to bob, the server sends odd
merkle roots, that show view B of the team. Where A and B might not agree at all. The server can hide these patterns in the
merkle tree in arbitrary ways, with the goal to get alice and bob to see two different ideas of the same team, without forking
the merkle tree globally.
- our approach is for alice and bob to make random "probes". the probe the team before the team was created, the time after the
team was created, and ensure a consistent view.
- after 1000 new merkle roots, the audit repeats, with alice and bob idependently auditing the recent roots.
- for now, we've hardcoded parameters, but we'll likely want to tune them in the future.
- write all audit results to disk cache.
- merge by hand since github is down
- also @mlsteele might have further comments
Copy link
Contributor

@mlsteele mlsteele left a comment

Choose a reason for hiding this comment

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

I think this makes sense. Seems like a lot of complexity, which might stem from storing the history that way. Has anyone written anything about the probabilities of discovering an attack this way?

@maxtaco
Copy link
Contributor Author

maxtaco commented Sep 7, 2018

No, we should try to come up with a proof of some sort given my back-of-the-envelope calculations. The logic is similar to Miller-Rabin primality testing.

@maxtaco maxtaco closed this Sep 28, 2018
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.

3 participants