Commit Graph

6 Commits (353885acc29f847f4b681ffa5fbc276c766a5cf2)

Author SHA1 Message Date
Yash Datre 353885acc2 detect: extend app-layer-protocol to accept a pipe-separated value list
Extend the app-layer-protocol keyword to accept a pipe-separated list of
protocol values, so a single rule can match any of several protocols:

    app-layer-protocol:[!]<proto1>|<proto2>[|...][,<qualifier>]...;

A non-negated list matches when the flow's protocol equals any listed value
(OR); a negated list matches when it equals none of them (NOR). The
single-value form and the trailing mode qualifier are unchanged.

Matching keeps the historical AppProtoEquals() equivalences by default
(dns/doh2, http/http1/http2, dcerpc/smb, ...). An `exact` qualifier selects
strict identity matching with no equivalences and no http umbrella; it
combines with a direction mode in any order. Because a flow is never the
generic ALPROTO_HTTP, `http,exact` is rejected at load.

Values are expanded once at rule load into an effective match-set bitmask, so
the per-packet match is a single bitmask test. Single-value rules remain
prefilterable; multi-value rules are excluded from prefiltering and an
explicit prefilter on them is rejected. Conflicting keyword combinations
(duplicate or overlapping negations, mixed positive/negated) are rejected at
load. Engine-analysis reports the effective match set.

Ticket: 7705
(cherry picked from commit 43bc2db41e)
4 days ago
Philippe Antoine f4378eb306 doc/devguide: document app-layer protocol detection
Ticket: 6022
1 year ago
Victor Julien e3c6554ee6 detect/app-layer-protocol: allow matching on 'unknown' 1 year ago
Victor Julien 6f5fd77cb9 detect/app-layer-state: keyword for protocol state
Allow matching on the app-layer protocol state.
1 year ago
Philippe Antoine fcdd7f000a detect: add options to app-layer-protocol keyword
Ticket: 4921

app-layer-protocol keyword accept an optional mode to precise
which protocol we want to match: toclient, toserver, final,
or original
2 years ago
Victor Julien 56ffba9fd8 doc: initial app-layer keywords
Document app-layer-protocol and make a start with app-layer-event.
10 years ago