bin/ssh_scan in ssh_scan-0.0.15 vs bin/ssh_scan in ssh_scan-0.0.16
- old
+ new
@@ -111,10 +111,14 @@
opts.on("--fingerprint-db [FILE]",
"File location of fingerprint database (Default: ./fingerprints.db)") do |fingerprint_db|
options[:fingerprint_database] = fingerprint_db
end
+ opts.on("--suppress-update-status", "Do not check for updates") do
+ options[:suppress_update_status] = true
+ end
+
opts.on("-u", "--unit-test [FILE]",
"Throw appropriate exit codes based on compliance status") do
options[:unit_test] = true
end
@@ -136,10 +140,15 @@
"Display just version info") do
puts SSHScan::VERSION
exit
end
+ opts.on("-l", "--listen", "Listen and serve API requests") do
+ SSHScan::API.run!
+ exit
+ end
+
opts.on_tail("-h", "--help", "Show this message") do
puts opts
puts "\nExamples:"
puts "\n ssh_scan -t 192.168.1.1"
puts " ssh_scan -t server.example.com"
@@ -188,14 +197,22 @@
puts "\nReason: policy file supplied is not a file"
exit 1
end
# Check to see if we're running the latest released version
-update = SSHScan::Update.new
-if update.newer_gem_available?
- options[:logger].warn("You're NOT using the latest version of ssh_scan, try 'gem update ssh_scan' to get the latest")
-else
- options[:logger].info("You're using the latest version of ssh_scan #{SSHScan::VERSION}")
+if !options[:suppress_update_status]
+ update = SSHScan::Update.new
+ if update.newer_gem_available?
+ options[:logger].warn("You're NOT using the latest version of ssh_scan, try 'gem update ssh_scan' to get the latest")
+ else
+ if update.errors.size > 0
+ update.errors.each do |error|
+ options[:logger].error(error)
+ end
+ else
+ options[:logger].info("You're using the latest version of ssh_scan #{SSHScan::VERSION}")
+ end
+ end
end
options[:policy_file] = SSHScan::Policy.from_file(options[:policy])
# Perform scan and get results