diff options
author | Fernando Fernandez Mancera <ffmancera@riseup.net> | 2019-06-22 19:12:08 +0200 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2019-07-17 10:22:39 +0200 |
commit | 1188a69604c3df2a63daca9e735fdb535e8f6b63 (patch) | |
tree | 21887d78f5b30023546f40da96aaa4cf256a59e5 /tests | |
parent | 82cc676289803cfd1e69dfeaa4658d57a1547a86 (diff) |
src: introduce SYNPROXY matching
Add support for "synproxy" statement. For example (for TCP port 8888):
table ip x {
chain y {
type filter hook prerouting priority raw; policy accept;
tcp dport 8888 tcp flags syn notrack
}
chain z {
type filter hook input priority filter; policy accept;
tcp dport 8888 ct state invalid,untracked synproxy mss 1460 wscale 7 timestamp sack-perm
ct state invalid drop
}
}
Signed-off-by: Fernando Fernandez Mancera <ffmancera@riseup.net>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/py/inet/synproxy.t | 13 | ||||
-rw-r--r-- | tests/py/inet/synproxy.t.json | 71 | ||||
-rw-r--r-- | tests/py/inet/synproxy.t.payload | 72 |
3 files changed, 156 insertions, 0 deletions
diff --git a/tests/py/inet/synproxy.t b/tests/py/inet/synproxy.t new file mode 100644 index 00000000..55a05e1e --- /dev/null +++ b/tests/py/inet/synproxy.t @@ -0,0 +1,13 @@ +:synproxychain;type filter hook input priority 0 + +*ip;synproxyip;synproxychain +*ip6;synproxyip6;synproxychain +*inet;synproxyinet;synproxychain + +synproxy;ok +synproxy mss 1460 wscale 7;ok +synproxy mss 1460 wscale 5 timestamp sack-perm;ok +synproxy timestamp sack-perm;ok +synproxy timestamp;ok +synproxy sack-perm;ok + diff --git a/tests/py/inet/synproxy.t.json b/tests/py/inet/synproxy.t.json new file mode 100644 index 00000000..313fa9fe --- /dev/null +++ b/tests/py/inet/synproxy.t.json @@ -0,0 +1,71 @@ +# synproxy +[ + { + "synproxy":null + } +] + +# synproxy mss 1460 +[ + { + "synproxy": { + "mss": 1460 + } + } +] + +# synproxy wscale 7 +[ + { + "synproxy": { + "wscale": 7 + } + } +] + +# synproxy mss 1460 wscale 7 +[ + { + "synproxy": { + "mss": 1460, + "wscale": 7 + } + } +] + +# synproxy timestamp +[ + { + "synproxy": { + "flags": [ + "timestamp" + ] + } + } +] + +# synproxy timestamp sack-perm +[ + { + "synproxy": { + "flags": [ + "timestamp", + "sack-perm" + ] + } + } +] + +# synproxy mss 1460 wscale 7 timestamp sack-perm +[ + { + "synproxy": { + "mss": 1460, + "wscale": 7, + "flags": [ + "timestamp", + "sack-perm" + ] + } + } +] diff --git a/tests/py/inet/synproxy.t.payload b/tests/py/inet/synproxy.t.payload new file mode 100644 index 00000000..2e6feaaf --- /dev/null +++ b/tests/py/inet/synproxy.t.payload @@ -0,0 +1,72 @@ +# synproxy +ip synproxyip synproxychain + [ synproxy mss 0 wscale 0 ] + +# synproxy +ip6 synproxyip6 synproxychain + [ synproxy mss 0 wscale 0 ] + +# synproxy +inet synproxyinet synproxychain + [ synproxy mss 0 wscale 0 ] + +# synproxy mss 1460 wscale 7 +ip synproxyip synproxychain + [ synproxy mss 1460 wscale 7 ] + +# synproxy mss 1460 wscale 7 +ip6 synproxyip6 synproxychain + [ synproxy mss 1460 wscale 7 ] + +# synproxy mss 1460 wscale 7 +inet synproxyinet synproxychain + [ synproxy mss 1460 wscale 7 ] + +# synproxy mss 1460 wscale 5 timestamp sack-perm +ip synproxyip synproxychain + [ synproxy mss 1460 wscale 5 ] + +# synproxy mss 1460 wscale 5 timestamp sack-perm +ip6 synproxyip6 synproxychain + [ synproxy mss 1460 wscale 5 ] + +# synproxy mss 1460 wscale 5 timestamp sack-perm +inet synproxyinet synproxychain + [ synproxy mss 1460 wscale 5 ] + +# synproxy timestamp sack-perm +ip synproxyip synproxychain + [ synproxy mss 0 wscale 0 ] + +# synproxy timestamp sack-perm +ip6 synproxyip6 synproxychain + [ synproxy mss 0 wscale 0 ] + +# synproxy timestamp sack-perm +inet synproxyinet synproxychain + [ synproxy mss 0 wscale 0 ] + +# synproxy timestamp +ip synproxyip synproxychain + [ synproxy mss 0 wscale 0 ] + +# synproxy timestamp +ip6 synproxyip6 synproxychain + [ synproxy mss 0 wscale 0 ] + +# synproxy timestamp +inet synproxyinet synproxychain + [ synproxy mss 0 wscale 0 ] + +# synproxy sack-perm +ip synproxyip synproxychain + [ synproxy mss 0 wscale 0 ] + +# synproxy sack-perm +ip6 synproxyip6 synproxychain + [ synproxy mss 0 wscale 0 ] + +# synproxy sack-perm +inet synproxyinet synproxychain + [ synproxy mss 0 wscale 0 ] + |