abuseipdb

package
v0.0.0-...-324f9bf Latest Latest
Warning

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

Go to latest
Published: May 28, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ProviderName      = "abuseipdb"
	APIURL            = "https://api.abuseipdb.com"
	HostIPPath        = "/api/v2/check"
	IndentPipeHyphens = " |-----"

	ResultTTL      = 12 * time.Hour
	OutputPriority = 40
)

Variables

This section is empty.

Functions

Types

type Client

type Client struct {
	session.Session
}

func (*Client) CreateTable

func (c *Client) CreateTable(data []byte) (*table.Writer, error)

func (*Client) Enabled

func (c *Client) Enabled() bool

func (*Client) FindHost

func (c *Client) FindHost() ([]byte, error)

func (*Client) GetConfig

func (c *Client) GetConfig() *session.Session

func (*Client) Initialise

func (c *Client) Initialise() error

func (*Client) Priority

func (c *Client) Priority() int

type Config

type Config struct {
	session.Session
	Host   netip.Addr
	APIKey string
	// contains filtered or unexported fields
}

type HostSearchResult

type HostSearchResult struct {
	Raw  json.RawMessage `json:"raw"`
	Data struct {
		IPAddress            string    `json:"ipAddress,omitempty"`
		IsPublic             bool      `json:"isPublic,omitempty"`
		IPVersion            int       `json:"ipVersion,omitempty"`
		IsWhitelisted        bool      `json:"isWhitelisted,omitempty"`
		AbuseConfidenceScore int       `json:"abuseConfidenceScore,omitempty"`
		CountryCode          string    `json:"countryCode,omitempty"`
		CountryName          string    `json:"countryName,omitempty"`
		UsageType            string    `json:"usageType,omitempty"`
		Isp                  string    `json:"isp,omitempty"`
		Domain               string    `json:"domain,omitempty"`
		Hostnames            []string  `json:"hostnames,omitempty"`
		IsTor                bool      `json:"isTor,omitempty"`
		TotalReports         int       `json:"totalReports,omitempty"`
		NumDistinctUsers     int       `json:"numDistinctUsers,omitempty"`
		LastReportedAt       time.Time `json:"lastReportedAt,omitempty"`
		Reports              []struct {
			ReportedAt          time.Time `json:"reportedAt,omitempty"`
			Comment             string    `json:"comment,omitempty"`
			Categories          []int     `json:"categories,omitempty"`
			ReporterID          int       `json:"reporterId,omitempty"`
			ReporterCountryCode string    `json:"reporterCountryCode,omitempty"`
			ReporterCountryName string    `json:"reporterCountryName,omitempty"`
		} `json:"reports,omitempty"`
	} `json:"data,omitempty"`
}

func (*HostSearchResult) CreateTable

func (ssr *HostSearchResult) CreateTable() *table.Writer

type Provider

type Provider interface {
	LoadData() ([]byte, error)
	CreateTable([]byte) (*table.Writer, error)
}

Jump to

Keyboard shortcuts

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