mirror of
https://github.com/zeek/zeek.git
synced 2025-10-15 21:18:20 +00:00
Merge remote-tracking branch 'origin/topic/johanna/gh-4061'
* origin/topic/johanna/gh-4061: Update BiF-tracking, add is_event_handled Address review comments and small updates for DNS warnings Raise warnings when for DNS events that are not raised due to dns_skip_all_addl
This commit is contained in:
commit
b2222e97a1
17 changed files with 158 additions and 6 deletions
3
testing/btest/Baseline/bifs.is_event_handled/err
Normal file
3
testing/btest/Baseline/bifs.is_event_handled/err
Normal file
|
@ -0,0 +1,3 @@
|
|||
### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63.
|
||||
error in <...>/is_event_handled.zeek, line 11: is_event_handled: 'myfunc1' is not an event (is_event_handled(myfunc1))
|
||||
error in <...>/is_event_handled.zeek, line 12: is_event_handled: 'conn_id' is not an event (is_event_handled(conn_id))
|
5
testing/btest/Baseline/bifs.is_event_handled/out
Normal file
5
testing/btest/Baseline/bifs.is_event_handled/out
Normal file
|
@ -0,0 +1,5 @@
|
|||
### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63.
|
||||
T
|
||||
F
|
||||
F
|
||||
F
|
|
@ -385,6 +385,7 @@ scripts/base/init-default.zeek
|
|||
scripts/base/protocols/dns/__load__.zeek
|
||||
scripts/base/protocols/dns/consts.zeek
|
||||
scripts/base/protocols/dns/main.zeek
|
||||
scripts/base/protocols/dns/check-event-handlers.zeek
|
||||
scripts/base/protocols/finger/__load__.zeek
|
||||
scripts/base/protocols/finger/spicy-events.zeek
|
||||
scripts/base/protocols/finger/main.zeek
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63.
|
||||
542 seen BiFs, 0 unseen BiFs (), 0 new BiFs ()
|
||||
543 seen BiFs, 0 unseen BiFs (), 0 new BiFs ()
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63.
|
||||
warning in <...>/check-event-handlers.zeek, line 15: Used event 'dns_EDNS_tcp_keepalive' will not be raised because 'dns_skip_all_addl' is true
|
||||
warning in <...>/check-event-handlers.zeek, line 15: Used event 'dns_EDNS_cookie' will not be raised because 'dns_skip_all_addl' is true
|
||||
warning in <...>/check-event-handlers.zeek, line 15: Used event 'dns_EDNS_ecs' will not be raised because 'dns_skip_all_addl' is true
|
||||
warning in <...>/check-event-handlers.zeek, line 15: Used event 'dns_EDNS_addl' will not be raised because 'dns_skip_all_addl' is true
|
||||
warning in <...>/check-event-handlers.zeek, line 18: Used event 'dns_TKEY' will not contain any data in 'ans' because 'dns_skip_all_addl' is true
|
12
testing/btest/bifs/is_event_handled.zeek
Normal file
12
testing/btest/bifs/is_event_handled.zeek
Normal file
|
@ -0,0 +1,12 @@
|
|||
# @TEST-EXEC: zeek -b %INPUT >out 2>err
|
||||
# @TEST-EXEC: btest-diff out
|
||||
# @TEST-EXEC: TEST_DIFF_CANONIFIER=$SCRIPTS/diff-remove-abspath btest-diff err
|
||||
|
||||
function myfunc1(a: addr, b: addr): int
|
||||
{
|
||||
}
|
||||
|
||||
print is_event_handled("zeek_init"); # T
|
||||
print is_event_handled("dns_EDNS_cookie"); # F
|
||||
print is_event_handled("myfunc1"); # builtin error
|
||||
print is_event_handled("conn_id"); # builtin error
|
|
@ -357,6 +357,7 @@ global known_BiFs = set(
|
|||
"is_alnum",
|
||||
"is_alpha",
|
||||
"is_ascii",
|
||||
"is_event_handled",
|
||||
"is_file_analyzer",
|
||||
"is_icmp_port",
|
||||
"is_local_interface",
|
||||
|
|
|
@ -3,6 +3,6 @@
|
|||
@load policy/protocols/dns/auth-addl
|
||||
|
||||
event dns_EDNS_cookie(c: connection, msg: dns_msg, opt: dns_edns_cookie)
|
||||
{
|
||||
print opt;
|
||||
}
|
||||
{
|
||||
print opt;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,31 @@
|
|||
# Check that warnings are for events that will not be raised
|
||||
|
||||
# @TEST-EXEC: zeek -b %INPUT
|
||||
# @TEST-EXEC: TEST_DIFF_CANONIFIER=$SCRIPTS/diff-remove-abspath btest-diff .stderr
|
||||
|
||||
@load base/protocols/dns
|
||||
|
||||
event dns_EDNS_addl(c: connection, msg: dns_msg, ans: dns_edns_additional)
|
||||
{
|
||||
print "";
|
||||
}
|
||||
|
||||
event dns_EDNS_ecs(c: connection, msg: dns_msg, opt: dns_edns_ecs)
|
||||
{
|
||||
print "";
|
||||
}
|
||||
|
||||
event dns_EDNS_tcp_keepalive(c: connection, msg: dns_msg, opt: dns_edns_tcp_keepalive)
|
||||
{
|
||||
print "";
|
||||
}
|
||||
|
||||
event dns_EDNS_cookie(c: connection, msg: dns_msg, opt: dns_edns_cookie)
|
||||
{
|
||||
print "";
|
||||
}
|
||||
|
||||
event dns_TKEY(c: connection, msg: dns_msg, ans: dns_tkey)
|
||||
{
|
||||
print "";
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue