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 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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