package model

type WafDetectionMessage struct {
	WafDetectionMessageBasic
	AttackedLog []WafDetectionAttackedLog `json:"attacked_log"`
	CreatedAt   int64                     `json:"created_at"`
}

type WafDetectionMessageBasic struct {
	ClusterKey string `json:"cluster_key"`
	Namespace  string `json:"namespace"`
	ResKind    string `json:"res_kind"`
	ResName    string `json:"res_name"`
	ServiceID  int64  `json:"service_id"`
	AppName    string `json:"app_name"`
}

type WafDetectionAttackedLog struct {
	ID             string `json:"id"`
	RuleID         int64  `json:"rule_id"`
	RuleName       string `json:"rule_name"`
	Action         string `json:"action"`
	AttackIP       string `json:"attack_ip"`
	AttackLoad     string `json:"attack_load"`
	AttackTime     int64  `json:"attack_time"`
	AttackType     string `json:"attack_type"`
	AttackedApp    string `json:"attacked_app"`
	AttackedURL    string `json:"attacked_url"`
	ReqPkg         string `json:"req_pkg"`
	RspPkg         string `json:"rsp_pkg,omitempty"`
	RspContentType string `json:"rsp_content_type,omitempty"`
}

type WafDetection struct {
	WafDetectionMessageBasic
	WafDetectionAttackedLog
	CreatedAt int64 `json:"created_at"`
}
