Skip to content

tests: detection_filter unique_on IPs - v2#2924

Open
oferda4 wants to merge 1 commit intoOISF:masterfrom
oferda4:tests/detection-filter-unique_on-ips
Open

tests: detection_filter unique_on IPs - v2#2924
oferda4 wants to merge 1 commit intoOISF:masterfrom
oferda4:tests/detection-filter-unique_on-ips

Conversation

@oferda4
Copy link
Contributor

@oferda4 oferda4 commented Feb 19, 2026

Add test coverage for the new detection_filter option unique_on, for dst_ip and src_ip (both IPv4 and IPv6).

Tests added:

  • detection_filter-distinct-dstip: validates distinct dst_ip counting triggers alert when threshold exceeded
  • detection_filter-distinct-dstip-no-dups: validates no alert when distinct dst_ip count stays below threshold
  • detection_filter-distinct-srcip: validates distinct src_ip counting triggers alert when threshold exceeded
  • detection_filter-distinct-srcip-no-dups: validates no alert when distinct src_ip count stays below threshold
  • detection_filter-distinct-dstip6: validates dst_ip counting with IPv6

Uses ICMP/ICMPv6 to demonstrate that IP-based unique_on works with any protocol (unlike port-based unique_on which requires tcp/udp/sctp).

v2:
- detection_filter-distinct-dstip-higher-threshold: validates logic with count > 1 (count 3, 4 distinct IPs)

Previous PR: #2890

Ticket: https://redmine.openinfosecfoundation.org/issues/8250
Suricata PR: OISF/suricata#14853

Add test coverage for the new detection_filter option unique_on, for
dst_ip and src_ip (both IPv4 and IPv6).

Tests added:
- detection_filter-distinct-dstip: validates distinct dst_ip counting
  triggers alert when threshold exceeded
- detection_filter-distinct-dstip-no-dups: validates no alert when
  distinct dst_ip count stays below threshold
- detection_filter-distinct-srcip: validates distinct src_ip counting
  triggers alert when threshold exceeded
- detection_filter-distinct-srcip-no-dups: validates no alert when
  distinct src_ip count stays below threshold
- detection_filter-distinct-dstip6: validates dst_ip counting with IPv6
- detection_filter-distinct-srcip6: validates src_ip counting with IPv6
- detection_filter-distinct-dstip-higher-threshold: validates logic with
  count > 1 (count 3, 4 distinct IPs)

Uses ICMP/ICMPv6 to demonstrate that IP-based unique_on works with any
protocol (unlike port-based unique_on which requires tcp/udp/sctp).

Ticket: #8250
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant