From 29d3e5abd746e2000d7bf35780b7dc95ed96b3b1 Mon Sep 17 00:00:00 2001 From: Eric Leblond Date: Wed, 2 Oct 2024 21:54:47 +0200 Subject: [PATCH] tests: add initial datajson test --- tests/datajson/datajson-01-ip/input.pcap | Bin 0 -> 1104 bytes tests/datajson/datajson-01-ip/src.lst | 1 + tests/datajson/datajson-01-ip/test.rules | 1 + tests/datajson/datajson-01-ip/test.yaml | 20 ++++++++++++++++++++ 4 files changed, 22 insertions(+) create mode 100644 tests/datajson/datajson-01-ip/input.pcap create mode 100644 tests/datajson/datajson-01-ip/src.lst create mode 100644 tests/datajson/datajson-01-ip/test.rules create mode 100644 tests/datajson/datajson-01-ip/test.yaml diff --git a/tests/datajson/datajson-01-ip/input.pcap b/tests/datajson/datajson-01-ip/input.pcap new file mode 100644 index 0000000000000000000000000000000000000000..8fb6832de69b21a5981f5eab3f5820dec990de8b GIT binary patch literal 1104 zc-noE-A~g{7{=f314*%Am>7vyCtS!JY-_tOXc$5iK?b^D4cE0hj3umH+729lfJ9@$ zohZaa5(ytSMx!?-P7`i0+&M3d8n1+yC|;^}dQO`KSe7+;o1XXd{PLXVeLieIUv+^8 z4j&INtk9b)}Ad_wje#f zv;La?{Mcpq9?b%{Jl+=`S2N3+{w~^Q-0l;U{I|so{bWtcVLE)9%mWO7&?IS;O6icU zY%T4-KS${0!l|{4_R1kwX~~mrh!ax0o=*SblCAS=jm|P5cBXx>cfsr2_6eaZ5Wqq` zN@?+dO}ST>(hhrP-vJB{$ta9QWH}ucLITH*=%yv1xw*NJg-t78%4N)us^>ZOhKY^f zU>0j+TP+$h;Y27J3Go~|sH(U?nt^bDV>y<}+WhW?KBB0vo>hL?pjPd>Ypm*=-`QwQ z`5lIlFSj;&+Br917bqGCz+7scaYq4#_{rJL&~yE`COOMMkpH& any any (flow:established,to_server; http.host; content:"testmyids.com"; ip.src; datajson:isset,src_ip,type ip,load src.lst,key src_ip; sid:1;) diff --git a/tests/datajson/datajson-01-ip/test.yaml b/tests/datajson/datajson-01-ip/test.yaml new file mode 100644 index 000000000..6dc740286 --- /dev/null +++ b/tests/datajson/datajson-01-ip/test.yaml @@ -0,0 +1,20 @@ +requires: + features: + - HAVE_LIBJANSSON + files: + - src/datasets.c + +args: + - -k none --set datasets.enabled=yes + +checks: + - filter: + count: 1 + match: + event_type: alert + - filter: + count: 1 + match: + event_type: alert + alert.signature_id: 1 + alert.extra.src_ip.test: success -- 2.47.2