mirror of
https://github.com/rapid7/metasploit-framework
synced 2024-11-05 14:57:30 +01:00
Add msftidy check for datastore option DEBUG usage
This commit is contained in:
parent
ab94f15a60
commit
46b678e9d2
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user