mirror of
https://github.com/GrapheneOS/infrastructure.git
synced 2025-01-03 11:00:49 -05:00
nftables: explain synproxy bypass rate limit
This commit is contained in:
parent
ecd14bddff
commit
26a58b2492
@ -44,8 +44,10 @@ table inet filter {
|
|||||||
# ordered after accepting loopback to permit using external IPs via loopback
|
# ordered after accepting loopback to permit using external IPs via loopback
|
||||||
fib daddr . iif type != { local, broadcast, multicast } counter drop
|
fib daddr . iif type != { local, broadcast, multicast } counter drop
|
||||||
|
|
||||||
|
# handle new TCP connections beyond rate limit via synproxy to avoid conntrack table exhaustion
|
||||||
tcp dport { 22, 80, 443 } tcp flags syn limit rate 1024/second burst 128 packets accept
|
tcp dport { 22, 80, 443 } tcp flags syn limit rate 1024/second burst 128 packets accept
|
||||||
tcp dport { 22, 80, 443 } tcp flags syn counter notrack accept
|
tcp dport { 22, 80, 443 } tcp flags syn counter notrack accept
|
||||||
|
|
||||||
meta l4proto { icmp, ipv6-icmp } notrack accept
|
meta l4proto { icmp, ipv6-icmp } notrack accept
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -44,8 +44,10 @@ table inet filter {
|
|||||||
# ordered after accepting loopback to permit using external IPs via loopback
|
# ordered after accepting loopback to permit using external IPs via loopback
|
||||||
fib daddr . iif type != { local, broadcast, multicast } counter drop
|
fib daddr . iif type != { local, broadcast, multicast } counter drop
|
||||||
|
|
||||||
|
# handle new TCP connections beyond rate limit via synproxy to avoid conntrack table exhaustion
|
||||||
tcp dport { 22, 80, 443 } tcp flags syn limit rate 1024/second burst 128 packets accept
|
tcp dport { 22, 80, 443 } tcp flags syn limit rate 1024/second burst 128 packets accept
|
||||||
tcp dport { 22, 80, 443 } tcp flags syn counter notrack accept
|
tcp dport { 22, 80, 443 } tcp flags syn counter notrack accept
|
||||||
|
|
||||||
meta l4proto { icmp, ipv6-icmp } notrack accept
|
meta l4proto { icmp, ipv6-icmp } notrack accept
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -44,8 +44,10 @@ table inet filter {
|
|||||||
# ordered after accepting loopback to permit using external IPs via loopback
|
# ordered after accepting loopback to permit using external IPs via loopback
|
||||||
fib daddr . iif type != { local, broadcast, multicast } counter drop
|
fib daddr . iif type != { local, broadcast, multicast } counter drop
|
||||||
|
|
||||||
|
# handle new TCP connections beyond rate limit via synproxy to avoid conntrack table exhaustion
|
||||||
tcp dport { 22, 25, 80, 443, 465, 993 } tcp flags syn limit rate 1024/second burst 128 packets accept
|
tcp dport { 22, 25, 80, 443, 465, 993 } tcp flags syn limit rate 1024/second burst 128 packets accept
|
||||||
tcp dport { 22, 25, 80, 443, 465, 993 } tcp flags syn counter notrack accept
|
tcp dport { 22, 25, 80, 443, 465, 993 } tcp flags syn counter notrack accept
|
||||||
|
|
||||||
meta l4proto { icmp, ipv6-icmp } notrack accept
|
meta l4proto { icmp, ipv6-icmp } notrack accept
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -44,8 +44,10 @@ table inet filter {
|
|||||||
# ordered after accepting loopback to permit using external IPs via loopback
|
# ordered after accepting loopback to permit using external IPs via loopback
|
||||||
fib daddr . iif type != { local, broadcast, multicast } counter drop
|
fib daddr . iif type != { local, broadcast, multicast } counter drop
|
||||||
|
|
||||||
|
# handle new TCP connections beyond rate limit via synproxy to avoid conntrack table exhaustion
|
||||||
tcp dport { 22, 80, 443 } tcp flags syn limit rate 1024/second burst 128 packets accept
|
tcp dport { 22, 80, 443 } tcp flags syn limit rate 1024/second burst 128 packets accept
|
||||||
tcp dport { 22, 80, 443 } tcp flags syn counter notrack accept
|
tcp dport { 22, 80, 443 } tcp flags syn counter notrack accept
|
||||||
|
|
||||||
meta l4proto { icmp, ipv6-icmp } notrack accept
|
meta l4proto { icmp, ipv6-icmp } notrack accept
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -46,8 +46,10 @@ table inet filter {
|
|||||||
# ordered after accepting loopback to permit using external IPs via loopback
|
# ordered after accepting loopback to permit using external IPs via loopback
|
||||||
fib daddr . iif type != { local, broadcast, multicast } counter drop
|
fib daddr . iif type != { local, broadcast, multicast } counter drop
|
||||||
|
|
||||||
|
# handle new TCP connections beyond rate limit via synproxy to avoid conntrack table exhaustion
|
||||||
tcp dport { 22, 80, 443, 7275 } tcp flags syn limit rate 1024/second burst 128 packets accept
|
tcp dport { 22, 80, 443, 7275 } tcp flags syn limit rate 1024/second burst 128 packets accept
|
||||||
tcp dport { 22, 80, 443, 7275 } tcp flags syn counter notrack accept
|
tcp dport { 22, 80, 443, 7275 } tcp flags syn counter notrack accept
|
||||||
|
|
||||||
udp dport 123 notrack accept
|
udp dport 123 notrack accept
|
||||||
meta l4proto { icmp, ipv6-icmp } notrack accept
|
meta l4proto { icmp, ipv6-icmp } notrack accept
|
||||||
}
|
}
|
||||||
|
@ -45,8 +45,11 @@ table inet filter {
|
|||||||
fib daddr . iif type != { local, broadcast, multicast } counter drop
|
fib daddr . iif type != { local, broadcast, multicast } counter drop
|
||||||
|
|
||||||
udp dport 53 notrack accept
|
udp dport 53 notrack accept
|
||||||
|
|
||||||
|
# handle new TCP connections beyond rate limit via synproxy to avoid conntrack table exhaustion
|
||||||
tcp dport { 22, 53, 80, 443, 853 } tcp flags syn limit rate 1024/second burst 128 packets accept
|
tcp dport { 22, 53, 80, 443, 853 } tcp flags syn limit rate 1024/second burst 128 packets accept
|
||||||
tcp dport { 22, 53, 80, 443, 853 } tcp flags syn counter notrack accept
|
tcp dport { 22, 53, 80, 443, 853 } tcp flags syn counter notrack accept
|
||||||
|
|
||||||
meta l4proto { icmp, ipv6-icmp } notrack accept
|
meta l4proto { icmp, ipv6-icmp } notrack accept
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -50,8 +50,11 @@ table inet filter {
|
|||||||
tcp dport 22 ip daddr 198.251.90.93 reject with tcp reset
|
tcp dport 22 ip daddr 198.251.90.93 reject with tcp reset
|
||||||
|
|
||||||
udp dport 53 notrack accept
|
udp dport 53 notrack accept
|
||||||
|
|
||||||
|
# handle new TCP connections beyond rate limit via synproxy to avoid conntrack table exhaustion
|
||||||
tcp dport { 22, 53, 80, 443, 853 } tcp flags syn limit rate 1024/second burst 128 packets accept
|
tcp dport { 22, 53, 80, 443, 853 } tcp flags syn limit rate 1024/second burst 128 packets accept
|
||||||
tcp dport { 22, 53, 80, 443, 853 } tcp flags syn counter notrack accept
|
tcp dport { 22, 53, 80, 443, 853 } tcp flags syn counter notrack accept
|
||||||
|
|
||||||
meta l4proto { icmp, ipv6-icmp } notrack accept
|
meta l4proto { icmp, ipv6-icmp } notrack accept
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -44,8 +44,10 @@ table inet filter {
|
|||||||
# ordered after accepting loopback to permit using external IPs via loopback
|
# ordered after accepting loopback to permit using external IPs via loopback
|
||||||
fib daddr . iif type != { local, broadcast, multicast } counter drop
|
fib daddr . iif type != { local, broadcast, multicast } counter drop
|
||||||
|
|
||||||
|
# handle new TCP connections beyond rate limit via synproxy to avoid conntrack table exhaustion
|
||||||
tcp dport { 22, 80, 443 } tcp flags syn limit rate 1024/second burst 128 packets accept
|
tcp dport { 22, 80, 443 } tcp flags syn limit rate 1024/second burst 128 packets accept
|
||||||
tcp dport { 22, 80, 443 } tcp flags syn counter notrack accept
|
tcp dport { 22, 80, 443 } tcp flags syn counter notrack accept
|
||||||
|
|
||||||
meta l4proto { icmp, ipv6-icmp } notrack accept
|
meta l4proto { icmp, ipv6-icmp } notrack accept
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -48,8 +48,10 @@ table inet filter {
|
|||||||
# ordered after accepting loopback to permit using external IPs via loopback
|
# ordered after accepting loopback to permit using external IPs via loopback
|
||||||
fib daddr . iif type != { local, broadcast, multicast } counter drop
|
fib daddr . iif type != { local, broadcast, multicast } counter drop
|
||||||
|
|
||||||
|
# handle new TCP connections beyond rate limit via synproxy to avoid conntrack table exhaustion
|
||||||
tcp dport { 22, 80, 443 } tcp flags syn limit rate 1024/second burst 128 packets accept
|
tcp dport { 22, 80, 443 } tcp flags syn limit rate 1024/second burst 128 packets accept
|
||||||
tcp dport { 22, 80, 443 } tcp flags syn counter notrack accept
|
tcp dport { 22, 80, 443 } tcp flags syn counter notrack accept
|
||||||
|
|
||||||
meta l4proto { icmp, ipv6-icmp } notrack accept
|
meta l4proto { icmp, ipv6-icmp } notrack accept
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user