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

RFC: Improve address logging on early exit messages #83

Merged
merged 1 commit into from
Mar 18, 2020

Conversation

ldir-EDB0
Copy link
Contributor

Change 'Early exit' and 'Exit before auth' messages to include the IP
address & port as part of the message.

This allows log scanning utilities such as 'fail2ban' to obtain the
offending IP address as part of the failure event instead of extracting
the PID from the message and then scanning the log again for match
'child connection from' messages

Signed-off-by: Kevin Darbyshire-Bryant ldir@darbyshire-bryant.me.uk

Delimiting with < > may be a step too far... or the whole idea... hence the RFC :-)

Change 'Early exit' and 'Exit before auth' messages to include the IP
address & port as part of the message.

This allows log scanning utilities such as 'fail2ban' to obtain the
offending IP address as part of the failure event instead of extracting
the PID from the message and then scanning the log again for match
'child connection from' messages

Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
@mkj
Copy link
Owner

mkj commented Oct 16, 2019 via email

Repository owner deleted a comment from CatAnonymous Nov 27, 2019
@ldir-EDB0
Copy link
Contributor Author

Friendly ping

@ldir-EDB0
Copy link
Contributor Author

Ping

@mkj mkj merged commit fa4c464 into mkj:master Mar 18, 2020
@mkj
Copy link
Owner

mkj commented Mar 18, 2020

Thanks

@mkj
Copy link
Owner

mkj commented Mar 18, 2020

I've changed the format slightly in 201e359. It wasn't handling some cases where addrstring hadn't been set yet.

@MichaIng
Copy link
Contributor

MichaIng commented Jul 10, 2024

When doing changes which are intended to help software like Fail2Ban, while containing breaking changes for them, it makes sense to communicate it, or send a commit with the needed filter changes. The Fail2Ban Dropbear filter was now partly broken for several years 😉: fail2ban/fail2ban#3791

Another issue: "Login attempt for nonexistent user" is no early exit message, hence those do now not contain a host anymore and are impossible to track with this change. I can send a PR to revert this part of the code, if wanted. I think it is important.

EDIT: I guess the same is true for "Login attempt with wrong user", but I cannot test it quickly now.

EDIT2: Too important to communicate through a closed PR, hence here the partial revert: #316

MichaIng added a commit to MichaIng/dropbear that referenced this pull request Jul 10, 2024
mkj#83 removed the host from the final message part of early exit messages, and added it to the initial message part instead. This was however done for "Login attempt for nonexistent user" as well, which is no early exit message, but allows the client to keep trying. Those log entries hence now do not contain a host anymore.

This PR reverts this part of mkj#83 to restore the missing host, and re-enable software like Fail2Ban to track these login failures.

Signed-off-by: MichaIng <micha@dietpi.com>
mkj pushed a commit that referenced this pull request Oct 21, 2024
#83 removed the host from the final message part of early exit messages, and added it to the initial message part instead. This was however done for "Login attempt for nonexistent user" as well, which is no early exit message, but allows the client to keep trying. Those log entries hence now do not contain a host anymore.

This PR reverts this part of #83 to restore the missing host, and re-enable software like Fail2Ban to track these login failures.

Signed-off-by: MichaIng <micha@dietpi.com>
MichaIng added a commit to MichaIng/dropbear that referenced this pull request Dec 30, 2024
As discussed and fixed in mkj#316 for "nonexistent user" logs, this commit additionally reverts mkj#83 for "wrong user" logs, to re-add the remote host to the those log entries.

Signed-off-by: MichaIng <micha@dietpi.com>
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