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

logging: Add canonical log for misbehaving peers #1600

Merged
merged 5 commits into from
Jun 26, 2022

Conversation

MarcoPolo
Copy link
Collaborator

@MarcoPolo MarcoPolo commented Jun 15, 2022

Adds logging when a peer fails our security handshake or fails to setup a muxer

@MarcoPolo MarcoPolo marked this pull request as ready for review June 22, 2022 19:47
Copy link
Contributor

@marten-seemann marten-seemann left a comment

Choose a reason for hiding this comment

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

Can we somehow filter out multistream errors here? Setup can fail if there's no compatible security protocol / muxer between those two peers. It seems odd to block a peer for that, doesn't it?

@MarcoPolo
Copy link
Collaborator Author

Setup can fail if there's no compatible security protocol / muxer between those two peers. It seems odd to block a peer for that, doesn't it?

If a peer doesn't have compatible security or muxer, will it ever successfully connect? We close the connection here right after a failure.

The idea with tools like fail2ban is that they won't ban a node for misbehaving once, but many times. For example, if I mistyped my password once, I wouldn't want to ban myself for N minutes. But if a node sends 100 wrong password attempts it is probably malicious.

Likewise here. If a node is constantly hitting this it's probably doing something bad. Right? Or am I missing something?

@marten-seemann
Copy link
Contributor

If a peer doesn't have compatible security or muxer, will it ever successfully connect? We close the connection here right after a failure.

That peer might not, but there might be other peers running on the same machine (Hydras?), with potentially different configurations.

The idea with tools like fail2ban is that they won't ban a node for misbehaving once, but many times. For example, if I mistyped my password once, I wouldn't want to ban myself for N minutes. But if a node sends 100 wrong password attempts it is probably malicious.

This alleviates a lot of my concerns. I'm still wondering if we should move this into the security handshake implementation (TLS and Noise). What do you think?

@MarcoPolo
Copy link
Collaborator Author

@marten-seemann updated

@marten-seemann marten-seemann merged commit 8cb44cb into master Jun 26, 2022
@marten-seemann marten-seemann deleted the marco/canonical-logging branch June 26, 2022 10:38
@MarcoPolo MarcoPolo mentioned this pull request Jul 7, 2022
41 tasks
@ajnavarro ajnavarro mentioned this pull request Aug 24, 2022
72 tasks
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.

2 participants