-
Notifications
You must be signed in to change notification settings - Fork 28
ruleset: make synflood lighter using ct state #31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Make synflood inteject as found in default setup quicker by using ct state attribute and avoiding packet data examination. Bytecode before: ``` // block A implicit [ meta load l4proto => reg 1 ] [ cmp eq reg 1 0x00000006 ] // block B V1 [ payload load 1b @ transport header + 13 => reg 1 ] [ bitwise reg 1 = ( reg 1 & 0x00000017 ) ^ 0x00000000 ] [ cmp eq reg 1 0x00000002 ] // verdict [ immediate reg 0 jump -> syn_flood ] ``` After: ``` // block B V2 [ ct load state => reg 1 ] [ bitwise reg 1 = ( reg 1 & 0x00000008 ) ^ 0x00000000 ] [ cmp neq reg 1 0x00000000 ] // block A explicit [ meta load l4proto => reg 1 ] [ cmp eq reg 1 0x00000006 ] // verdict [ immediate reg 0 jump -> syn_flood ] ```
|
Reordering conditions presumes ct state is cache-hot at the point, can be vice-versa. Either way falls under measurable timer resolution compared to payload loading. EDIT: hi @jow- |
Somewhat similar to PR22 to discard packets as soon as it is known they need to be discarded. Proto first not viable in this place
quite dumb to add extra checks before mainstream state plays This reverts commit aeb6cac.
|
Got hint in forums another (starting empty) chain of similar power is useful in forward chain. |
|
default net.netfilter.nf_conntrack_tcp_loose=1 permits opening connection state with 2x synack and bypass intended protection. Update follows the setting. |
|
small rework due - also take care of forwarded traffic. |
|
.. not |
Make synflood inteject as found in default setup quicker by using ct state attribute and avoiding packet data examination.
Bytecode before:
After:
Signed-Off-By: Andris PE neandris@gmail.com