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

coturn filter for fail2ban #1467

Open
un99known99 opened this issue Apr 4, 2024 · 12 comments
Open

coturn filter for fail2ban #1467

un99known99 opened this issue Apr 4, 2024 · 12 comments

Comments

@un99known99
Copy link

I did several experiments in getting IPs knocking at coturn blocked, but without luck, in the end I ended up with unwanted blocks or not working apps (jitsi-meet).

Is there an official recommendation on how to failsafe via fail2ban coturn ports?
How to safeguard the ports?

Any recomms / help?

Thanks.

@bab5470
Copy link

bab5470 commented Apr 8, 2024

This would be useful for us as well. If you figure out how to get this to work please post here.

@un99known99
Copy link
Author

un99known99 commented Apr 8, 2024

@bab5470 I probably could if I would know the "unique" errors coturn shows for just bot knocking .... maybe you can handover which "reason: ______" in the logfiles are valid ....

@un99known99
Copy link
Author

like coturn.log.9.gz:251402: : session 003000000000000005: closed (2nd stage), user <> realm <turn.myserver.com> origin <>, local 0.0.0.0:9273, remote 185.242.226.3:57446, reason: general

what are VALID "reason:" entries???

@bab5470
Copy link

bab5470 commented Apr 8, 2024

How did you get your coturn server to log the remote IP? Ours doesn't seem to even log the IP?

@un99known99
Copy link
Author

un99known99 commented Apr 8, 2024

I could get you a fail2ban filter if you handover the valid reason codes OR the NOT valid codes, for the logged IP I am checking my setup,
maybe "verbose" and / or "fingerprint"?

@un99known99
Copy link
Author

un99known99 commented Apr 9, 2024

@bab5470 can you supply the info?

what are VALID "reason:" entries or INVALID?

@eakraly
Copy link
Collaborator

eakraly commented Apr 12, 2024

All the reasons coturn prints are "valid" in a sense that there is a logical reason (timeout, connection is just closed, SSL read error, UDP packet processing error, etc)
None of the reasons mean there was malicious intent that warrants blocking IP....

In general, blocking IP on this kind of service will, most probably, lead to blocking valid clients

@un99known99
Copy link
Author

@eakraly thx for your answer - understood, so how is/can coturn be (more) protected?

@un99known99
Copy link
Author

?

@un99known99
Copy link
Author

@eakraly if you have any input I could share a fail2ban rule ......

@eakraly
Copy link
Collaborator

eakraly commented May 9, 2024

The most important thing is to ensure coturn cannot allocate connections into internal network (if you have such a thing) in the way you did not intend to @un99known99

@un99known99
Copy link
Author

@eakraly I did the following:

denied ALL then only allow the 2 servers in network:

grafik

seems that what you mentioned?

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

No branches or pull requests

3 participants