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

Khalil/6474 Gossipsub RPC control message Spam protection: GRAFT & PRUNE #4103

Merged
merged 138 commits into from Mar 27, 2023

Conversation

gomisha
Copy link
Contributor

@gomisha gomisha commented Mar 27, 2023

This PR adds spam protection for gossipsub RPC control messages (GRAFT & PRUNE). It adds a new ControlMsgValidationInspector which is a gossipsub RPC inspector that performs the following validation on control messages for each of the control types (GRAFT & PRUNE). These protections are important due to the fact that RPC messages are processed synchronously by libp2p and a malicious actor could exhaust the nodes resources or degrade the nodes network performance by spamming costly control messages.

  • Ensure RPC messages with a count > configured upper threshold are immediately rejected
  • Ensure RPC messages for specific control type are not rate limited for peer
  • Ensure RPC messages for specific control type < safety threshold < upper threshold have valid topic ID's
  • Ensure RPC messages with a count < safety threshold bypass validation

I suggest you start your review in the inspector package which contains all the new inspector logic and the control message validation inspector gossip spammer tests.

ref: https://github.com/dapperlabs/flow-go/pull/6555
author: @kc1116

gomisha and others added 30 commits February 17, 2023 11:55
workflow_dispatch: only on master-private branch
Please approve this workflow for security code scanning. Please let me know if you have any questions!
target-branch: "master-public"
added all directories with go.mod
…r-branches

Kan/run ci against all master branches
master* branch name match
revert back to `master` - test if CI not run
revert back to master*
…ter-branches

run ci against all master branches - `master-public`
kc1116 and others added 20 commits March 23, 2023 15:19
Co-authored-by: Peter Argue <89119817+peterargue@users.noreply.github.com>
Co-authored-by: Peter Argue <89119817+peterargue@users.noreply.github.com>
Khalil/6474 Gossupsub RPC control message Spam protection: GRAFT & PRUNE
@gomisha gomisha changed the title Private to public sync Khalil/6474 Gossupsub RPC control message Spam protection: GRAFT & PRUNE Mar 27, 2023
@gomisha gomisha changed the title Khalil/6474 Gossupsub RPC control message Spam protection: GRAFT & PRUNE Khalil/6474 Gossipsub RPC control message Spam protection: GRAFT & PRUNE Mar 27, 2023
@kc1116 kc1116 marked this pull request as ready for review March 27, 2023 20:57
@kc1116
Copy link
Contributor

kc1116 commented Mar 27, 2023

bors merge

@bors bors bot merged commit b500369 into onflow:master Mar 27, 2023
32 checks passed
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.

None yet

7 participants