A ruby wrapper for the Project Honeypot's DNS API (forked from https://github.com/cmaxw/project-honeypot )
Go to file
Guillaume Dott 415f7c9d24 Add `ProjectHoneypot::Rack` class to DRY 2015-05-27 11:09:44 +02:00
lib Add `ProjectHoneypot::Rack` class to DRY 2015-05-27 11:09:44 +02:00
spec Improve tests rspec syntax 2013-01-14 14:30:07 +01:00
.gitignore Add temporary files (swap, backup) to gitignore 2012-12-21 16:49:19 +01:00
Gemfile Update Gemfile and gemspec file 2012-12-19 15:04:40 +01:00
MIT-LICENSE Update copyright information 2013-01-20 01:57:52 +01:00
README.rdoc Inverse api_key and ip_address arguments in lookup method 2013-01-20 01:27:37 +01:00
project_honeypot.gemspec Add github repo as homepage 2013-01-20 01:30:00 +01:00

README.rdoc

= Project Honeypot

Project Honeypot is a programmatic interface to the Project Honeypot HTTP:BL service for identifying suspicious ip addresses.

It is a handy thing to be able to identify spammers, harvesters, and other suspicious IP addresses if you're worried about who might be abusing your service.

== Requirements

This Gem requires that you have an Http:BL API key from Project Honeypot. You can get one at http://projecthhoneypot.org

== Configuration

  ProjectHoneypot.configure do
    @api_key = 'api_key'
    @score = 42
    @last_activity = 10
    @offenses = [:comment_spammer, :suspicious, :harvester]
  end

== Usage

  require 'project_honeypot'

HTTP:BL lookups through Project Honeypot result in a Url object that gives you the risk score, last activity, and types of offenses the ip address is listed for.

The score is worse the higher it is and the last_activity is in days.


=== Example #1: Suspicious IP Address

  @listing = ProjectHoneypot.lookup("<ip_address>", "<api_key>")
  @listing.safe?
  # => false

  @listing.safe?(score: 64, last_activity: 10, offenses: [:comment_spammer])
  # => true

  @listing.ip_address
  # => "192.168.1.1"

  @listing.score
  # => 63

  @listing.last_activity
  # => 1

  @listing.offenses
  # => [:comment_spammer, :suspicious]

  @listing.comment_spammer?
  # => true

  @listing.suspicious?
  # => true

  @listing.harvester?
  # => false

  @listing.search_engine?
  # => false

=== Example #2: Safe IP Address

  @listing = ProjectHoneypot.lookup("<ip_address>")
  @listing.safe?
  # => true

  @listing.ip_address
  # => "192.168.1.1"

  @listing.score
  # => 0

  @listing.last_activity
  # => nil

  @listing.offenses
  # => []

  @listing.comment_spammer?
  # => false

  @listing.suspicious?
  # => false

  @listing.harvester?
  # => false