@ -289,17 +289,14 @@ matching, but a buffer of its hook can still grow - a rule hooked at a higher
state is still evaluated once the transaction has moved past the pending rule's
hook; while the transaction is at or before that hook the walk stops, so no
higher state's policy can decide the flow early. A rule of a higher id at the
pending rule's own hook is evaluated too: stepping over the pending one must not
stall the hook, because a rule which can never resolve would otherwise hold it
open for the whole transaction. That is a choice, and its price is that a
drop:flow rule at that hook can decide before a pending accept resolves.
pending rule's own hook is inspected in the same walk: a rule which cannot be
decided by this update must not stall the hook for the rules which can. The price
is that such a rule's action - a `` drop:flow `` , say - decides the flow before the
pending accept resolves. `` ruletype-firewall-616 `` pins it.
A higher-hook rule inspects
the buffers of every state below its own hook, so its match covers the pending
rule and its action decides the flow: when it matches, the pending rule's later
no-match does not apply the default policy of its own state. Stepping over a rule
the transaction has moved past keeps that rule's accept for the packet, as a
listed partial match of it would: without it the packet default policy drops
packets of a flow which then ends up accepted.
no-match does not apply the default policy of its own state.
A sub-state's buffers can also grow after the transaction moved past the rule's
hook: a http2 trailer HEADERS frame updates the header lists above the
@ -307,9 +304,10 @@ hook: a http2 trailer HEADERS frame updates the header lists above the
not with the transaction: a http2 stream only completes once both sides closed,
and holding a rule pending that long defers the default policy past the request. The fast pattern at the hook decides there: above it a
group is retired once its rules are, so a rule whose buffer is final at that
point is not run again. A rule whose pattern can still arrive later - a raw
stream `` content `` , or a buffer that is not complete yet - keeps the window
filled, and with it the default policies of the states it covers.
point is not run again. A group whose buffer can still be rewritten is not: all
of its rules go into the list at that update, and with them the default policies
of the states they cover. A rule that would stay open because a *stream* match
can still arrive cannot use the notation at all, see the limitations below.
The bound is the transaction's end state. For a parser with per-direction sub-
states that can be later than the direction's own close - a http2 stream
@ -506,20 +504,41 @@ Two moments, for the rules of a group hooked at ``H``:
wins the state and the policy decides when nothing does. A group that also holds
a rule whose pattern can still grow above `` C `` is not retired there, so the
retirement cannot apply a default policy through it. Tracking such a rule keeps
its hook covered while the transaction has moved past it, without ending the walk
there: a match at a higher rule still gets its inspection, and the rule keeps its
packet accept. When no candidate sits above it, the walk takes the pending rules
at its end, so they are accounted for either way.
its hook, so a rule which can never resolve does not hold it open for the whole
transaction. When no candidate takes an id above them, the walk takes the pending
rules at its end, so they are accounted for either way.
`` C `` is `` H + 1 `` for the app buffers of a protocol which declares no sub-states: an
app hooked rule can only hold patterns of buffers whose engine sits at its hook, so such
a buffer cannot grow once the transaction has moved past it. Two cases do grow: a raw
stream pattern, which arrives with a later segment, and an app buffer of a protocol
declaring sub-states, because a frame can rewrite it above the hook -- an http2 trailer
HEADERS frame updates the header buffers. The first still leaves the fast pattern to say
which update brings it, so the group keeps its window filled there; the second has no
pattern which covers that update, so all the rules of the group are inspected. A rule
a buffer cannot grow once the transaction has moved past it. One case does grow: an
app buffer of a protocol declaring sub-states, because a frame can rewrite it above the
hook -- an http2 trailer HEADERS frame updates the header list buffers. The buffers of a
request that ended with END_STREAM do not: the parser says where each direction stops
growing, and that is what the revisit keys on. It has no pattern
which covers that update, so all the rules of the group are inspected there . A rule
with no fast pattern at all has no update which brings it, so a group which holds one is
inspected whole there as well. A
transaction that ends at or below `` H `` never opens a window: its end state decides,
and a window opens only for a tx that keeps going past `` H `` .
LIMITATIONS
-----------
* A rule using the auto-accept notation (`` <hook `` ) cannot match the raw stream: a
`` content `` or `` pcre `` on the stream (including a bare `` content `` before any sticky
buffer) makes the rule fail to load. The stream is the one buffer that keeps delivering
data above any hook, so a miss at the hook would not be final, and the retirement above
depends on it being so. Use the buffer keyword of the state you mean.
* A http2 request that ends with a body keeps the packets of a denied host until its
END_STREAM frame. The revisit exists because a trailer can rewrite the header lists,
so a rule hooked below them stays in the running until the request side closes, and a
pending rule appends a packet accept for the packets it holds. main decides on the
first body packet; a buffer-aware revisit - final at the hook unless one of the rule's
buffers can still change - would close the difference and needs a per-buffer flag at
registration. Pinned as it stands by
`` ruletype-firewall-620-lte-http2-body-delivered-until-request-closes `` .
* HTTP/1 rewrites `` http.header `` above its hook when a message has a trailer, so a rule
at `` http1:<request_headers `` whose pattern only appears in a trailer is retired at the
first update above the hook and the default policy of that state decides before the
trailer is inspected. This is a known gap, open with the design discussion of the
retirement bound.