mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38:20 +00:00
Merge remote-tracking branch 'origin/topic/jsiwek/at-deprecated'
* origin/topic/jsiwek/at-deprecated: Add @deprecate to policy/protocols/smb/__load__.bro Add @deprecated directive
This commit is contained in:
commit
33a8e7a7c7
12 changed files with 89 additions and 28 deletions
6
CHANGES
6
CHANGES
|
@ -1,4 +1,10 @@
|
||||||
|
|
||||||
|
2.5-950 | 2018-08-31 08:54:36 -0700
|
||||||
|
|
||||||
|
* Add @deprecated directive and deprecate policy/protocols/smb/__load__.bro
|
||||||
|
|
||||||
|
@deprecated a warning stating that the script is deprecated. (Jon Siwek, Corelight)
|
||||||
|
|
||||||
2.5-947 | 2018-08-30 16:05:36 -0500
|
2.5-947 | 2018-08-30 16:05:36 -0500
|
||||||
|
|
||||||
* Allow loading policy/protocols/smb once again (Jon Siwek, Corelight)
|
* Allow loading policy/protocols/smb once again (Jon Siwek, Corelight)
|
||||||
|
|
3
NEWS
3
NEWS
|
@ -348,6 +348,9 @@ New Functionality
|
||||||
with &redef by appending the result of expressions "a", "b", and "c" to
|
with &redef by appending the result of expressions "a", "b", and "c" to
|
||||||
the vector at initialization-time.
|
the vector at initialization-time.
|
||||||
|
|
||||||
|
- A new @deprecated directive was added. It marks a script-file as
|
||||||
|
deprecated.
|
||||||
|
|
||||||
Changed Functionality
|
Changed Functionality
|
||||||
---------------------
|
---------------------
|
||||||
|
|
||||||
|
|
2
VERSION
2
VERSION
|
@ -1 +1 @@
|
||||||
2.5-947
|
2.5-950
|
||||||
|
|
|
@ -27,6 +27,16 @@ executed. Directives are evaluated before script execution begins.
|
||||||
|
|
||||||
print "File:", @FILENAME;
|
print "File:", @FILENAME;
|
||||||
|
|
||||||
|
.. bro:keyword:: @deprecated
|
||||||
|
|
||||||
|
Marks the current script as deprecated. This can be placed anywhere in
|
||||||
|
the script, but a good convention is to put it as the first line.
|
||||||
|
You can also supply additional comments.
|
||||||
|
|
||||||
|
Example::
|
||||||
|
|
||||||
|
@deprecated "Use '@load foo' instead"
|
||||||
|
|
||||||
.. bro:keyword:: @load
|
.. bro:keyword:: @load
|
||||||
|
|
||||||
Loads the specified Bro script, specified as the relative pathname
|
Loads the specified Bro script, specified as the relative pathname
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
@load frameworks/files/extract-all-files.bro
|
@load frameworks/files/extract-all-files.bro
|
||||||
@load policy/misc/dump-events.bro
|
@load policy/misc/dump-events.bro
|
||||||
@load policy/protocols/dhcp/deprecated_events.bro
|
@load policy/protocols/dhcp/deprecated_events.bro
|
||||||
|
@load policy/protocols/smb/__load__.bro
|
||||||
|
|
||||||
@load ./example.bro
|
@load ./example.bro
|
||||||
|
|
||||||
|
|
|
@ -1 +1,3 @@
|
||||||
|
@deprecated "Use '@load base/protocols/smb' instead"
|
||||||
|
|
||||||
@load base/protocols/smb
|
@load base/protocols/smb
|
||||||
|
|
|
@ -82,7 +82,7 @@
|
||||||
@load protocols/modbus/track-memmap.bro
|
@load protocols/modbus/track-memmap.bro
|
||||||
@load protocols/mysql/software.bro
|
@load protocols/mysql/software.bro
|
||||||
@load protocols/rdp/indicate_ssl.bro
|
@load protocols/rdp/indicate_ssl.bro
|
||||||
@load protocols/smb/__load__.bro
|
#@load protocols/smb/__load__.bro
|
||||||
@load protocols/smb/log-cmds.bro
|
@load protocols/smb/log-cmds.bro
|
||||||
@load protocols/smtp/blocklists.bro
|
@load protocols/smtp/blocklists.bro
|
||||||
@load protocols/smtp/detect-suspicious-orig.bro
|
@load protocols/smtp/detect-suspicious-orig.bro
|
||||||
|
|
17
src/scan.l
17
src/scan.l
|
@ -315,6 +315,23 @@ when return TOK_WHEN;
|
||||||
return TOK_ATTR_SYNCHRONIZED;
|
return TOK_ATTR_SYNCHRONIZED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@deprecated.* {
|
||||||
|
auto num_files = file_stack.length();
|
||||||
|
auto comment = skip_whitespace(yytext + 11);
|
||||||
|
|
||||||
|
if ( num_files > 0 )
|
||||||
|
{
|
||||||
|
auto lf = file_stack[num_files - 1];
|
||||||
|
|
||||||
|
if ( lf->name )
|
||||||
|
reporter->Warning("deprecated script loaded from %s:%d %s",
|
||||||
|
lf->name, lf->line, comment);
|
||||||
|
else
|
||||||
|
reporter->Warning("deprecated script loaded from command line arguments %s", comment);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
reporter->Warning("deprecated script loaded %s", comment);
|
||||||
|
}
|
||||||
|
|
||||||
@DEBUG return TOK_DEBUG; // marks input for debugger
|
@DEBUG return TOK_DEBUG; // marks input for debugger
|
||||||
|
|
||||||
|
|
|
@ -1,16 +1,18 @@
|
||||||
warning in /home/jon/projects/bro/bro/testing/btest/../../scripts/policy/protocols/dhcp/deprecated_events.bro, line 245: deprecated (dhcp_discover)
|
warning in /Users/jon/projects/bro/bro/scripts/policy/protocols/dhcp/deprecated_events.bro, line 245: deprecated (dhcp_discover)
|
||||||
warning in /home/jon/projects/bro/bro/testing/btest/../../scripts/policy/protocols/dhcp/deprecated_events.bro, line 248: deprecated (dhcp_offer)
|
warning in /Users/jon/projects/bro/bro/scripts/policy/protocols/dhcp/deprecated_events.bro, line 248: deprecated (dhcp_offer)
|
||||||
warning in /home/jon/projects/bro/bro/testing/btest/../../scripts/policy/protocols/dhcp/deprecated_events.bro, line 251: deprecated (dhcp_request)
|
warning in /Users/jon/projects/bro/bro/scripts/policy/protocols/dhcp/deprecated_events.bro, line 251: deprecated (dhcp_request)
|
||||||
warning in /home/jon/projects/bro/bro/testing/btest/../../scripts/policy/protocols/dhcp/deprecated_events.bro, line 254: deprecated (dhcp_decline)
|
warning in /Users/jon/projects/bro/bro/scripts/policy/protocols/dhcp/deprecated_events.bro, line 254: deprecated (dhcp_decline)
|
||||||
warning in /home/jon/projects/bro/bro/testing/btest/../../scripts/policy/protocols/dhcp/deprecated_events.bro, line 257: deprecated (dhcp_ack)
|
warning in /Users/jon/projects/bro/bro/scripts/policy/protocols/dhcp/deprecated_events.bro, line 257: deprecated (dhcp_ack)
|
||||||
warning in /home/jon/projects/bro/bro/testing/btest/../../scripts/policy/protocols/dhcp/deprecated_events.bro, line 260: deprecated (dhcp_nak)
|
warning in /Users/jon/projects/bro/bro/scripts/policy/protocols/dhcp/deprecated_events.bro, line 260: deprecated (dhcp_nak)
|
||||||
warning in /home/jon/projects/bro/bro/testing/btest/../../scripts/policy/protocols/dhcp/deprecated_events.bro, line 263: deprecated (dhcp_release)
|
warning in /Users/jon/projects/bro/bro/scripts/policy/protocols/dhcp/deprecated_events.bro, line 263: deprecated (dhcp_release)
|
||||||
warning in /home/jon/projects/bro/bro/testing/btest/../../scripts/policy/protocols/dhcp/deprecated_events.bro, line 266: deprecated (dhcp_inform)
|
warning in /Users/jon/projects/bro/bro/scripts/policy/protocols/dhcp/deprecated_events.bro, line 266: deprecated (dhcp_inform)
|
||||||
warning in /home/jon/projects/bro/bro/scripts/policy/protocols/dhcp/deprecated_events.bro, line 245: deprecated (dhcp_discover)
|
warning in /Users/jon/projects/bro/bro/scripts/policy/protocols/smb/__load__.bro, line 1: deprecated script loaded from /Users/jon/projects/bro/bro/testing/btest/../../scripts//broxygen/__load__.bro:10 "Use '@load base/protocols/smb' instead"
|
||||||
warning in /home/jon/projects/bro/bro/scripts/policy/protocols/dhcp/deprecated_events.bro, line 248: deprecated (dhcp_offer)
|
warning in /Users/jon/projects/bro/bro/testing/btest/../../scripts//policy/protocols/dhcp/deprecated_events.bro, line 245: deprecated (dhcp_discover)
|
||||||
warning in /home/jon/projects/bro/bro/scripts/policy/protocols/dhcp/deprecated_events.bro, line 251: deprecated (dhcp_request)
|
warning in /Users/jon/projects/bro/bro/testing/btest/../../scripts//policy/protocols/dhcp/deprecated_events.bro, line 248: deprecated (dhcp_offer)
|
||||||
warning in /home/jon/projects/bro/bro/scripts/policy/protocols/dhcp/deprecated_events.bro, line 254: deprecated (dhcp_decline)
|
warning in /Users/jon/projects/bro/bro/testing/btest/../../scripts//policy/protocols/dhcp/deprecated_events.bro, line 251: deprecated (dhcp_request)
|
||||||
warning in /home/jon/projects/bro/bro/scripts/policy/protocols/dhcp/deprecated_events.bro, line 257: deprecated (dhcp_ack)
|
warning in /Users/jon/projects/bro/bro/testing/btest/../../scripts//policy/protocols/dhcp/deprecated_events.bro, line 254: deprecated (dhcp_decline)
|
||||||
warning in /home/jon/projects/bro/bro/scripts/policy/protocols/dhcp/deprecated_events.bro, line 260: deprecated (dhcp_nak)
|
warning in /Users/jon/projects/bro/bro/testing/btest/../../scripts//policy/protocols/dhcp/deprecated_events.bro, line 257: deprecated (dhcp_ack)
|
||||||
warning in /home/jon/projects/bro/bro/scripts/policy/protocols/dhcp/deprecated_events.bro, line 263: deprecated (dhcp_release)
|
warning in /Users/jon/projects/bro/bro/testing/btest/../../scripts//policy/protocols/dhcp/deprecated_events.bro, line 260: deprecated (dhcp_nak)
|
||||||
warning in /home/jon/projects/bro/bro/scripts/policy/protocols/dhcp/deprecated_events.bro, line 266: deprecated (dhcp_inform)
|
warning in /Users/jon/projects/bro/bro/testing/btest/../../scripts//policy/protocols/dhcp/deprecated_events.bro, line 263: deprecated (dhcp_release)
|
||||||
|
warning in /Users/jon/projects/bro/bro/testing/btest/../../scripts//policy/protocols/dhcp/deprecated_events.bro, line 266: deprecated (dhcp_inform)
|
||||||
|
warning in /Users/jon/projects/bro/bro/testing/btest/../../scripts//policy/protocols/smb/__load__.bro, line 1: deprecated script loaded from command line arguments "Use '@load base/protocols/smb' instead"
|
||||||
|
|
|
@ -1,10 +1,11 @@
|
||||||
warning in /home/jon/projects/bro/bro/scripts/policy/protocols/dhcp/deprecated_events.bro, line 245: deprecated (dhcp_discover)
|
warning in /Users/jon/projects/bro/bro/scripts/policy/protocols/dhcp/deprecated_events.bro, line 245: deprecated (dhcp_discover)
|
||||||
warning in /home/jon/projects/bro/bro/scripts/policy/protocols/dhcp/deprecated_events.bro, line 248: deprecated (dhcp_offer)
|
warning in /Users/jon/projects/bro/bro/scripts/policy/protocols/dhcp/deprecated_events.bro, line 248: deprecated (dhcp_offer)
|
||||||
warning in /home/jon/projects/bro/bro/scripts/policy/protocols/dhcp/deprecated_events.bro, line 251: deprecated (dhcp_request)
|
warning in /Users/jon/projects/bro/bro/scripts/policy/protocols/dhcp/deprecated_events.bro, line 251: deprecated (dhcp_request)
|
||||||
warning in /home/jon/projects/bro/bro/scripts/policy/protocols/dhcp/deprecated_events.bro, line 254: deprecated (dhcp_decline)
|
warning in /Users/jon/projects/bro/bro/scripts/policy/protocols/dhcp/deprecated_events.bro, line 254: deprecated (dhcp_decline)
|
||||||
warning in /home/jon/projects/bro/bro/scripts/policy/protocols/dhcp/deprecated_events.bro, line 257: deprecated (dhcp_ack)
|
warning in /Users/jon/projects/bro/bro/scripts/policy/protocols/dhcp/deprecated_events.bro, line 257: deprecated (dhcp_ack)
|
||||||
warning in /home/jon/projects/bro/bro/scripts/policy/protocols/dhcp/deprecated_events.bro, line 260: deprecated (dhcp_nak)
|
warning in /Users/jon/projects/bro/bro/scripts/policy/protocols/dhcp/deprecated_events.bro, line 260: deprecated (dhcp_nak)
|
||||||
warning in /home/jon/projects/bro/bro/scripts/policy/protocols/dhcp/deprecated_events.bro, line 263: deprecated (dhcp_release)
|
warning in /Users/jon/projects/bro/bro/scripts/policy/protocols/dhcp/deprecated_events.bro, line 263: deprecated (dhcp_release)
|
||||||
warning in /home/jon/projects/bro/bro/scripts/policy/protocols/dhcp/deprecated_events.bro, line 266: deprecated (dhcp_inform)
|
warning in /Users/jon/projects/bro/bro/scripts/policy/protocols/dhcp/deprecated_events.bro, line 266: deprecated (dhcp_inform)
|
||||||
error in /home/jon/projects/bro/bro/scripts/policy/frameworks/control/controller.bro, line 22: The '' control command is unknown.
|
warning in /Users/jon/projects/bro/bro/scripts/policy/protocols/smb/__load__.bro, line 1: deprecated script loaded from /Users/jon/projects/bro/bro/scripts/broxygen/__load__.bro:10 "Use '@load base/protocols/smb' instead"
|
||||||
|
error in /Users/jon/projects/bro/bro/scripts/policy/frameworks/control/controller.bro, line 22: The '' control command is unknown.
|
||||||
<params>, line 1: received termination signal
|
<params>, line 1: received termination signal
|
||||||
|
|
3
testing/btest/Baseline/language.at-deprecated/.stderr
Normal file
3
testing/btest/Baseline/language.at-deprecated/.stderr
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
warning in ./foo.bro, line 1: deprecated script loaded from command line arguments
|
||||||
|
warning in ./bar.bro, line 1: deprecated script loaded from ./foo.bro:2 "Use '@load qux.bro' instead"
|
||||||
|
warning in ./baz.bro, line 1: deprecated script loaded from ./foo.bro:3
|
16
testing/btest/language/at-deprecated.bro
Normal file
16
testing/btest/language/at-deprecated.bro
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
# @TEST-EXEC: bro -b foo
|
||||||
|
# @TEST-EXEC: TEST_DIFF_CANONIFIER=$SCRIPTS/diff-remove-abspath btest-diff .stderr
|
||||||
|
|
||||||
|
@TEST-START-FILE foo.bro
|
||||||
|
@deprecated
|
||||||
|
@load bar
|
||||||
|
@load baz
|
||||||
|
@TEST-END-FILE
|
||||||
|
|
||||||
|
@TEST-START-FILE bar.bro
|
||||||
|
@deprecated "Use '@load qux.bro' instead"
|
||||||
|
@TEST-END-FILE
|
||||||
|
|
||||||
|
@TEST-START-FILE baz.bro
|
||||||
|
@deprecated
|
||||||
|
@TEST-END-FILE
|
Loading…
Add table
Add a link
Reference in a new issue