notify of connection at earliest step, pause, proceed #3546
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.
In the server, I have added a systemd log message for a new connection in the earliest connection steps, followed by a pause. The quarter-second pause gives a log subscriber the opportunity to intervene before the connection is finalized.
Before I deploy this to more servers, I wonder if anyone has any insights about how this approach might fail, or how it could be done better.
I will use this modification along with a Python script to protect against bot and social engineering attacks from networks known for hosting these, which will also block a very small amount of legitimate traffic originating from the Philippines. I will keep an eye out for scenarios where VPNs bypass bad routing for legitimate users, and I'll avoid deploying this modified server near them. If others use this patch, these network insights can be shared.
I'm also making a PR to see if it triggers a build that I/anyone can use. A PR will also help me patch the next release when it's available.