endpoints

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2020 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EPResult

type EPResult uint8

EPResult represents the result of a check against an EndpointPermission

const (
	NoMatch EPResult = iota
	Undeterminable
	Denied
	Permitted
)

Endpoint matching return values

func (EPResult) String

func (epr EPResult) String() string

type Endpoint

type Endpoint interface {
	Matches(entity *intel.Entity) (result EPResult, reason string)
	String() string
}

Endpoint describes an Endpoint Matcher

type EndpointASN

type EndpointASN struct {
	EndpointBase

	ASN    uint
	Reason string
}

EndpointASN matches ASNs.

func (*EndpointASN) Matches

func (ep *EndpointASN) Matches(entity *intel.Entity) (result EPResult, reason string)

Matches checks whether the given entity matches this endpoint definition.

func (*EndpointASN) String

func (ep *EndpointASN) String() string

type EndpointAny

type EndpointAny struct {
	EndpointBase
}

EndpointAny matches anything.

func (*EndpointAny) Matches

func (ep *EndpointAny) Matches(entity *intel.Entity) (result EPResult, reason string)

Matches checks whether the given entity matches this endpoint definition.

func (*EndpointAny) String

func (ep *EndpointAny) String() string

type EndpointBase

type EndpointBase struct {
	Protocol  uint8
	StartPort uint16
	EndPort   uint16

	Permitted bool
}

EndpointBase provides general functions for implementing an Endpoint to reduce boilerplate.

type EndpointCountry

type EndpointCountry struct {
	EndpointBase

	Country string
}

EndpointCountry matches countries.

func (*EndpointCountry) Matches

func (ep *EndpointCountry) Matches(entity *intel.Entity) (result EPResult, reason string)

Matches checks whether the given entity matches this endpoint definition.

func (*EndpointCountry) String

func (ep *EndpointCountry) String() string

type EndpointDomain

type EndpointDomain struct {
	EndpointBase

	OriginalValue string
	Domain        string
	DomainZone    string
	MatchType     uint8
	Reason        string
}

EndpointDomain matches domains.

func (*EndpointDomain) Matches

func (ep *EndpointDomain) Matches(entity *intel.Entity) (result EPResult, reason string)

Matches checks whether the given entity matches this endpoint definition.

func (*EndpointDomain) String

func (ep *EndpointDomain) String() string

type EndpointIP

type EndpointIP struct {
	EndpointBase

	IP     net.IP
	Reason string
}

EndpointIP matches IPs.

func (*EndpointIP) Matches

func (ep *EndpointIP) Matches(entity *intel.Entity) (result EPResult, reason string)

Matches checks whether the given entity matches this endpoint definition.

func (*EndpointIP) String

func (ep *EndpointIP) String() string

type EndpointIPRange

type EndpointIPRange struct {
	EndpointBase

	Net    *net.IPNet
	Reason string
}

EndpointIPRange matches IP ranges.

func (*EndpointIPRange) Matches

func (ep *EndpointIPRange) Matches(entity *intel.Entity) (result EPResult, reason string)

Matches checks whether the given entity matches this endpoint definition.

func (*EndpointIPRange) String

func (ep *EndpointIPRange) String() string

type EndpointLists

type EndpointLists struct {
	EndpointBase

	ListSet *intel.ListSet
	Lists   string
	Reason  string
}

EndpointLists matches endpoint lists.

func (*EndpointLists) Matches

func (ep *EndpointLists) Matches(entity *intel.Entity) (result EPResult, reason string)

Matches checks whether the given entity matches this endpoint definition.

func (*EndpointLists) String

func (ep *EndpointLists) String() string

type Endpoints

type Endpoints []Endpoint

Endpoints is a list of permitted or denied endpoints.

func ParseEndpoints

func ParseEndpoints(entries []string) (Endpoints, error)

ParseEndpoints parses a list of endpoints and returns a list of Endpoints for matching.

func (Endpoints) IsSet

func (e Endpoints) IsSet() bool

IsSet returns whether the Endpoints object is "set".

func (Endpoints) Match

func (e Endpoints) Match(entity *intel.Entity) (result EPResult, reason string)

Match checks whether the given entity matches any of the endpoint definitions in the list.

func (Endpoints) String

func (e Endpoints) String() string

Jump to

Keyboard shortcuts

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