You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
suricata/doc/userguide/rules
Ofer Dagan 7627756360 detect/detection_filter: add unique_on option
Add optional unique_on {src_port|dst_port} to detection_filter for
exact distinct port counting within the seconds window.

Features:
- Runtime uses a single 64k-bit (8192 bytes) union bitmap per
  threshold entry with O(1) updates.
- Follows detection_filter semantics: alerting starts after the
  threshold (> count), not at it.
- On window expiry, the window is reset and the current packet's
  port is recorded as the first distinct of the new window.

Validation:
- unique_on requires a ported transport protocol; reject rules
  that are not tcp/udp/sctp or that use ip (protocol any).

Memory management:
- Bitmap memory is bounded by detect.thresholds.memcap.
- New counters: bitmap_memuse and bitmap_alloc_fail.

Tests:
- C unit tests for parsing, distinct counting, window reset, and
  allocation failure fallback.
- suricata-verify tests for distinct src/dst port counting.

Task #7928
6 months ago
..
dataset-examples
dns-keywords
fast-pattern
flow-keywords
header-keywords
http-keywords
intro
normalized-buffers
payload-keywords
pcre
rule-types
app-layer.rst doc/devguide: document app-layer protocol detection 1 year ago
base64-keywords.rst
bypass-keyword.rst doc: Update bypass docs to use new keyword format 1 year ago
config.rst detect/config: add flow tracking doc 1 year ago
datasets.rst doc/userguide: enrichment_key is now context_key 1 year ago
dcerpc-keywords.rst doc/userguide: add initial protocols overview 11 months ago
decode-layer.rst decode/etag: ETag 802.1BR decoder 11 months ago
dhcp-keywords.rst
differences-from-snort.rst
dnp3-keywords.rst detect: dnp3.func is now a generic integer 9 months ago
dns-keywords.rst doc/userguide: add initial protocols overview 11 months ago
email-keywords.rst detect: add email.body_md5 keyword 11 months ago
enip-keyword.rst
fast-pattern-explained.rst
file-keywords.rst doc: minor verbiage tweaks and reST fix 10 months ago
flow-keywords.rst doc: add elephant.flow usage section 8 months ago
ftp-keywords.rst doc/ftp: Document ftp.completion_code sticky buffer 1 year ago
header-keywords.rst detect: tcp.window is now a generic integer 9 months ago
http-keywords.rst doc/userguide: add initial protocols overview 11 months ago
http2-keywords.rst detect: http2.errorcode is now a generic integer 10 months ago
ike-keywords.rst
index.rst doc/rules/index: keep rule types doc near the end 11 months ago
integer-keywords.rst detect/integers: rename index all1 to all 9 months ago
intro.rst detect: new command line option : list-rule-protos 8 months ago
ip-reputation-rules.rst
ipaddr.rst
ja-keywords.rst doc/userguide: add initial protocols overview 11 months ago
kerberos-keywords.rst detect/krb5: move krb5_msg_type to rust 11 months ago
ldap-keywords.rst doc: multi-integers section for rules 11 months ago
lua-detection.rst doc/lua-detection: fix example script; remove most buffers 1 year ago
mdns-keywords.rst mdns: add mdns parser, logger and detection 1 year ago
meta.rst doc/rules/internals: minor fixes 11 months ago
modbus-keyword.rst
mqtt-keywords.rst detect/integers: generalize support for bitflags modifier 10 months ago
multi-buffer-matching.rst detect: list-keywords cli shows multi-buffers 11 months ago
nfs-keywords.rst detect/nfs: move nfs_procedure to rust 11 months ago
noalert.rst
payload-keywords.rst doc/userguide: endswith can be mixed with offset/distance/within 7 months ago
pgsql-keywords.rst pgsql: add query keyword 1 year ago
prefilter-keywords.rst
quic-keywords.rst
rfb-keywords.rst
rule-types.rst doc: adjust for master to main rename 11 months ago
rules-internals.rst doc/rules/internals: minor fixes 11 months ago
sdp-keywords.rst doc/sdp: fix doc to match real keywords names 1 year ago
sip-keywords.rst
smb-keywords.rst doc/userguide: add initial protocols overview 11 months ago
smtp-keywords.rst
snmp-keywords.rst detect/snmp: pdu_type keyword now accepts strings 11 months ago
ssh-keywords.rst doc: fix typo and missing newline in rules/ssh_keywords. 11 months ago
tag.rst
thresholding.rst detect/detection_filter: add unique_on option 6 months ago
tls-keywords.rst detect/ssl: properly handle negation in ssl_version keyword 8 months ago
transforms.rst doc/luaxform: Clarify luaxform calling convention 8 months ago
vlan-keywords.rst
websocket-keywords.rst detect/integers: generalize support for bitflags modifier 10 months ago
xbits.rst doc/userguide: add xbits tx scope support 11 months ago