Skip to content

codelux/malware_api

 
 

Repository files navigation

Malware

Malware is a rails plugin to take advantage of the Google Safe Browsing API.

This version is compatible with Rails 3 and also implements looping logic to more accurately detect blacklisted entities according to the recommended practices by Google.

Installation

Request an API key from http://code.google.com/apis/safebrowsing/key_signup.html

Create a config file with your API key. In RAILS_ROOT/config/initializers/malware_key.rb

# API key for Google Safe Browsing API
# http://code.google.com/apis/safebrowsing/
SAFEBROWSING_API_KEY = "ABQIAAAAN_MxjBsAgBKC8N1cqNloZhT3elDgi-bgogZuFD30ho7emQ1XEw"

Install the plugin

gem install malware

Generate and run a migration to create the tables

script/generate malware_migration
rake db:migrate

Example

$ script/console 
Loading development environment (Rails 2.3.5)
>> Malware.update
=> "Updated malware info (in 73.865188s) +301657/-0 (1.47438 1.18185)\n"
>> Malware.is_blacklisted?('http://malware.testing.google.test/testing/malware/')
=> true
>> Malware.is_blacklisted?('http://www.jorgebernal.info/')
=> false

Copyright (c) 2009 Jorge Bernal [email protected], released under the MIT license

About

Google Safe Browsing API for rails

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Ruby 100.0%