Security: avoid a single peer providing a majority of Zebra's peer addresses #2004
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.
Motivation
We don't want a single peer to supply a majority of Zebra's addresses, because that makes takeover attacks easier.
Solution
Zebra avoids having a majority of addresses from a single peer by asking 3 peers for new addresses.
(This is a best-effort preventative measure - for a stronger guarantee, see #1869.)
Also update a bunch of security comments and related documentation.
The code in this pull request has:
Review
@dconnolly and I discussed this change as part of #1850. It's not an urgent fix, but it's worth doing soon.
Follow Up Work
Limit the number of addresses we use from each peer (#1869)