kube

package
v0.0.0-...-e9de818 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2024 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateCert

func CreateCert(commonName string, duration time.Duration) (key, cert []byte, err error)

func InitCaCert

func InitCaCert()

func InitClusterStatus

func InitClusterStatus()

func InitKubeSec

func InitKubeSec()

func KubeUpdateClusterThreatStat

func KubeUpdateClusterThreatStat(ctx context.Context, cluster_id *string)

func KubeUpdateThreatStatProc

func KubeUpdateThreatStatProc()

func LoadCaCert

func LoadCaCert() []byte

Types

type ClusterRsp

type ClusterRsp struct {
	Code int      `json:"code"`
	Msg  string   `json:"msg"`
	Data []string `json:"data"`
}

type KubeAlarmRawData

type KubeAlarmRawData struct {
	RawData map[string]interface{} `json:"raw_data"`
}

************************************* RAW *************************************

type KubeClusterInfoSimpleItem

type KubeClusterInfoSimpleItem struct {
	ClusterId   string `json:"cluster_id,omitempty" bson:"cluster_id,omitempty"`
	ClusterName string `json:"cluster_name,omitempty" bson:"cluster,omitempty"`
	ClusterArea string `json:"cluster_area,omitempty" bson:"cluster_area,omitempty"`
}

type KubeThreatPreviewDataItem

type KubeThreatPreviewDataItem struct {
	Name       string  `json:"name,omitempty" bson:"name,omitempty"`
	Percentage float64 `json:"percentage,omitempty" bson:"percentage,omitempty"`
	Quantity   int32   `json:"quantity,omitempty" bson:"quantity,omitempty"`
}

func KubeAggresRuleNameInfos

func KubeAggresRuleNameInfos(ctx context.Context, name string, query bson.D) (int, []KubeThreatPreviewDataItem)

type KubeThreatSourceDataItem

type KubeThreatSourceDataItem struct {
	SourceIP string `json:"source_ip,omitempty" bson:"source_ip,omitempty"`
}

func KubeQuerySourceInfos

func KubeQuerySourceInfos(ctx context.Context, name string, query bson.D) []KubeThreatSourceDataItem

type KubeThreatSourceIpStatistics

type KubeThreatSourceIpStatistics struct {
	PublicNum  int `json:"public_ip_num,omitempty"`
	PrivateNum int `json:"private_ip_num,omitempty"`
	OtherNum   int `json:"other_ip_num,omitempty"`
}

type KubeThreatStatistics

type KubeThreatStatistics struct {
	ClusterId    string                      `json:"cluster_id,omitempty" bson:"cluster_id,omitempty"`
	SourceDist   []KubeThreatPreviewDataItem `json:"source_distribution,omitempty" bson:"source_distribution,omitempty"`
	ThreatDist   []KubeThreatPreviewDataItem `json:"threat_distribution,omitempty" bson:"threat_distribution,omitempty"`
	AbnormalDist []KubeThreatPreviewDataItem `json:"abnormal_distribution,omitempty" bson:"abnormal_distribution,omitempty"`
	ResourceDist []KubeThreatPreviewDataItem `json:"threatres_distribution,omitempty" bson:"threatres_distribution,omitempty"`
	ExploitDist  []KubeThreatPreviewDataItem `json:"vul_exploit_distribution" bson:"vul_exploit_distribution"`
	UpdateTime   string                      `json:"update_time,omitempty" bson:"update_time,omitempty"`
}

Jump to

Keyboard shortcuts

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