types

package
v0.22.0 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2019 License: Apache-2.0 Imports: 6 Imported by: 30

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Alert

type Alert struct {
	BasicResource `yaml:",inline"`
	Name          string `json:",omitempty" yaml:"Name"`
	Description   string `json:",omitempty" yaml:"Description"`
	Expression    string `json:",omitempty" valid:"nonzero" yaml:"Expression"`
	Action        string `json:",omitempty" valid:"regexp=^(|http://|https://|file://).*$" yaml:"Action"`
	Trigger       string `json:",omitempty" valid:"regexp=^(graph|duration:.+|)$" yaml:"Trigger"`
	CreateTime    time.Time
}

Alert is a set of parameters, the Alert Action will Trigger according to its Expression.

func NewAlert

func NewAlert() *Alert

NewAlert creates a New empty Alert, only CreateTime is set.

type BasicResource added in v0.19.0

type BasicResource struct {
	UUID string `yaml:"UUID"`
}

BasicResource is a resource with a unique identifier

func (*BasicResource) ID added in v0.19.0

func (b *BasicResource) ID() string

ID returns the alert ID

func (*BasicResource) SetID added in v0.19.0

func (b *BasicResource) SetID(i string)

SetID set ID

type Capture

type Capture struct {
	BasicResource  `yaml:",inline"`
	GremlinQuery   string           `json:"GremlinQuery,omitempty" valid:"isGremlinExpr" yaml:"GremlinQuery"`
	BPFFilter      string           `json:"BPFFilter,omitempty" valid:"isBPFFilter" yaml:"BPFFilter"`
	Name           string           `json:"Name,omitempty" yaml:"Name"`
	Description    string           `json:"Description,omitempty" yaml:"Description"`
	Type           string           `json:"Type,omitempty" yaml:"Type"`
	Count          int              `json:"Count" yaml:"Count"`
	PCAPSocket     string           `json:"PCAPSocket,omitempty" yaml:"PCAPSocket"`
	Port           int              `json:"Port,omitempty" yaml:"Port"`
	RawPacketLimit int              `json:"RawPacketLimit,omitempty" valid:"isValidRawPacketLimit" yaml:"RawPacketLimit"`
	HeaderSize     int              `json:"HeaderSize,omitempty" valid:"isValidCaptureHeaderSize" yaml:"HeaderSize"`
	ExtraTCPMetric bool             `json:"ExtraTCPMetric" yaml:"ExtraTCPMetric"`
	IPDefrag       bool             `json:"IPDefrag" yaml:"IPDefrag"`
	ReassembleTCP  bool             `json:"ReassembleTCP" yaml:"ReassembleTCP"`
	LayerKeyMode   string           `json:"LayerKeyMode,omitempty" valid:"isValidLayerKeyMode" yaml:"LayerKeyMode"`
	ExtraLayers    flow.ExtraLayers `json:"ExtraLayers,omitempty" yaml:"ExtraLayers"`
}

Capture describes a capture API

func NewCapture

func NewCapture(query string, bpfFilter string) *Capture

NewCapture creates a new capture

type EdgeRule added in v0.19.1

type EdgeRule struct {
	BasicResource `yaml:",inline"`
	Name          string         `yaml:"Name"`
	Description   string         `yaml:"Description"`
	Src           string         `valid:"isGremlinExpr" yaml:"Src"`
	Dst           string         `valid:"isGremlinExpr" yaml:"Dst"`
	Metadata      graph.Metadata `yaml:"Metadata"`
}

EdgeRule describes a edge rule

func (*EdgeRule) Validate added in v0.20.0

func (e *EdgeRule) Validate() error

Validate verifies the nodedgee rule does not create invalid edges

type NodeRule added in v0.19.1

type NodeRule struct {
	BasicResource `yaml:",inline"`
	Name          string         `yaml:"Name"`
	Description   string         `yaml:"Description"`
	Metadata      graph.Metadata `yaml:"Metadata"`
	Action        string         `valid:"regexp=^(create|update)$" yaml:"Action"`
	Query         string         `valid:"isGremlinOrEmpty" yaml:"Query"`
}

NodeRule describes a node rule

func (*NodeRule) Validate added in v0.20.0

func (n *NodeRule) Validate() error

Validate verifies the node rule does not create invalid node or change important attributes of an existing node

type PacketInjection added in v0.17.0

type PacketInjection struct {
	BasicResource    `yaml:",inline"`
	Src              string `yaml:"Src"`
	Dst              string `yaml:"Dst"`
	SrcIP            string `yaml:"SrcIP"`
	DstIP            string `yaml:"DstIP"`
	SrcMAC           string `yaml:"SrcMAC"`
	DstMAC           string `yaml:"DstMAC"`
	SrcPort          int64  `yaml:"SrcPort"`
	DstPort          int64  `yaml:"DstPort"`
	Type             string `yaml:"Type"`
	Payload          string `yaml:"Payload"`
	TrackingID       string
	ICMPID           int64 `yaml:"ICMPID"`
	Count            int64 `yaml:"Count"`
	Interval         int64 `yaml:"Interval"`
	Increment        bool  `yaml:"Increment"`
	IncrementPayload int64 `yaml:"IncrementPayload"`
	StartTime        time.Time
	Pcap             []byte `yaml:"Pcap"`
}

PacketInjection packet injector API parameters

func (*PacketInjection) Validate added in v0.17.0

func (pi *PacketInjection) Validate() error

Validate verifies the packet injection type is supported

type Resource

type Resource interface {
	ID() string
	SetID(string)
}

Resource used as interface resources for each API

type TopologyParam

type TopologyParam struct {
	GremlinQuery string `json:"GremlinQuery,omitempty" valid:"isGremlinExpr" yaml:"GremlinQuery"`
}

TopologyParam topology API parameter

type Workflow added in v0.19.0

type Workflow struct {
	BasicResource `yaml:",inline"`
	Name          string          `yaml:"Name" valid:"nonzero"`
	Description   string          `yaml:"Description"`
	Parameters    []WorkflowParam `yaml:"Parameters"`
	Source        string          `valid:"isValidWorkflow" yaml:"Source"`
}

Workflow describes a workflow

type WorkflowChoice added in v0.19.0

type WorkflowChoice struct {
	Value       string `yaml:"Value"`
	Description string `yaml:"Description"`
}

WorkflowChoice describes one value within a choice

type WorkflowParam added in v0.19.0

type WorkflowParam struct {
	Name        string           `yaml:"Name"`
	Description string           `yaml:"Description"`
	Type        string           `yaml:"Type"`
	Default     interface{}      `yaml:"Default"`
	Values      []WorkflowChoice `yaml:"Values"`
}

WorkflowParam describes a workflow parameter

Jump to

Keyboard shortcuts

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