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

[FEATURE] With ERROR:proto_wss: log the IP address #2997

Open
robdyck opened this issue Jan 19, 2023 · 7 comments
Open

[FEATURE] With ERROR:proto_wss: log the IP address #2997

robdyck opened this issue Jan 19, 2023 · 7 comments

Comments

@robdyck
Copy link
Contributor

robdyck commented Jan 19, 2023

Is your feature request related to a problem? Please describe.

When a proto_wss error occurs it would be helpful if the source IP address was logged. It would then enable creating a Fail2ban filter and ban the address if it repeats.

Describe the solution you'd like
With other protocols it is possible to extract the source IP from the message and use xlog to pass that information to the logging facility. With proto_wss and tls generally it seems that the message isn't available to the script until the handshake completes. In the absence of wss, tls does generate a log that identifies the source IP address when the handshake fails.

For example a tls failure here identifies 205.185.123.115

``Jan 19 06:28:16 slim.mylan /usr/local/sbin/opensips[1988340]: ERROR:tls_openssl:openssl_tls_accept: New TLS connection from 205.185.123.115:53322 failed to accept

Jan 19 06:28:16 slim.mylan /usr/local/sbin/opensips[1988340]: ERROR:tls_openssl:tls_print_errstack: TLS errstack: error:0A000126:SSL routines::unexpected eof while reading

Jan 19 06:28:16 slim.mylan /usr/local/sbin/opensips[1988340]: ERROR:proto_wss:wss_read_req: cannot fix read connection
``

wss example, no identifying information

``Jan 19 09:38:35 slim.mylan /usr/local/sbin/opensips[1988340]: ERROR:proto_wss:ws_parse_req_handshake: Upgrade header not present!

Jan 19 09:38:35 slim.mylan /usr/local/sbin/opensips[1988340]: ERROR:proto_wss:ws_parse_req_handshake: Connection header not present!

Jan 19 09:38:35 slim.mylan /usr/local/sbin/opensips[1988340]: ERROR:proto_wss:ws_parse_req_handshake: Origin header not present!

Jan 19 09:38:35 slim.mylan /usr/local/sbin/opensips[1988340]: ERROR:proto_wss:ws_parse_req_handshake: Sec-WebSocket-Key header not present or does not have the desired length (24)!

Jan 19 09:38:35 slim.mylan /usr/local/sbin/opensips[1988340]: ERROR:proto_wss:ws_parse_req_handshake: Sec-WebSocket-Version header not present!

Jan 19 09:38:35 slim.mylan /usr/local/sbin/opensips[1988340]: ERROR:proto_wss:ws_parse_req_handshake: Sec-WebSocket-Protocol header not present!

Jan 19 09:38:35 slim.mylan /usr/local/sbin/opensips[1988340]: ERROR:proto_wss:wss_read_req: cannot complete WebSocket handshake

Jan 19 09:38:35 slim.mylan /usr/local/sbin/opensips[1988340]: WARNING:proto_wss:ws_server_handshake: extra data on socket before handshake is completed!

Jan 19 09:38:35 slim.mylan /usr/local/sbin/opensips[1988340]: ERROR:proto_wss:wss_read_req: cannot complete WebSocket handshake
``

  • Component: proto_wss
  • Type: log
  • Name:

Describe alternatives you've considered

@github-actions
Copy link

github-actions bot commented Feb 4, 2023

Any updates here? No progress has been made in the last 15 days, marking as stale. Will close this issue if no further updates are made in the next 30 days.

@github-actions github-actions bot added the stale label Feb 4, 2023
@robdyck
Copy link
Contributor Author

robdyck commented Feb 4, 2023

I was hoping for some comment from a developer. Good idea yes/no. Probably few people have to deal with wss.

@stale stale bot removed the stale label Feb 4, 2023
@vasilevalex
Copy link
Contributor

IMHO, there is often HA-proxy, nginx or some other TCP load-balancer in front of WSS SIP. So logging of load-balancer IP-address is not very helpful.

@github-actions
Copy link

Any updates here? No progress has been made in the last 15 days, marking as stale. Will close this issue if no further updates are made in the next 30 days.

@github-actions github-actions bot added the stale label Feb 20, 2023
@razvancrainea
Copy link
Member

I agree logging the IP might be helpful for some people. And for those who don't find it useful (i.e. what @vasilevalex's examples), I don't see any harm done logging the IP. So let's keep this feature request open.

@github-actions github-actions bot removed the stale label Feb 21, 2023
@github-actions
Copy link

github-actions bot commented Mar 8, 2023

Any updates here? No progress has been made in the last 15 days, marking as stale. Will close this issue if no further updates are made in the next 30 days.

@github-actions github-actions bot added the stale label Mar 8, 2023
@github-actions
Copy link

github-actions bot commented Apr 9, 2023

Marking as closed due to lack of progress for more than 30 days. If this issue is still relevant, please re-open it with additional details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants