controller

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2016 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var EventRecs []EventU2Record
View Source
var ExtraDataRecs []ExtraDataU2Record
View Source
var PacketRecs []PacketU2Record

Functions

func Error404

func Error404(w http.ResponseWriter, r *http.Request)

Error404 handles 404 - Page Not Found

func Error500

func Error500(w http.ResponseWriter, r *http.Request)

Error500 handles 500 - Internal Server Error

func ErrorES

func ErrorES(msg string, w http.ResponseWriter, r *http.Request)

ErrorES - some ElasticSearch error

func GetEntity

func GetEntity(jr json.RawMessage, v Entity) error

func HelpGET

func HelpGET(w http.ResponseWriter, r *http.Request)

func Index

func Index(w http.ResponseWriter, r *http.Request)

func InvalidToken

func InvalidToken(w http.ResponseWriter, r *http.Request)

InvalidToken handles CSRF attacks

func RecordShowGET

func RecordShowGET(w http.ResponseWriter, r *http.Request)

func RecordsGET

func RecordsGET(w http.ResponseWriter, r *http.Request)

func RecordsPOST

func RecordsPOST(w http.ResponseWriter, r *http.Request)

func Static

func Static(w http.ResponseWriter, r *http.Request)

Static maps static files

Types

type AnyU2Record

type AnyU2Record struct {
	Id                string    `json:"_id"`
	Index             string    `json:"_index"`
	Label             string    `json:"label"`
	RecordType        string    `json:"record_type"`
	Timestamp         time.Time `json:"@timestamp"`
	SensorId          int64     `json:"sensor_id"`
	EventId           int64     `json:"event_id"`
	EventSecond       int64     `json:"event_second"`
	EventMicrosecond  int64     `json:"event_microsecond"`
	GeneratorId       int64     `json:"generator_id"`
	SignatureId       int64     `json:"signature_id"`
	SrcIP             string    `json:"src_ip"`
	SPort             int64     `json:"sport"`
	DstIP             string    `json:"dst_ip"`
	DPort             int64     `json:"dport"`
	Protocol          int64     `json:"protocol"`
	Signature         string    `json:"signature"`
	PacketSecond      int64     `json:"packet_second"`
	PacketMicrosecond int64     `json:"packet_microsecond"`
	PacketDump        string    `json:"packet_dump"`
	EventType         int64     `json:"event_type"`
	EventLength       int64     `json:"event_length"`
	XType             int64     `json:"extradata_type"`
	XDataType         int64     `json:"extradata_data_type"`
	XDataLength       int64     `json:"extradata_data_length"`
	XData             string    `json:"extradata_data"`
}

type Entity

type Entity interface {
	UnmarshalEsSource(json.RawMessage) error
}

type EventU2Record

type EventU2Record struct {
	RecordType               string    `json:"record_type"`
	Timestamp                time.Time `json:"@timestamp"`
	IndexedAt                time.Time `json:"indexed_at"`
	SensorId                 int64     `json:"sensor_id"`
	SensorHostname           string    `json:"sensor_hostname"`
	SensorInterface          string    `json:"sensor_interface"`
	SensorType               string    `json:"sensor_type"`
	EventId                  int64     `json:"event_id"`
	EventSecond              int64     `json:"event_second"`
	InputType                string    `json:"input_type"`
	Source                   string    `json:"source"`
	SourceOffset             int64     `json:"source_offset"`
	EventMicrosecond         int64     `json:"event_microsecond"`
	ClassificationId         int64     `json:"classification_id,omitempty"`
	Priority                 int64     `json:"priority"`
	GeneratorId              int64     `json:"generator_id"`
	SignatureId              int64     `json:"signature_id"`
	SrcIP                    string    `json:"src_ip"`
	SrcIPv6                  string    `json:"src_ipv6,omitempty"`
	SPort                    int64     `json:"sport"`
	SrcCountryCode           string    `json:"src_country_code,omitempty"`
	SrcLocation              string    `json:"src_location,omitempty"`
	DstIP                    string    `json:"dst_ip"`
	DstIPv6                  string    `json:"dst_ipv6,omitempty"`
	DPort                    int64     `json:"dport"`
	DstCountryCode           string    `json:"dst_country_code,omitempty"`
	DstLocation              string    `json:"dst_location,omitempty"`
	Protocol                 int64     `json:"protocol"`
	Signature                string    `json:"signature"`
	SignatureRevision        int64     `json:"signature_revision"`
	RuleRaw                  string    `json:"rule_raw"`
	RuleSourceFile           string    `json:"rule_source_file"`
	RuleSourceFileLineNumber int64     `json:"rule_source_file_line_number"`
	Blocked                  int64     `json:"blocked,omitempty"`
	Impact                   int64     `json:"impact,omitempty"`
	ImpactFlag               int64     `json:"impact_flag,omitempty"`
	MplsLabel                int64     `json:"mpls_label,omitempty"`
	VlanId                   int64     `json:"vlan_id,omitempty"`
}

func (*EventU2Record) UnmarshalEsSource

func (e *EventU2Record) UnmarshalEsSource(jr json.RawMessage) error

type ExtraDataU2Record

type ExtraDataU2Record struct {
	RecordType   string    `json:"record_type"`
	Timestamp    time.Time `json:"@timestamp"`
	IndexedAt    time.Time `json:"indexed_at"`
	SensorId     int64     `json:"sensor_id"`
	EventId      int64     `json:"event_id"`
	EventSecond  int64     `json:"event_second"`
	InputType    string    `json:"input_type"`
	Source       string    `json:"source"`
	SourceOffset int64     `json:"source_offset"`
	EventType    int64     `json:"event_type,omitempty"`
	EventLength  int64     `json:"event_length,omitempty"`
	XType        int64     `json:"extradata_type,omitempty"`
	XDataType    int64     `json:"extradata_data_type,omitempty"`
	XDataLength  int64     `json:"extradata_data_length,omitempty"`
	XData        string    `json:"extradata_data,omitempty"`
}

func (*ExtraDataU2Record) UnmarshalEsSource

func (ed *ExtraDataU2Record) UnmarshalEsSource(jr json.RawMessage) error

type PacketU2Record

type PacketU2Record struct {
	RecordType        string    `json:"record_type"`
	Timestamp         time.Time `json:"@timestamp"`
	IndexedAt         time.Time `json:"indexed_at"`
	SensorId          int64     `json:"sensor_id"`
	SensorHostname    string    `json:"sensor_hostname"`
	SensorInterface   string    `json:"sensor_interface"`
	SensorType        string    `json:"sensor_type"`
	EventId           int64     `json:"event_id"`
	EventSecond       int64     `json:"event_second"`
	InputType         string    `json:"input_type"`
	Source            string    `json:"source"`
	SourceOffset      int64     `json:"source_offset"`
	PacketSecond      int64     `json:"packet_second"`
	PacketMicrosecond int64     `json:"packet_microsecond"`
	PacketDump        string    `json:"packet_dump"`
}

func (*PacketU2Record) UnmarshalEsSource

func (p *PacketU2Record) UnmarshalEsSource(jr json.RawMessage) error

Jump to

Keyboard shortcuts

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