Update the tests to use JSON format and the new dataset syntax.
-10.16.1.11,{"test": "success","context":3}
+[{"ip": "10.16.1.11", "test": "success", "context":3}]
-alert http any any -> 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;)
+alert http any any -> any any (flow:established,to_server; http.host; content:"testmyids.com"; ip.src; dataset:isset,src_ip,type ip,load src.lst,format json, enrichment_key src_ip, value_key ip; sid:1;)
-d3d3LnRlc3RteWlkcy5jb20=,{"context":"gold old test", "year": 2005}
+[{"host": "www.testmyids.com", "context":"gold old test", "year": 2005}]
-10.16.1.11,{"test": "success","context":3}
+[{"ip": "10.16.1.11", "test": "success", "context":3}]
-alert http any any -> any any (flow:established,to_server; http.host; datajson:isset,badhost,type string,load host.lst,key bad_host; ip.src; datajson:isset,src_ip,type ip,load src.lst,key src_ip; sid:1;)
+alert http any any -> any any (flow:established,to_server; http.host; dataset:isset,badhost,type string,load host.lst,format json,enrichment_key bad_host,value_key host; ip.src; dataset:isset,src_ip,type ip,load src.lst,format json,enrichment_key src_ip,value_key ip; sid:1;)
-b65d49730d16e5a8a7b2ab95350848b8,{"year": 2007, "where": "home"}
+[{"hash": "b65d49730d16e5a8a7b2ab95350848b8", "year": 2007, "where": "home"}]
-e0ca4ff795b3f32d45260678e4ab79884793c05a149f2b350d10274451dc210a,{"year":2005,"where":"internet"}
-#E0CA4FF795B3F32D45260678E4AB79884793C05A149F2B350D10274451DC210A,{"year":2005,"where":"internet"}
+[{"hash": "e0ca4ff795b3f32d45260678e4ab79884793c05a149f2b350d10274451dc210a","year":2005,"where":"internet"}]
+++ /dev/null
-6951a4eb86e09aac29a003a35ee4d6b4a8468a6e,{"year":2006,"where":"internet"}
-alert http any any -> any any (flow:established,to_server; http.host; content: "testmyids"; to_sha256; datajson:isset,badcat,type sha256,load badsha.lst,key bad_sha; sid:1; rev:1;)
-alert http any any -> any any (flow:established,to_server; http.host; content: "testmyids"; to_md5; datajson:isset,badmd5,type md5,load badmd5.lst,key bad_md5; sid:2; rev:1;)
+alert http any any -> any any (flow:established,to_server; http.host; content: "testmyids"; to_sha256; dataset:isset,badcat,type sha256,load badsha.lst,format json,enrichment_key bad_sha,value_key hash; sid:1; rev:1;)
+alert http any any -> any any (flow:established,to_server; http.host; content: "testmyids"; to_md5; dataset:isset,badmd5,type md5,load badmd5.lst,format json,enrichment_key bad_md5,value_key hash; sid:2; rev:1;)
-d3d3LnRlc3RteWlkcy5jb20=,{"context":"good old test", "year": 2005}
-d3d3LnRlc3RteWlkcy5jb20=,{"context":"gold old test", "year": 2006}
+[
+ {"host":"www.testmyids.com", "context":"good old test", "year": 2005},
+ {"host":"www.testmyids.com", "context":"gold old test", "year": 2006}
+]
-10.16.1.11,{"test": "success","context":1}
-10.16.1.11,{"test": "fail","context":2}
+[
+ {"ip": "10.16.1.11","test": "success","context":1},
+ {"ip": "10.16.1.11","test": "fail","context":2}
+]
-alert http any any -> any any (flow:established,to_server; http.host; datajson:isset,badhost,type string,load host.lst,key bad_host; ip.src; datajson:isset,src_ip,type ip,load src.lst,key src_ip; sid:1;)
+alert http any any -> any any (flow:established,to_server; http.host; dataset:isset,badhost,type string,load host.lst,format json,enrichment_key bad_host,value_key host; ip.src; dataset:isset,src_ip,type ip,load src.lst,format json,enrichment_key src_ip,value_key ip; sid:1;)
+++ /dev/null
-d3d3LnRlc3RteWlkcy5jb20=,"context"
+++ /dev/null
-10.16.1.12,1.2
-10.16.1.11,42
+++ /dev/null
-10.16.1.11,1.2
+++ /dev/null
-alert http any any -> any any (flow:established,to_server; http.host; datajson:isset,badhost,type string,load host.lst,key bad_host; ip.src; datajson:isset,bip,type ipv6,load ip.lst,key ip; sid:1;)
-alert http any any -> any any (flow:established,to_server; http.host; datajson:isset,badhost,type string,load host.lst,key bad_host; ip.src; datajson:isset,bip2,type ipv6,load ip2.lst,key ip; sid:2;)
+++ /dev/null
-requires:
- min-version: 8
-
-args:
- - -k none --set datasets.enabled=yes
-
-checks:
- - filter:
- count: 2
- match:
- event_type: alert
- - filter:
- count: 1
- match:
- event_type: alert
- alert.signature_id: 1
- alert.extra.ip: 42
- alert.extra.bad_host: context
- - filter:
- count: 1
- match:
- event_type: alert
- alert.signature_id: 2
- alert.extra.ip: 1.2
- alert.extra.bad_host: context
-alert http any any -> any any (flow:established,to_server; ip.src; datajson:isset,bip,type ipv6,load ip.lst,key ip; sid:1;)
-alert http any any -> any any (flow:established,to_server; http.host; datajson:isset,badhost,type string,load host.lst,key bad_host; sid:2;)
+alert http any any -> any any (flow:established,to_server; ip.src; dataset:isset,bip,type ipv6,load ip.lst,key ip; sid:1;)
+alert http any any -> any any (flow:established,to_server; http.host; dataset:isset,badhost,type string,load host.lst,enrichment_key bad_host; sid:2;)
-alert http any any -> any any (flow:established,to_server; ip.src; datajson:isset,bip,type ipv6,load ip.lst,key ip; sid:1;)
+alert http any any -> any any (flow:established,to_server; ip.src; dataset:isset,bip,type ipv6,load ip.lst,format json, enrichment_key ip, value_key ip; sid:1;)