report

package
v0.0.0-...-db561fb Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2022 License: MIT Imports: 9 Imported by: 4

Documentation

Overview

Package report provides report service for veinmind-runner and veinmind-plugin

Index

Constants

View Source
const BufferSize = 1 << 8
View Source
const Namespace = "github.com/chaitin/veinmind-tools/veinmind-common/go/service/report"

Variables

This section is empty.

Functions

func DefaultReportClient

func DefaultReportClient(pOpts ...PluginOption) *reportClient

Types

type AlertDetail

type AlertDetail struct {
	MaliciousFileDetail *MaliciousFileDetail `json:"malicious_file_detail,omitempty"`
	WeakpassDetail      *WeakpassDetail      `json:"weakpass_detail,omitempty"`
	BackdoorDetail      *BackdoorDetail      `json:"backdoor_detail,omitempty"`
	SensitiveFileDetail *SensitveFileDetail  `json:"sensitive_file_detail,omitempty"`
	SensitiveEnvDetail  *SensitiveEnvDetail  `json:"sensitive_env_detail,omitempty"`
	HistoryDetail       *HistoryDetail       `json:"history_detail,omitempty"`
	AssetDetail         *AssetDetail         `json:"asset_detail,omitempty"`
	BasicDetail         *BasicDetail         `json:"basic_detail,omitempty"`
}

type AlertType

type AlertType uint32
const (
	Vulnerability AlertType = iota
	MaliciousFile
	Backdoor
	Sensitive
	AbnormalHistory
	Weakpass
	Asset
	Basic
)

func (AlertType) MarshalJSON

func (a AlertType) MarshalJSON() ([]byte, error)

func (*AlertType) UnmarshalJSON

func (a *AlertType) UnmarshalJSON(b []byte) error

type AssetApplicationDetails

type AssetApplicationDetails struct {
	Type     string               `json:"type"`
	FilePath string               `json:"file_path,omitempty"`
	Packages []AssetPackageDetail `json:"packages"`
}

type AssetDetail

type AssetDetail struct {
	OS           AssetOSDetail             `json:"os"`
	PackageInfos []AssetPackageDetails     `json:"package_infos"`
	Applications []AssetApplicationDetails `json:"applications"`
}

type AssetOSDetail

type AssetOSDetail struct {
	Family string `json:"family"`
	Name   string `json:"name"`
	Eosl   bool   `json:"EOSL,omitempty"`
}

type AssetPackageDetail

type AssetPackageDetail struct {
	Name            string `json:"name"`
	Version         string `json:"version"`
	Release         string `json:"release"`
	Epoch           int    `json:"epoch"`
	Arch            string `json:"arch"`
	SrcName         string `json:"srcName"`
	SrcVersion      string `json:"srcVersion"`
	SrcRelease      string `json:"srcRelease"`
	SrcEpoch        int    `json:"srcEpoch"`
	Modularitylabel string `json:"modularitylabel"`
	Indirect        bool   `json:"indirect"`
	License         string `json:"license"`
	Layer           string `json:"layer"`
}

type AssetPackageDetails

type AssetPackageDetails struct {
	FilePath string               `json:"file_path"`
	Packages []AssetPackageDetail `json:"packages"`
}

type BackdoorDetail

type BackdoorDetail struct {
	FileDetail
	Description string `json:"description"`
}

type BasicDetail

type BasicDetail struct {
	References  []string `json:"references"`
	CreatedTime int64    `json:"created_time"`
	Env         []string `json:"env"`
	Entrypoint  []string `json:"entrypoint"`
	Cmd         []string `json:"cmd"`
	WorkingDir  string   `json:"working_dir"`
	Author      string   `json:"author"`
}

type DetectType

type DetectType uint32
const (
	Image DetectType = iota
	Container
)

func (DetectType) MarshalJSON

func (d DetectType) MarshalJSON() ([]byte, error)

func (*DetectType) UnmarshalJSON

func (d *DetectType) UnmarshalJSON(b []byte) error

type EventType

type EventType uint32
const (
	Risk EventType = iota
	Invasion
	Info
)

func (EventType) MarshalJSON

func (e EventType) MarshalJSON() ([]byte, error)

func (*EventType) UnmarshalJSON

func (e *EventType) UnmarshalJSON(b []byte) error

type FileDetail

type FileDetail struct {
	Path  string      `json:"path"`
	Perm  os.FileMode `json:"perm"`
	Size  int64       `json:"size"`
	Gname string      `json:"gname"`
	Gid   int64       `json:"gid"`
	Uid   int64       `json:"uid"`
	Uname string      `json:"uname"`
	Ctim  int64       `json:"ctim"`
	Mtim  int64       `json:"mtim"`
	Atim  int64       `json:"atim"`
}

type HistoryDetail

type HistoryDetail struct {
	Instruction string `json:"instruction"`
	Content     string `json:"content"`
	Description string `json:"description"`
}

type Level

type Level uint32
const (
	Low Level = iota
	Medium
	High
	Critical
	None
)

func (Level) MarshalJSON

func (l Level) MarshalJSON() ([]byte, error)

func (*Level) UnmarshalJSON

func (l *Level) UnmarshalJSON(b []byte) error

type MaliciousFileDetail

type MaliciousFileDetail struct {
	FileDetail
	Engine        string `json:"engine"`
	MaliciousType string `json:"malicious_type"`
	MaliciousName string `json:"malicious_name"`
}

type PluginOption

type PluginOption func(r *reportClient) (*reportClient, error)

PluginOption use for plugin standalone version (without host)

func WithDisableLog

func WithDisableLog() PluginOption

type ReportEvent

type ReportEvent struct {
	ID           string        `json:"id"`
	Time         time.Time     `json:"time"`
	Level        Level         `json:"level"`
	DetectType   DetectType    `json:"detect_type"`
	EventType    EventType     `json:"event_type"`
	AlertType    AlertType     `json:"alert_type"`
	AlertDetails []AlertDetail `json:"alert_details"`
}

type ReportService

type ReportService struct {
	EventChannel chan ReportEvent
}

func NewReportService

func NewReportService() *ReportService

func (*ReportService) Add

func (s *ReportService) Add(registry *service.Registry)

func (*ReportService) Report

func (s *ReportService) Report(evt ReportEvent)

type SensitiveEnvDetail

type SensitiveEnvDetail struct {
	Key             string `json:"key"`
	Value           string `json:"value"`
	RuleID          int64  `json:"rule_id"`
	RuleName        string `json:"rule_name"`
	RuleDescription string `json:"rule_description"`
}

type SensitveFileDetail

type SensitveFileDetail struct {
	FileDetail
	RuleID          int64  `json:"rule_id"`
	RuleName        string `json:"rule_name"`
	RuleDescription string `json:"rule_description"`
}

type WeakpassDetail

type WeakpassDetail struct {
	Username string          `json:"username"`
	Password string          `json:"password"`
	Service  WeakpassService `json:"service"`
}

type WeakpassService

type WeakpassService uint32
const (
	SSH WeakpassService = iota
)

func (WeakpassService) MarshalJSON

func (w WeakpassService) MarshalJSON() ([]byte, error)

func (*WeakpassService) UnmarshalJSON

func (w *WeakpassService) UnmarshalJSON(b []byte) error

Jump to

Keyboard shortcuts

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