Repository navigation
turnserver is creating very large logfiles #626
Copy link
Copy link
Closed
Labels
Description
Today I wondered why the harddisk of our server ran out of memory: Because coturn created logs between 100 and 200 MB per day. It is creating entries even when nobody is using it (via Nextcloud Talk).
Coturn-4.5.0.7
Ubtuntu 18.04.5
What can I do against this?
tail -n 100 turn_1037_2020-09-11.log
1892935: session 001000000000098249: realm <turn.example.de> user <>: incoming packet BINDING processed, success
1892935: session 001000000000098249: realm <turn.example.de> user <>: incoming packet BINDING processed, success
1892935: session 001000000000098249: realm <turn.example.de> user <>: incoming packet BINDING processed, success
1892935: session 001000000000098249: realm <turn.example.de> user <>: incoming packet BINDING processed, success
1892935: session 001000000000098249: realm <turn.example.de> user <>: incoming packet BINDING processed, success
1892935: session 001000000000098249: realm <turn.example.de> user <>: incoming packet BINDING processed, success
1892935: session 001000000000098249: realm <turn.example.de> user <>: incoming packet BINDING processed, success
1892935: session 001000000000098249: realm <turn.example.de> user <>: incoming packet BINDING processed, success
1892935: session 001000000000098249: realm <turn.example.de> user <>: incoming packet BINDING processed, success
1892935: session 001000000000098249: realm <turn.example.de> user <>: incoming packet BINDING processed, success
1892936: session 001000000000098249: realm <turn.example.de> user <>: incoming packet BINDING processed, success
1892936: session 001000000000098249: realm <turn.example.de> user <>: incoming packet BINDING processed, success
1892936: session 001000000000098249: realm <turn.example.de> user <>: incoming packet BINDING processed, success
1892936: session 001000000000098249: realm <turn.example.de> user <>: incoming packet BINDING processed, success
1892936: session 001000000000098249: realm <turn.example.de> user <>: incoming packet BINDING processed, success
1892936: session 001000000000098249: realm <turn.example.de> user <>: incoming packet BINDING processed, success
1892937: session 001000000000098249: realm <turn.example.de> user <>: incoming packet BINDING processed, success
1892937: session 001000000000098249: realm <turn.example.de> user <>: incoming packet BINDING processed, success
1892937: session 001000000000098249: realm <turn.example.de> user <>: incoming packet BINDING processed, success
1892937: session 001000000000098249: realm <turn.example.de> user <>: incoming packet BINDING processed, success
1892937: session 001000000000098249: realm <turn.example.de> user <>: incoming packet BINDING processed, success
1892937: session 001000000000098249: realm <turn.example.de> user <>: incoming packet BINDING processed, success
1892938: session 001000000000098249: realm <turn.example.de> user <>: incoming packet BINDING processed, success
1892938: session 001000000000098249: realm <turn.example.de> user <>: incoming packet BINDING processed, success
1892938: session 001000000000098249: realm <turn.example.de> user <>: incoming packet BINDING processed, success
1892938: session 001000000000098249: realm <turn.example.de> user <>: incoming packet BINDING processed, success
1892938: session 001000000000098249: realm <turn.example.de> user <>: incoming packet BINDING processed, success
1892938: session 001000000000098249: realm <turn.example.de> user <>: incoming packet BINDING processed, success
1892939: session 001000000000098249: realm <turn.example.de> user <>: incoming packet BINDING processed, success
1892939: session 001000000000098249: realm <turn.example.de> user <>: incoming packet BINDING processed, success
1892939: session 001000000000098249: realm <turn.example.de> user <>: incoming packet BINDING processed, success
1892939: session 001000000000098249: realm <turn.example.de> user <>: incoming packet BINDING processed, success
1892939: session 001000000000098249: realm <turn.example.de> user <>: incoming packet BINDING processed, success
1892939: session 001000000000098249: realm <turn.example.de> user <>: incoming packet BINDING processed, success
1892939: session 001000000000098249: realm <turn.example.de> user <>: incoming packet BINDING processed, success
1892939: session 001000000000098249: realm <turn.example.de> user <>: incoming packet BINDING processed, success
1892939: session 001000000000098249: realm <turn.example.de> user <>: incoming packet BINDING processed, success
1892939: session 001000000000098249: realm <turn.example.de> user <>: incoming packet BINDING processed, success
1892939: session 001000000000098249: realm <turn.example.de> user <>: incoming packet BINDING processed, success
1892939: session 001000000000098249: realm <turn.example.de> user <>: incoming packet BINDING processed, success
1892940: session 001000000000098249: realm <turn.example.de> user <>: incoming packet BINDING processed, success
1892940: session 001000000000098249: realm <turn.example.de> user <>: incoming packet BINDING processed, success
1892940: session 001000000000098249: realm <turn.example.de> user <>: incoming packet BINDING processed, success
1892940: session 001000000000098249: realm <turn.example.de> user <>: incoming packet BINDING processed, success
1892940: session 001000000000098249: realm <turn.example.de> user <>: incoming packet BINDING processed, success
1892940: session 001000000000098249: realm <turn.example.de> user <>: incoming packet BINDING processed, success
1892941: session 001000000000098249: realm <turn.example.de> user <>: incoming packet BINDING processed, success
1892941: session 001000000000098249: realm <turn.example.de> user <>: incoming packet BINDING processed, success
1892941: session 001000000000098249: realm <turn.example.de> user <>: incoming packet BINDING processed, success
1892941: session 001000000000098249: realm <turn.example.de> user <>: incoming packet BINDING processed, success
1892941: session 001000000000098249: realm <turn.example.de> user <>: incoming packet BINDING processed, success
1892941: session 001000000000098249: realm <turn.example.de> user <>: incoming packet BINDING processed, success
1892942: session 001000000000098249: realm <turn.example.de> user <>: incoming packet BINDING processed, success
1892942: session 001000000000098249: realm <turn.example.de> user <>: incoming packet BINDING processed, success
1892942: session 001000000000098249: realm <turn.example.de> user <>: incoming packet BINDING processed, success
1892942: session 001000000000098249: realm <turn.example.de> user <>: incoming packet BINDING processed, success
1892942: session 001000000000098249: realm <turn.example.de> user <>: incoming packet BINDING processed, success
1892942: session 001000000000098249: realm <turn.example.de> user <>: incoming packet BINDING processed, success
1892943: session 001000000000098249: realm <turn.example.de> user <>: incoming packet BINDING processed, success
1892943: session 001000000000098249: realm <turn.example.de> user <>: incoming packet BINDING processed, success
1892943: session 001000000000098249: realm <turn.example.de> user <>: incoming packet BINDING processed, success
1892943: session 001000000000098249: realm <turn.example.de> user <>: incoming packet BINDING processed, success
1892943: session 001000000000098249: realm <turn.example.de> user <>: incoming packet BINDING processed, success
1892943: session 001000000000098249: realm <turn.example.de> user <>: incoming packet BINDING processed, success
1892943: session 001000000000098249: realm <turn.example.de> user <>: incoming packet BINDING processed, success
1892943: session 001000000000098249: realm <turn.example.de> user <>: incoming packet BINDING processed, success
1892943: session 001000000000098249: realm <turn.example.de> user <>: incoming packet BINDING processed, success
1892943: session 001000000000098249: realm <turn.example.de> user <>: incoming packet BINDING processed, success
1892944: session 001000000000098249: realm <turn.example.de> user <>: incoming packet BINDING processed, success
1892944: session 001000000000098249: realm <turn.example.de> user <>: incoming packet BINDING processed, success
1892944: session 001000000000098249: realm <turn.example.de> user <>: incoming packet BINDING processed, success
1892944: session 001000000000098249: realm <turn.example.de> user <>: incoming packet BINDING processed, success
1892944: session 001000000000098249: realm <turn.example.de> user <>: incoming packet BINDING processed, success
1892944: session 001000000000098249: realm <turn.example.de> user <>: incoming packet BINDING processed, success
1892944: session 001000000000098249: realm <turn.example.de> user <>: incoming packet BINDING processed, success
1892944: session 001000000000098249: realm <turn.example.de> user <>: incoming packet BINDING processed, success
1892945: session 001000000000098249: realm <turn.example.de> user <>: incoming packet BINDING processed, success
1892945: session 001000000000098249: realm <turn.example.de> user <>: incoming packet BINDING processed, success
1892945: session 001000000000098249: realm <turn.example.de> user <>: incoming packet BINDING processed, success
1892945: session 001000000000098249: realm <turn.example.de> user <>: incoming packet BINDING processed, success
1892945: session 001000000000098249: realm <turn.example.de> user <>: incoming packet BINDING processed, success
1892945: session 001000000000098249: realm <turn.example.de> user <>: incoming packet BINDING processed, success
1892946: session 001000000000098249: realm <turn.example.de> user <>: incoming packet BINDING processed, success
1892946: session 001000000000098249: realm <turn.example.de> user <>: incoming packet BINDING processed, success
1892946: session 001000000000098249: realm <turn.example.de> user <>: incoming packet BINDING processed, success
1892946: session 001000000000098249: realm <turn.example.de> user <>: incoming packet BINDING processed, success
1892946: session 001000000000098249: realm <turn.example.de> user <>: incoming packet BINDING processed, success
1892946: session 001000000000098249: realm <turn.example.de> user <>: incoming packet BINDING processed, success
1892947: session 001000000000098249: realm <turn.example.de> user <>: incoming packet BINDING processed, success
1892947: session 001000000000098249: realm <turn.example.de> user <>: incoming packet BINDING processed, success
1892947: session 001000000000098249: realm <turn.example.de> user <>: incoming packet BINDING processed, success
1892947: session 001000000000098249: realm <turn.example.de> user <>: incoming packet BINDING processed, success
1892947: session 001000000000098249: realm <turn.example.de> user <>: incoming packet BINDING processed, success
1892947: session 001000000000098249: realm <turn.example.de> user <>: incoming packet BINDING processed, success
1892948: session 001000000000098249: realm <turn.example.de> user <>: incoming packet BINDING processed, success
1892948: session 001000000000098249: realm <turn.example.de> user <>: incoming packet BINDING processed, success
1892948: session 001000000000098249: realm <turn.example.de> user <>: incoming packet BINDING processed, success
1892948: session 001000000000098249: realm <turn.example.de> user <>: incoming packet BINDING processed, success
1892948: session 001000000000098249: realm <turn.example.de> user <>: incoming packet BINDING processed, success
1892948: session 001000000000098249: realm <turn.example.de> user <>: incoming packet BINDING processed, success
listening-port=3478
tls-listening-port=443
fingerprint
lt-cred-mech
user=turnuser:asd3Jdask-Vsd
static-auth-secret=d4fda96998eba73797abababababababab1335a71f1cfd7a9d8
realm=turn.example.de
total-quota=100
bps-capacity=0
stale-nonce=600
no-multicast-peers
no-tlsv1
no-tlsv1_1
Reacted by Marcus, Carlos Ruiz Ballesteros and haansn08
Activity
DevRockstarZ commentedon Sep 14, 2020
I suggest you to add options below.
--log-file /dev/null --simple-log --no-stdout-logIf you simply add --log-file to /dev/null, log file will not be created.
misi commentedon Dec 8, 2020
@mokkin Try to send log to syslog and there are well known ways like logrotate and filtering to handle this issue..
bszente commentedon Mar 24, 2021
There are other things to be considered as well:
The flood with the following message (filling MBs of log also in my case):
is meaningless, because it is simply a success INFO message without any further information. Does not help, at least at "normal" log level.
The other similar case (when an attack is performed):
To log this for every UDP packet (for the same attacker) is kind of overkill. One single log is useful for
fail2banscenarios, however it is not OK to log the same for every single packet with the samethrid,Amapandsvalues.I kindly ask you, to move the first to
verboseorVerboselevel, and the second one to log once (if they are consecutive), and only log every time onverboseorVerboselevel.misi commentedon Mar 24, 2021
@bszente Check latest master in the new version there is an option and by default we don't log binding request.
bszente commentedon Mar 24, 2021
@misi Thanks, you are right. Indeed, since
coturn-4.5.2(I recently upgraded) I don't have thoseBINDINGlog lines anymore.Is there anything that can be done for the second log type? (The
ERROR: handle_udp_packet: socket to be closedand the following one.)paulmenzel commentedon Mar 29, 2021
Nice. Which commit is it exactly?
paulmenzel commentedon Mar 29, 2021
6a5d067 (Merge pull request #703 from hills/no-stdout-log) which is merge/pull request #703?
paulmenzel commentedon Mar 29, 2021
I am seeing this with Debian 10 (buster) with coturn 4.5.1.1-1.1+deb10u2.
andyCapone commentedon Apr 5, 2021
Having that problem with Debian Buster (coturn 4.5.1.1-1.1+deb10u2 amd64).
bszente commentedon Apr 6, 2021
Upgrade to
coturn-4.5.2.paulmenzel commentedon Apr 6, 2021
Can you please point to the commit fixing this issue?
jbg commentedon Apr 6, 2021
27b261e
4.5.2 on Arch doesn't fix the issue for me though.
misi commentedon Apr 7, 2021
@jbg you still get binding logs even if you use 4.5.2. Can you explain more detailed?
misi commentedon Apr 7, 2021
Just a temporary workaround if you log to syslog you can filter out in syslog. It is not a solution of course still, it will still cause IO, but it will not fill the disk..
4.5.2 should help if it does not work, just let me know and I will adjust it to fix.
Cacodaimon commentedon Apr 20, 2021
For me the log spam is not the only issue, my server runs into ulimit issues doe to too many open sockets.
The connections are not usual connections, outside of our offices working hours I would not expect so many incoming packets (5k per minute).
If there would be the IP address in addition to the session in the log message it would be easy to utilize e.g. fail2ban to block those suspicious connections / IP addresses.
resoli commentedon Apr 28, 2021
Same issues here with 4.5.2 from buster-backports
Neustradamus commentedon Aug 15, 2022
To follow this ticket.
eakraly commentedon Aug 16, 2022
Hi @jbg @resoli !
Do you still experience the issue? If yes, can you please provide a full log and your configuration settings?
haansn08 commentedon Aug 23, 2022
I'm having the same issue on Arch Linux coturn-4.5.2-3:
The IP seems to be from Russia and they certainly have no business with my TURN server.
Did I make security mistakes in configuring my TURN server?
eakraly commentedon Aug 24, 2022
@haansn08 Those are STUN requests
My bet is that your STUN is not secure (no
--secure-stun) which allows anyone to use it (for STUN, not TURN)Is this a problem or not - up to you.
If you just want to reduce the amount of logs make sure you do not have
--log-bindingin your configuration which will stop logging BINDING messages above (assuming you run the version that supports it)haansn08 commentedon Aug 25, 2022
@eakraly Thank you! Indeed the
--secure-stunoption was disabled. Sadly the connection attempts did not stop, but at least they seem to be unauthorized now:incoming packet message processed, error 401: Unauthorized.eakraly commentedon Aug 26, 2022
There is no way you can solve it AFAIK - internet is a wild place and you get incoming traffic from unexpected sources.
One thing that you can do is to move to non-standard ports (away from 3478) - this might reduce amount of scanners and probes but you must validate with your application/network if they can use non-standard ports for STUN
If this answers your question - please close this issue. Thanks!
haansn08 commentedon Aug 27, 2022
@eakraly Thank you for your answer, but I did not create this issue.