Add TURN permission handler. (#4505)
* Add TURN permission handler. - Turn off permissions to private/link local/multicast and internal IPs - Add a list of CIDRs that can be used for more things to deny permission to. * unused * add config for allowing private IPs, used in testing * add a TTL to user name and use it to auth * allow list for restricted peer CIDRs
This commit is contained in:
@@ -227,6 +227,17 @@ type TURNConfig struct {
|
||||
RelayPortRangeEnd uint16 `yaml:"relay_range_end,omitempty"`
|
||||
ExternalTLS bool `yaml:"external_tls,omitempty"`
|
||||
BindAddresses []string `yaml:"bind_addresses,omitempty"`
|
||||
// TTL of the TURN credentials in seconds - defaults to 300
|
||||
TTLSeconds int `yaml:"ttl_seconds,omitempty"`
|
||||
// list of restricted peer CIDRs (loopback, link-local (unicast, multicast), multicast, private, unspecified) to allow access to.
|
||||
// By default (i. e. empty list), all restricted peer CIDRs are denied access.
|
||||
// When not empty, only the specified CIDRs are allowed access.
|
||||
// Note that this check is applied to restricted peer CIDRs only.
|
||||
AllowRestrictedPeerCIDRs []string `yaml:"allow_restricted_peer_cidrs,omitempty"`
|
||||
// list of peer CIDRs to deny access to
|
||||
// This applies to all peer CIDRs, including restricted ones.
|
||||
// Deny list takes precedence over allow list.
|
||||
DenyPeerCIDRs []string `yaml:"deny_peer_cidrs,omitempty"`
|
||||
}
|
||||
|
||||
type NodeSelectorConfig struct {
|
||||
@@ -421,6 +432,7 @@ var DefaultConfig = Config{
|
||||
TURN: TURNConfig{
|
||||
Enabled: false,
|
||||
BindAddresses: []string{"0.0.0.0"},
|
||||
TTLSeconds: 300,
|
||||
},
|
||||
NodeSelector: NodeSelectorConfig{
|
||||
Kind: "any",
|
||||
|
||||
Reference in New Issue
Block a user