inteldb

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: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IntelDBDocument

type IntelDBDocument struct {
	// ID holds the database ID for this document
	ID bson.ObjectId `bson:"_id,omitempty"`

	// Host is the IP this document pertains to
	Host string `bson:"host"`

	// Intelligence holds data obtained from whois as well as geo
	// data about this host
	Intelligence data.IntelData `bson:"intel"`

	// BlacklistScore contains score info from the blacklist module
	BlacklistScore int `bson:"blacklist_score"`

	// BlaclistChecked is the date that this item was last checked
	BlacklistChecked time.Time `bson:"blacklist_date_checked"`
}

IntelDBDocument provides abstraction for the IntelDB data layer

type IntelDBHandle

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

IntelDBHandle provides the application abstractions for IntelDB

func NewIntelDBHandle

func NewIntelDBHandle(conf *config.Resources) *IntelDBHandle

NewIntelDBHandle provides a new handle to the intelligence database

func (IntelDBHandle) Close

func (i IntelDBHandle) Close()

Close shuts down the write loop and blocks until the final writes are complete

func (IntelDBHandle) Find

func (i IntelDBHandle) Find(host string) *Query

Find looks up a document by host

func (IntelDBHandle) Write

func (i IntelDBHandle) Write(dat data.IntelData)

Write places an object in the database

type Query

type Query struct {

	// if there was a lookup error it will be here
	Error error
	// contains filtered or unexported fields
}

Query provides some methods for grabbing data out of the DB and inspecting it. This also implies some methods for existance check.

func (*Query) GetBlacklistedScore

func (q *Query) GetBlacklistedScore() (int, error)

GetBlacklistedScore will return a score for an intel entry

func (*Query) IntelData

func (q *Query) IntelData(dat *data.IntelData) error

IntelData gives the intel data object that's in the query. Also returns error which is the content of the query's error field.

func (*Query) SetBlacklistedScore

func (q *Query) SetBlacklistedScore(score int) error

SetBlacklistedScore is used to set the blacklisted score of a particular host note that this function will also set the score for the date it was last set

Jump to

Keyboard shortcuts

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