class Ratonvirus::Scanner::Eicar

Dummy EICAR file scanner to test the integration with this gem.

Only to be used for testing the functionality of this gem.

Constants

EICAR_SHA256

SHA256 digest of the EICAR test file for virus testing See: en.wikipedia.org/wiki/EICAR_test_file

Public Class Methods

executable?() click to toggle source
# File lib/ratonvirus/scanner/eicar.rb, line 14
def executable?
  true
end

Protected Instance Methods

run_scan(path) click to toggle source
# File lib/ratonvirus/scanner/eicar.rb, line 21
def run_scan(path)
  if File.file?(path)
    sha256 = Digest::SHA256.file path
    errors << :antivirus_virus_detected if sha256 == EICAR_SHA256
  else
    errors << :antivirus_file_not_found
  end
rescue StandardError
  errors << :antivirus_client_error
end