diff --git a/tools/msftidy.rb b/tools/msftidy.rb index 631be06786..3857c311c2 100755 --- a/tools/msftidy.rb +++ b/tools/msftidy.rb @@ -613,12 +613,21 @@ class Msftidy # Check for modules registering the DEBUG datastore option # # @see https://github.com/rapid7/metasploit-framework/issues/3816 - def check_datastore_debug + def check_register_datastore_debug if @source =~ /Opt.*\.new\(["'](?i)DEBUG(?-i)["']/ error('Please don\'t register a DEBUG datastore option, it has an special meaning and is used for development') end end + # Check for modules using the DEBUG datastore option + # + # @see https://github.com/rapid7/metasploit-framework/issues/3816 + def check_use_datastore_debug + if @source =~ /datastore\[["'](?i)DEBUG(?-i)["']\]/ + error('Please don\'t use the DEBUG datastore option in production, it has an special meaning and is used for development') + end + end + private def load_file(file) @@ -669,7 +678,8 @@ def run_checks(full_filepath) tidy.check_udp_sock_get tidy.check_invalid_url_scheme tidy.check_print_debug - tidy.check_datastore_debug + tidy.check_register_datastore_debug + tidy.check_use_datastore_debug return tidy end