Skip to content

Commit

Permalink
[NODE-1250] Adjust nftables ratelimits
Browse files Browse the repository at this point in the history
  • Loading branch information
Bownairo committed Jan 31, 2024
1 parent 92c4a6a commit bdd6081
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions ic-os/guestos/rootfs/opt/ic/share/ic.json5.template
Expand Up @@ -186,16 +186,17 @@
chain INPUT {\n\
type filter hook input priority 0; policy drop;\n\
iif lo accept\n\
ct state new add @rate_limit { ip saddr limit rate over 1000/minute } drop\n\
ct state new add @rate_limit { ip saddr limit rate over 1000/minute burst 500 packets } log prefix \"Drop - rate limit: \" drop\n\
# Notes about the rule below:\n\
# - The rule allows a maximum of <<MAX_SIMULTANEOUS_CONNECTIONS_PER_IP_ADDRESS>> persistent connections to any ip address.\n\
# - The rule drops all new connections that goes over the configured limit.\n\
ct state new add @connection_limit { ip saddr ct count over <<MAX_SIMULTANEOUS_CONNECTIONS_PER_IP_ADDRESS>> } drop\n\
ct state new add @connection_limit { ip saddr ct count over <<MAX_SIMULTANEOUS_CONNECTIONS_PER_IP_ADDRESS>> } log prefix \"Drop - connection limit: \" drop\n\
icmp type parameter-problem accept\n\
icmp type echo-request accept\n\
icmp type echo-reply accept\n\
<<IPv4_TCP_RULES>>\n\
<<IPv4_UDP_RULES>>\n\
log prefix \"Drop - default policy: \"\n\
}\n\
\n\
chain FORWARD {\n\
Expand Down Expand Up @@ -227,7 +228,7 @@ table ip6 filter {\n\
iif lo accept\n\
ct state { invalid } drop\n\
ct state { established, related } accept\n\
ct state new add @rate_limit { ip6 saddr limit rate over 100000/minute } log prefix \"Drop - rate limit: \" drop\n\
ct state new add @rate_limit { ip6 saddr limit rate over 1000/minute burst 500 packets } log prefix \"Drop - rate limit: \" drop\n\
# Notes about the rule below:\n\
# - The rule allows a maximum of <<MAX_SIMULTANEOUS_CONNECTIONS_PER_IP_ADDRESS>> persistent connections to any ip6 address.\n\
# - The rule drops all new connections that goes over the configured limit.\n\
Expand Down

0 comments on commit bdd6081

Please sign in to comment.