blacklisted

package
v0.9.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 19, 2016 License: GPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IpVoid

func IpVoid(log *log.Logger, ip string) (int, int)

ipVoid queries ipVoid and returns a score and a count

func UrlVoid

func UrlVoid(log *log.Logger, url string) (int, int)

Types

type Blacklisted

type Blacklisted struct {
	// contains filtered or unexported fields
}

Blacklisted provides a handle for the blacklist module

func New

func New(c *config.Resources) *Blacklisted

New will create a new blacklisted module

func (*Blacklisted) AddToBlacklist

func (b *Blacklisted) AddToBlacklist(host string, score int)

AddToBlacklist sets a score in the inteldb table for a specific host

func (*Blacklisted) CheckBlacklisted

func (b *Blacklisted) CheckBlacklisted(host string) int

CheckBlacklisted checks in the database to see if we've already got this address checked if it is then we return a positive (0 inclusive) score. If not then return non-positive.

func (*Blacklisted) Run

func (b *Blacklisted) Run()

Run runs the module

type BlacklistedData

type BlacklistedData struct {
	ID    bson.ObjectId `bson:"_id,omitempty"` // Ident
	Host  string        `bson:"remote_host"`   // can be a url or ip
	Score int           `bson:"score"`         // Number of blacklists
}

BlacklistedData is a datatype designed to reduce reliance on ipvoid and urlvoid. It contains some information about addresses and urls which have already been checked agains those services

type UrlShort

type UrlShort struct {
	Url string   `bson:"url"`
	IPs []string `bson:"ip"`
}

UrlShort is a shortened version of the URL datatype that only accounts for the IP and url (hostname)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL