Skip to content
This repository was archived by the owner on Oct 22, 2024. It is now read-only.

Commit 4fd6d1a

Browse files
committed
fix(xray summary): add additional fields
1 parent 8fb0107 commit 4fd6d1a

File tree

4 files changed

+40
-5
lines changed

4 files changed

+40
-5
lines changed

xray/fixtures/summary/summary.json

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,16 @@
1313
"summary": "FileSystemBytecodeCache in Jinja2 2.7.2 does not properly create temporary directories",
1414
"description": "this is the description of the issue",
1515
"issue_type": "security",
16-
"severity": "Major",
16+
"severity": "High",
1717
"provider": "JFrog",
1818
"cves": [
1919
{
20-
"cve": "CVE-2016-6251"
20+
"cve": "CVE-2016-6251",
21+
"cwe": [
22+
"CWE-119"
23+
],
24+
"cvss_v2": "7.5/CVSS:2.0/AV:N/AC:L/Au:N/C:P/I:P/A:P",
25+
"cvss_v3": "9.8/CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"
2126
}
2227
],
2328
"created": "2016-10-26T11:15:51.17Z",

xray/summary.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,10 @@ type SummaryArtifact struct {
4747

4848
// SummaryCve resprents the cves within the summary from Xray
4949
type SummaryCve struct {
50-
Cve *string `json:"cve,omitempty"`
50+
Cve *string `json:"cve,omitempty"`
51+
Cwe *[]string `json:"cwe,omitempty"`
52+
Cvss2 *string `json:"cvss_v2,omitempty"`
53+
Cvss3 *string `json:"cvss_v3,omitempty"`
5154
}
5255

5356
// SummaryIssue represents a issue within the summary in Xray.

xray/summary_test.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,14 @@ func Test_Summary(t *testing.T) {
6262
Summary: String("FileSystemBytecodeCache in Jinja2 2.7.2 does not properly create temporary directories"),
6363
Description: String("this is the description of the issue"),
6464
IssueType: String("security"),
65-
Severity: String("Major"),
65+
Severity: String("High"),
6666
Provider: String("JFrog"),
6767
Cves: &[]SummaryCve{
6868
SummaryCve{
69-
Cve: String("CVE-2016-6251"),
69+
Cve: String("CVE-2016-6251"),
70+
Cwe: &[]string{"CWE-119"},
71+
Cvss2: String("7.5/CVSS:2.0/AV:N/AC:L/Au:N/C:P/I:P/A:P"),
72+
Cvss3: String("9.8/CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"),
7073
},
7174
},
7275
Created: String("2016-10-26T11:15:51.17Z"),

xray/xray-accessors.go

Lines changed: 24 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)