Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
projectdiscovery
GitHub Repository: projectdiscovery/nuclei
Path: blob/dev/cmd/tmc/types.go
2070 views
1
package main
2
3
type Mark struct {
4
Name string `json:"name,omitempty"`
5
Position int `json:"position,omitempty"`
6
Line int `json:"line,omitempty"`
7
Column int `json:"column,omitempty"`
8
Snippet string `json:"snippet,omitempty"`
9
}
10
11
type Error struct {
12
Name string `json:"name"`
13
Mark Mark `json:"mark"`
14
}
15
16
type LintError struct {
17
Name string `json:"name,omitempty"`
18
Reason string `json:"reason,omitempty"`
19
Mark Mark `json:"mark,omitempty"`
20
}
21
22
type TemplateLintResp struct {
23
Input string `json:"template_input,omitempty"`
24
Lint bool `json:"template_lint,omitempty"`
25
LintError LintError `json:"lint_error,omitempty"`
26
}
27
28
type ValidateError struct {
29
Location string `json:"location,omitempty"`
30
Message string `json:"message,omitempty"`
31
Name string `json:"name,omitempty"`
32
Argument interface{} `json:"argument,omitempty"`
33
Stack string `json:"stack,omitempty"`
34
Mark struct {
35
Line int `json:"line,omitempty"`
36
Column int `json:"column,omitempty"`
37
Pos int `json:"pos,omitempty"`
38
} `json:"mark,omitempty"`
39
}
40
41
// TemplateResponse from templateman to be used for enhancing and formatting
42
type TemplateResp struct {
43
Input string `json:"template_input,omitempty"`
44
Format bool `json:"template_format,omitempty"`
45
Updated string `json:"updated_template,omitempty"`
46
Enhance bool `json:"template_enhance,omitempty"`
47
Enhanced string `json:"enhanced_template,omitempty"`
48
Lint bool `json:"template_lint,omitempty"`
49
LintError LintError `json:"lint_error,omitempty"`
50
Validate bool `json:"template_validate,omitempty"`
51
ValidateErrorCount int `json:"validate_error_count,omitempty"`
52
ValidateError []ValidateError `json:"validate_error,omitempty"`
53
Error Error `json:"error,omitempty"`
54
}
55
56
// InfoBlock Cloning struct from nuclei as we don't want any validation
57
type InfoBlock struct {
58
Info TemplateInfo `yaml:"info"`
59
}
60
61
type TemplateClassification struct {
62
CvssMetrics string `yaml:"cvss-metrics,omitempty"`
63
CvssScore float64 `yaml:"cvss-score,omitempty"`
64
CveId string `yaml:"cve-id,omitempty"`
65
CweId string `yaml:"cwe-id,omitempty"`
66
Cpe string `yaml:"cpe,omitempty"`
67
EpssScore float64 `yaml:"epss-score,omitempty"`
68
}
69
70
type TemplateInfo struct {
71
Name string `yaml:"name"`
72
Author string `yaml:"author"`
73
Severity string `yaml:"severity,omitempty"`
74
Description string `yaml:"description,omitempty"`
75
Reference interface{} `yaml:"reference,omitempty"`
76
Remediation string `yaml:"remediation,omitempty"`
77
Classification TemplateClassification `yaml:"classification,omitempty"`
78
Metadata map[string]interface{} `yaml:"metadata,omitempty"`
79
Tags string `yaml:"tags,omitempty"`
80
}
81
82