/ common / runner / types.go
types.go
 1  // Copyright (c) 2024-2026 Tencent Zhuque Lab. All rights reserved.
 2  //
 3  // Licensed under the Apache License, Version 2.0 (the "License");
 4  // you may not use this file except in compliance with the License.
 5  // You may obtain a copy of the License at
 6  //
 7  //     http://www.apache.org/licenses/LICENSE-2.0
 8  //
 9  // Unless required by applicable law or agreed to in writing, software
10  // distributed under the License is distributed on an "AS IS" BASIS,
11  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  // See the License for the specific language governing permissions and
13  // limitations under the License.
14  //
15  // Requirement: Any integration or derivative work must explicitly attribute
16  // Tencent Zhuque Lab (https://github.com/Tencent/AI-Infra-Guard) in its
17  // documentation or user interface, as detailed in the NOTICE file.
18  
19  package runner
20  
21  import "github.com/Tencent/AI-Infra-Guard/pkg/vulstruct"
22  
23  // CallbackScanResult 扫描结果结构
24  type CallbackScanResult struct {
25  	TargetURL       string           `json:"target_url"`
26  	StatusCode      int              `json:"status_code"`
27  	Title           string           `json:"title"`
28  	Fingerprint     string           `json:"fingerprint"`
29  	Vulnerabilities []vulstruct.Info `json:"vulnerabilities,omitempty"`
30  	Resp            string           `json:"-"`
31  	ScreenShot      string           `json:"screenshot,omitempty"`
32  	Reason          string           `json:"reason,omitempty"`
33  	Summary         string           `json:"summary,omitempty"` // 漏洞总览
34  }
35  
36  // CallbackProcessInfo 进度信息结构
37  type CallbackProcessInfo struct {
38  	Current int `json:"current"`
39  	Total   int `json:"total"`
40  }
41  
42  // CallbackReportInfo 报告信息结构
43  type CallbackReportInfo struct {
44  	SecScore   int `json:"sec_score"`
45  	HighRisk   int `json:"high_risk"`
46  	MediumRisk int `json:"medium_risk"`
47  	LowRisk    int `json:"low_risk"`
48  }
49  
50  type CallbackErrorInfo struct {
51  	Target string
52  	Error  error
53  }
54  
55  type FpInfos struct {
56  	FpName string                 `json:"name"`
57  	Vuls   []vulstruct.VersionVul `json:"vuls"`
58  	Desc   string                 `json:"desc"`
59  }