mirror of
https://github.com/GrapheneOS/infrastructure.git
synced 2025-01-03 11:00:49 -05:00
enforce IPv6 SSH connection limit for /48 blocks
Since our primary servers using SSH to mirror their TLS certificates to replicas are now allowlisted, we can use a stricter block size than we could with the PerSourceMaxStartups approach in sshd.
This commit is contained in:
parent
cd59960e7b
commit
8c929f02ac
@ -50,7 +50,7 @@ table inet filter {
|
|||||||
policy drop
|
policy drop
|
||||||
|
|
||||||
iif lo tcp dport 22 tcp flags syn ip saddr != $ip-allowlist-ssh add @ip-connlimit-ssh { ip saddr ct count over 1 } reject with tcp reset
|
iif lo tcp dport 22 tcp flags syn ip saddr != $ip-allowlist-ssh add @ip-connlimit-ssh { ip saddr ct count over 1 } reject with tcp reset
|
||||||
iif lo tcp dport 22 tcp flags syn ip6 saddr != $ip6-allowlist-ssh add @ip6-connlimit-ssh { ip6 saddr ct count over 1 } reject with tcp reset
|
iif lo tcp dport 22 tcp flags syn ip6 saddr != $ip6-allowlist-ssh add @ip6-connlimit-ssh { ip6 saddr and ffff:ffff:ffff:ffff:ffff:: ct count over 1 } reject with tcp reset
|
||||||
|
|
||||||
iif lo accept
|
iif lo accept
|
||||||
tcp dport { 80, 443 } accept
|
tcp dport { 80, 443 } accept
|
||||||
@ -58,7 +58,7 @@ table inet filter {
|
|||||||
ct state vmap { established : accept, related : accept, new : goto graceful-reject }
|
ct state vmap { established : accept, related : accept, new : goto graceful-reject }
|
||||||
|
|
||||||
tcp dport 22 ip saddr @ip-connlimit-ssh reject with tcp reset
|
tcp dport 22 ip saddr @ip-connlimit-ssh reject with tcp reset
|
||||||
tcp dport 22 ip6 saddr @ip6-connlimit-ssh reject with tcp reset
|
tcp dport 22 ip6 saddr and ffff:ffff:ffff:ffff:ffff:: @ip6-connlimit-ssh reject with tcp reset
|
||||||
tcp dport 22 synproxy mss 1460 wscale 7 timestamp sack-perm
|
tcp dport 22 synproxy mss 1460 wscale 7 timestamp sack-perm
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -53,7 +53,7 @@ table inet filter {
|
|||||||
policy drop
|
policy drop
|
||||||
|
|
||||||
iif lo tcp dport 22 tcp flags syn ip saddr != $ip-allowlist-ssh add @ip-connlimit-ssh { ip saddr ct count over 1 } reject with tcp reset
|
iif lo tcp dport 22 tcp flags syn ip saddr != $ip-allowlist-ssh add @ip-connlimit-ssh { ip saddr ct count over 1 } reject with tcp reset
|
||||||
iif lo tcp dport 22 tcp flags syn ip6 saddr != $ip6-allowlist-ssh add @ip6-connlimit-ssh { ip6 saddr ct count over 1 } reject with tcp reset
|
iif lo tcp dport 22 tcp flags syn ip6 saddr != $ip6-allowlist-ssh add @ip6-connlimit-ssh { ip6 saddr and ffff:ffff:ffff:ffff:ffff:: ct count over 1 } reject with tcp reset
|
||||||
|
|
||||||
iif lo accept
|
iif lo accept
|
||||||
tcp dport { 80, 443 } accept
|
tcp dport { 80, 443 } accept
|
||||||
@ -61,7 +61,7 @@ table inet filter {
|
|||||||
ct state vmap { established : accept, related : accept, new : goto graceful-reject }
|
ct state vmap { established : accept, related : accept, new : goto graceful-reject }
|
||||||
|
|
||||||
tcp dport 22 ip saddr @ip-connlimit-ssh reject with tcp reset
|
tcp dport 22 ip saddr @ip-connlimit-ssh reject with tcp reset
|
||||||
tcp dport 22 ip6 saddr @ip6-connlimit-ssh reject with tcp reset
|
tcp dport 22 ip6 saddr and ffff:ffff:ffff:ffff:ffff:: @ip6-connlimit-ssh reject with tcp reset
|
||||||
tcp dport 22 synproxy mss 1460 wscale 7 timestamp sack-perm
|
tcp dport 22 synproxy mss 1460 wscale 7 timestamp sack-perm
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -50,7 +50,7 @@ table inet filter {
|
|||||||
policy drop
|
policy drop
|
||||||
|
|
||||||
iif lo tcp dport 22 tcp flags syn ip saddr != $ip-allowlist-ssh add @ip-connlimit-ssh { ip saddr ct count over 1 } reject with tcp reset
|
iif lo tcp dport 22 tcp flags syn ip saddr != $ip-allowlist-ssh add @ip-connlimit-ssh { ip saddr ct count over 1 } reject with tcp reset
|
||||||
iif lo tcp dport 22 tcp flags syn ip6 saddr != $ip6-allowlist-ssh add @ip6-connlimit-ssh { ip6 saddr ct count over 1 } reject with tcp reset
|
iif lo tcp dport 22 tcp flags syn ip6 saddr != $ip6-allowlist-ssh add @ip6-connlimit-ssh { ip6 saddr and ffff:ffff:ffff:ffff:ffff:: ct count over 1 } reject with tcp reset
|
||||||
|
|
||||||
iif lo accept
|
iif lo accept
|
||||||
tcp dport { 25, 80, 443, 465, 993 } accept
|
tcp dport { 25, 80, 443, 465, 993 } accept
|
||||||
@ -58,7 +58,7 @@ table inet filter {
|
|||||||
ct state vmap { established : accept, related : accept, new : goto graceful-reject }
|
ct state vmap { established : accept, related : accept, new : goto graceful-reject }
|
||||||
|
|
||||||
tcp dport 22 ip saddr @ip-connlimit-ssh reject with tcp reset
|
tcp dport 22 ip saddr @ip-connlimit-ssh reject with tcp reset
|
||||||
tcp dport 22 ip6 saddr @ip6-connlimit-ssh reject with tcp reset
|
tcp dport 22 ip6 saddr and ffff:ffff:ffff:ffff:ffff:: @ip6-connlimit-ssh reject with tcp reset
|
||||||
tcp dport 22 synproxy mss 1460 wscale 7 timestamp sack-perm
|
tcp dport 22 synproxy mss 1460 wscale 7 timestamp sack-perm
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -50,7 +50,7 @@ table inet filter {
|
|||||||
policy drop
|
policy drop
|
||||||
|
|
||||||
iif lo tcp dport 22 tcp flags syn ip saddr != $ip-allowlist-ssh add @ip-connlimit-ssh { ip saddr ct count over 1 } reject with tcp reset
|
iif lo tcp dport 22 tcp flags syn ip saddr != $ip-allowlist-ssh add @ip-connlimit-ssh { ip saddr ct count over 1 } reject with tcp reset
|
||||||
iif lo tcp dport 22 tcp flags syn ip6 saddr != $ip6-allowlist-ssh add @ip6-connlimit-ssh { ip6 saddr ct count over 1 } reject with tcp reset
|
iif lo tcp dport 22 tcp flags syn ip6 saddr != $ip6-allowlist-ssh add @ip6-connlimit-ssh { ip6 saddr and ffff:ffff:ffff:ffff:ffff:: ct count over 1 } reject with tcp reset
|
||||||
|
|
||||||
iif lo accept
|
iif lo accept
|
||||||
tcp dport { 80, 443 } accept
|
tcp dport { 80, 443 } accept
|
||||||
@ -58,7 +58,7 @@ table inet filter {
|
|||||||
ct state vmap { established : accept, related : accept, new : goto graceful-reject }
|
ct state vmap { established : accept, related : accept, new : goto graceful-reject }
|
||||||
|
|
||||||
tcp dport 22 ip saddr @ip-connlimit-ssh reject with tcp reset
|
tcp dport 22 ip saddr @ip-connlimit-ssh reject with tcp reset
|
||||||
tcp dport 22 ip6 saddr @ip6-connlimit-ssh reject with tcp reset
|
tcp dport 22 ip6 saddr and ffff:ffff:ffff:ffff:ffff:: @ip6-connlimit-ssh reject with tcp reset
|
||||||
tcp dport 22 synproxy mss 1460 wscale 7 timestamp sack-perm
|
tcp dport 22 synproxy mss 1460 wscale 7 timestamp sack-perm
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -54,7 +54,7 @@ table inet filter {
|
|||||||
policy drop
|
policy drop
|
||||||
|
|
||||||
iif lo tcp dport 22 tcp flags syn ip saddr != $ip-allowlist-ssh add @ip-connlimit-ssh { ip saddr ct count over 1 } reject with tcp reset
|
iif lo tcp dport 22 tcp flags syn ip saddr != $ip-allowlist-ssh add @ip-connlimit-ssh { ip saddr ct count over 1 } reject with tcp reset
|
||||||
iif lo tcp dport 22 tcp flags syn ip6 saddr != $ip6-allowlist-ssh add @ip6-connlimit-ssh { ip6 saddr ct count over 1 } reject with tcp reset
|
iif lo tcp dport 22 tcp flags syn ip6 saddr != $ip6-allowlist-ssh add @ip6-connlimit-ssh { ip6 saddr and ffff:ffff:ffff:ffff:ffff:: ct count over 1 } reject with tcp reset
|
||||||
|
|
||||||
iif lo accept
|
iif lo accept
|
||||||
tcp dport { 80, 443, 7275 } accept
|
tcp dport { 80, 443, 7275 } accept
|
||||||
@ -63,7 +63,7 @@ table inet filter {
|
|||||||
ct state vmap { established : accept, related : accept, new : goto graceful-reject }
|
ct state vmap { established : accept, related : accept, new : goto graceful-reject }
|
||||||
|
|
||||||
tcp dport 22 ip saddr @ip-connlimit-ssh reject with tcp reset
|
tcp dport 22 ip saddr @ip-connlimit-ssh reject with tcp reset
|
||||||
tcp dport 22 ip6 saddr @ip6-connlimit-ssh reject with tcp reset
|
tcp dport 22 ip6 saddr and ffff:ffff:ffff:ffff:ffff:: @ip6-connlimit-ssh reject with tcp reset
|
||||||
tcp dport 22 synproxy mss 1460 wscale 7 timestamp sack-perm
|
tcp dport 22 synproxy mss 1460 wscale 7 timestamp sack-perm
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -52,7 +52,7 @@ table inet filter {
|
|||||||
policy drop
|
policy drop
|
||||||
|
|
||||||
iif lo tcp dport 22 tcp flags syn ip saddr != $ip-allowlist-ssh add @ip-connlimit-ssh { ip saddr ct count over 1 } reject with tcp reset
|
iif lo tcp dport 22 tcp flags syn ip saddr != $ip-allowlist-ssh add @ip-connlimit-ssh { ip saddr ct count over 1 } reject with tcp reset
|
||||||
iif lo tcp dport 22 tcp flags syn ip6 saddr != $ip6-allowlist-ssh add @ip6-connlimit-ssh { ip6 saddr ct count over 1 } reject with tcp reset
|
iif lo tcp dport 22 tcp flags syn ip6 saddr != $ip6-allowlist-ssh add @ip6-connlimit-ssh { ip6 saddr and ffff:ffff:ffff:ffff:ffff:: ct count over 1 } reject with tcp reset
|
||||||
|
|
||||||
iif lo accept
|
iif lo accept
|
||||||
udp dport 53 accept
|
udp dport 53 accept
|
||||||
@ -61,7 +61,7 @@ table inet filter {
|
|||||||
ct state vmap { established : accept, related : accept, new : goto graceful-reject }
|
ct state vmap { established : accept, related : accept, new : goto graceful-reject }
|
||||||
|
|
||||||
tcp dport 22 ip saddr @ip-connlimit-ssh reject with tcp reset
|
tcp dport 22 ip saddr @ip-connlimit-ssh reject with tcp reset
|
||||||
tcp dport 22 ip6 saddr @ip6-connlimit-ssh reject with tcp reset
|
tcp dport 22 ip6 saddr and ffff:ffff:ffff:ffff:ffff:: @ip6-connlimit-ssh reject with tcp reset
|
||||||
tcp dport 22 synproxy mss 1460 wscale 7 timestamp sack-perm
|
tcp dport 22 synproxy mss 1460 wscale 7 timestamp sack-perm
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -57,7 +57,7 @@ table inet filter {
|
|||||||
policy drop
|
policy drop
|
||||||
|
|
||||||
iif lo tcp dport 22 tcp flags syn ip saddr != $ip-allowlist-ssh add @ip-connlimit-ssh { ip saddr ct count over 1 } reject with tcp reset
|
iif lo tcp dport 22 tcp flags syn ip saddr != $ip-allowlist-ssh add @ip-connlimit-ssh { ip saddr ct count over 1 } reject with tcp reset
|
||||||
iif lo tcp dport 22 tcp flags syn ip6 saddr != $ip6-allowlist-ssh add @ip6-connlimit-ssh { ip6 saddr ct count over 1 } reject with tcp reset
|
iif lo tcp dport 22 tcp flags syn ip6 saddr != $ip6-allowlist-ssh add @ip6-connlimit-ssh { ip6 saddr and ffff:ffff:ffff:ffff:ffff:: ct count over 1 } reject with tcp reset
|
||||||
|
|
||||||
iif lo accept
|
iif lo accept
|
||||||
udp dport 53 accept
|
udp dport 53 accept
|
||||||
@ -66,7 +66,7 @@ table inet filter {
|
|||||||
ct state vmap { established : accept, related : accept, new : goto graceful-reject }
|
ct state vmap { established : accept, related : accept, new : goto graceful-reject }
|
||||||
|
|
||||||
tcp dport 22 ip saddr @ip-connlimit-ssh reject with tcp reset
|
tcp dport 22 ip saddr @ip-connlimit-ssh reject with tcp reset
|
||||||
tcp dport 22 ip6 saddr @ip6-connlimit-ssh reject with tcp reset
|
tcp dport 22 ip6 saddr and ffff:ffff:ffff:ffff:ffff:: @ip6-connlimit-ssh reject with tcp reset
|
||||||
tcp dport 22 synproxy mss 1460 wscale 7 timestamp sack-perm
|
tcp dport 22 synproxy mss 1460 wscale 7 timestamp sack-perm
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -50,7 +50,7 @@ table inet filter {
|
|||||||
policy drop
|
policy drop
|
||||||
|
|
||||||
iif lo tcp dport 22 tcp flags syn ip saddr != $ip-allowlist-ssh add @ip-connlimit-ssh { ip saddr ct count over 1 } reject with tcp reset
|
iif lo tcp dport 22 tcp flags syn ip saddr != $ip-allowlist-ssh add @ip-connlimit-ssh { ip saddr ct count over 1 } reject with tcp reset
|
||||||
iif lo tcp dport 22 tcp flags syn ip6 saddr != $ip6-allowlist-ssh add @ip6-connlimit-ssh { ip6 saddr ct count over 1 } reject with tcp reset
|
iif lo tcp dport 22 tcp flags syn ip6 saddr != $ip6-allowlist-ssh add @ip6-connlimit-ssh { ip6 saddr and ffff:ffff:ffff:ffff:ffff:: ct count over 1 } reject with tcp reset
|
||||||
|
|
||||||
iif lo accept
|
iif lo accept
|
||||||
tcp dport { 80, 443 } accept
|
tcp dport { 80, 443 } accept
|
||||||
@ -58,7 +58,7 @@ table inet filter {
|
|||||||
ct state vmap { established : accept, related : accept, new : goto graceful-reject }
|
ct state vmap { established : accept, related : accept, new : goto graceful-reject }
|
||||||
|
|
||||||
tcp dport 22 ip saddr @ip-connlimit-ssh reject with tcp reset
|
tcp dport 22 ip saddr @ip-connlimit-ssh reject with tcp reset
|
||||||
tcp dport 22 ip6 saddr @ip6-connlimit-ssh reject with tcp reset
|
tcp dport 22 ip6 saddr and ffff:ffff:ffff:ffff:ffff:: @ip6-connlimit-ssh reject with tcp reset
|
||||||
tcp dport 22 synproxy mss 1460 wscale 7 timestamp sack-perm
|
tcp dport 22 synproxy mss 1460 wscale 7 timestamp sack-perm
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -54,7 +54,7 @@ table inet filter {
|
|||||||
policy drop
|
policy drop
|
||||||
|
|
||||||
iif lo tcp dport 22 tcp flags syn ip saddr != $ip-allowlist-ssh add @ip-connlimit-ssh { ip saddr ct count over 1 } reject with tcp reset
|
iif lo tcp dport 22 tcp flags syn ip saddr != $ip-allowlist-ssh add @ip-connlimit-ssh { ip saddr ct count over 1 } reject with tcp reset
|
||||||
iif lo tcp dport 22 tcp flags syn ip6 saddr != $ip6-allowlist-ssh add @ip6-connlimit-ssh { ip6 saddr ct count over 1 } reject with tcp reset
|
iif lo tcp dport 22 tcp flags syn ip6 saddr != $ip6-allowlist-ssh add @ip6-connlimit-ssh { ip6 saddr and ffff:ffff:ffff:ffff:ffff:: ct count over 1 } reject with tcp reset
|
||||||
|
|
||||||
iif lo accept
|
iif lo accept
|
||||||
tcp dport { 80, 443 } accept
|
tcp dport { 80, 443 } accept
|
||||||
@ -62,7 +62,7 @@ table inet filter {
|
|||||||
ct state vmap { established : accept, related : accept, new : goto graceful-reject }
|
ct state vmap { established : accept, related : accept, new : goto graceful-reject }
|
||||||
|
|
||||||
tcp dport 22 ip saddr @ip-connlimit-ssh reject with tcp reset
|
tcp dport 22 ip saddr @ip-connlimit-ssh reject with tcp reset
|
||||||
tcp dport 22 ip6 saddr @ip6-connlimit-ssh reject with tcp reset
|
tcp dport 22 ip6 saddr and ffff:ffff:ffff:ffff:ffff:: @ip6-connlimit-ssh reject with tcp reset
|
||||||
tcp dport 22 synproxy mss 1460 wscale 7 timestamp sack-perm
|
tcp dport 22 synproxy mss 1460 wscale 7 timestamp sack-perm
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user