[Home]

Summary:ASTERISK-26006: Show offending IP for TLS setup failures in logs
Reporter:Oleksandr Natalenko (post-factum)Labels:
Date Opened:2016-05-10 06:24:14Date Closed:2019-07-01 10:06:47
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Channels/chan_sip/TCP-TLS Core/Logging
Versions:13.8.2 Frequency of
Occurrence
Related
Issues:
is related toASTERISK-28444 chan_pjsip: Peer IP for SSL handshake errors not logged
Environment:Arch Linux, KVMAttachments:
Description:Some tricky attackers could try to use Asterisk TLS port as HTTP/HTTPS proxy. Of course, that won't work for them, but the log is polluted with the following warnings and errors:

{code}
[May 10 14:21:21] ERROR[19119]: tcptls.c:609 handle_tcptls_connection: Problem setting up ssl connection: error:00000000:lib(0):func(0):reason(0)
[May 10 14:21:21] WARNING[19119]: tcptls.c:684 handle_tcptls_connection: FILE * open failed!
[May 10 14:21:21] ERROR[19141]: tcptls.c:609 handle_tcptls_connection: Problem setting up ssl connection: error:1407609B:SSL routines:SSL23_GET_CLIENT_HELLO:https proxy request
[May 10 14:21:21] WARNING[19141]: tcptls.c:684 handle_tcptls_connection: FILE * open failed!
{code}

It would be nice to see offending IP here to feed the log to something like fail2ban to have attackers banned.
Comments:By: Asterisk Team (asteriskteam) 2016-05-10 06:24:16.115-0500

Thanks for creating a report! The issue has entered the triage process. That means the issue will wait in this status until a Bug Marshal has an opportunity to review the issue. Once the issue has been reviewed you will receive comments regarding the next steps towards resolution.

A good first step is for you to review the [Asterisk Issue Guidelines|https://wiki.asterisk.org/wiki/display/AST/Asterisk+Issue+Guidelines] if you haven't already. The guidelines detail what is expected from an Asterisk issue report.

Then, if you are submitting a patch, please review the [Patch Contribution Process|https://wiki.asterisk.org/wiki/display/AST/Patch+Contribution+Process].

By: Joshua C. Colp (jcolp) 2016-05-10 06:26:30.404-0500

The fact we don't log out the IP address at all here is a bug I'd say.

By: Friendly Automation (friendly-automation) 2019-07-01 10:06:48.413-0500

Change 11499 merged by Friendly Automation:
tcptls.c:  Add peer hostname and port to some error messages

[https://gerrit.asterisk.org/c/asterisk/+/11499|https://gerrit.asterisk.org/c/asterisk/+/11499]

By: Friendly Automation (friendly-automation) 2019-07-01 10:22:06.821-0500

Change 11501 merged by George Joseph:
tcptls.c:  Add peer hostname and port to some error messages

[https://gerrit.asterisk.org/c/asterisk/+/11501|https://gerrit.asterisk.org/c/asterisk/+/11501]

By: Friendly Automation (friendly-automation) 2019-07-01 10:22:28.537-0500

Change 11502 merged by George Joseph:
tcptls.c:  Add peer hostname and port to some error messages

[https://gerrit.asterisk.org/c/asterisk/+/11502|https://gerrit.asterisk.org/c/asterisk/+/11502]