Skip to content
This repository was archived by the owner on Mar 22, 2023. It is now read-only.

Commit 49cef3e

Browse files
authored
Add allowed and denied peer to turnserver.conf
Following [1] and [2] the TURN-Server can be used to access the network behind the TURN-Server or the server can be abused to relay attacks in the internet. To workaround those problems `denied-peer-ip` and `allowed-peer-ip` setting should be used. [1] https://www.rtcsec.com/post/2020/04/how-we-abused-slacks-turn-servers-to-gain-access-to-internal-services/ [2] https://www.rtcsec.com/post/2021/01/details-about-cve-2020-26262-bypass-of-coturns-default-access-control-protection/
1 parent a6a0f3b commit 49cef3e

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

_posts/2019-02-14-setup-turn-server.md

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,12 @@ Current versions of the certbot command set up automatic renewal by default. No
8080

8181
`coturn` configuration is stored in the file `/etc/turnserver.conf`. There are a lot of options available, all documented in comments in that file. We include a sample configuration below with comments indicating the recommended settings, with some notes in locations where customization is required.
8282

83-
You can repace the contents `/etc/turnserver.conf` with this file and make two changes:
83+
You can repace the contents `/etc/turnserver.conf` with this file and make three changes:
8484

8585
* Replace `turn.example.com` with the hostname of your TURN server, and
8686
* Replace `<random value>` to a random value for a shared secret (instructions for generating a new secret are in a comment in the file).
87+
* Replace `<bbb server ip>` with the IP Address of your BigBlueButton-Server
88+
* Repeat `allowed-peer-ip=<bbb server ip>` for each IPv4 and IPv6 for every BigBlueButton-Server
8789

8890
Attention: The `turnserver` process will run as the `turnserver` user, which usually doesn't have access to the certificates/keys in `/etc/letsencrypt/live`. It is recommended that you either create a `ssl-cert` user group, add the `turnserver` user to it and adjust the permissions for `/etc/letsencrypt/live` such that the group can read it or, alternatively, copy the certificates/keys to a safe location (that `turnserver` has access to) after each certificate renewal.
8991

@@ -111,6 +113,23 @@ tls-listening-port=443
111113
#external-ip=172.17.19.131/10.0.0.11
112114
#external-ip=172.17.18.132/10.0.0.12
113115

116+
# Flag that can be used to disallow peers on well-known broadcast addresses
117+
# (224.0.0.0 and above, and FFXX:*). This is an extra security measure.
118+
#
119+
no-multicast-peers
120+
121+
# Option to allow or ban specific ip addresses or ranges of ip addresses.
122+
# If an ip address is specified as both allowed and denied, then the ip address is
123+
# considered to be allowed. This is useful when you wish to ban a range of ip
124+
# addresses, except for a few specific ips within that range.
125+
#
126+
# This can be used when you do not want users of the turn server to be able to access
127+
# machines reachable by the turn server, but would otherwise be unreachable from the
128+
# internet (e.g. when the turn server is sitting behind a NAT)
129+
denied-peer-ip=0.0.0.0-255.255.255.255
130+
denied-peer-ip=::-ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff
131+
allowed-peer-ip=<bbb server ip>
132+
114133
# Fingerprints in TURN messages are required for WebRTC
115134
fingerprint
116135

0 commit comments

Comments
 (0)