aboutsummaryrefslogtreecommitdiff
path: root/net/tunneldigger-broker/files/hook-connection-rate-limit
blob: 813c380290ffb29762cdadea5bbe539ad527b384 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/bash
set -e

ENDPOINT_IP="$1"
ENDPOINT_PORT="$2"
UUID="$3"

# This assumes that an ipset was created with something like
# ```
# ipset create create tunneldigger_blocked hash:ip family inet timeout 300
# ```
# and that a firewall rule like the following uses the ipset to block connections:
# ```
# -A INPUT -m set --match-set tunneldigger_blocked src -j DROP
# ```

#ipset add tunneldigger_blocked "$ENDPOINT_IP"