diff --git a/artifactory/services/utils/tests/xray/consts.go b/artifactory/services/utils/tests/xray/consts.go index d3b6c403b..dcc1e2f34 100644 --- a/artifactory/services/utils/tests/xray/consts.go +++ b/artifactory/services/utils/tests/xray/consts.go @@ -1240,11 +1240,13 @@ const VulnerabilityReportDetailsResponse = ` ], "cvss2_max_score": 7.1, "cvss3_max_score": 7.5, + "cwe": ["CWE-400", "CWE-770"], "summary": "Netty Bzip2Decoder Class Missing Decompressed Data Allocation Limitation Memory Exhaustion Remote DoS", "severity": "High", "severity_source": "CVSS V3 from RBS", - "vulnerable_component": "gav://io.netty:netty-codec:4.1.66.Final", - "impacted_artifact": "docker://elasticsearch/7.15.0-test2:latest", + "jfrog_severity": "High", + "vulnerable_components": ["gav://io.netty:netty-codec:4.1.66.Final"], + "impacted_artifacts": ["docker://elasticsearch/7.15.0-test2:latest"], "impact_path": [ "docker://elasticsearch/7.15.0-test2:latest", "generic://sha256:a53372ba228046f81171efd357179b7b02a95acccee17925e3d0295829cb42ea/sha256__a53372ba228046f81171efd357179b7b02a95acccee17925e3d0295829cb42ea.tar.gz", @@ -1252,6 +1254,11 @@ const VulnerabilityReportDetailsResponse = ` "gav://io.netty:netty-codec:4.1.66.Final" ], "path": "forks-release-local/elasticsearch/7.15.0-test2/latest/", + "paths": ["forks-release-local/elasticsearch/7.15.0-test2/latest/"], + "physical_path": "/app/lib/netty-codec-4.1.66.Final.jar", + "project_keys": ["test-project"], + "applicability": true, + "applicability_result": "Applicable", "fixed_versions": [ "4.1.68.Final" ], @@ -1280,17 +1287,24 @@ const VulnerabilityReportDetailsResponse = ` ], "cvss2_max_score": 7.1, "cvss3_max_score": 7.5, + "cwe": ["CWE-400", "CWE-770"], "summary": "Netty Bzip2Decoder Class Missing Decompressed Data Allocation Limitation Memory Exhaustion Remote DoS", "severity": "High", "severity_source": "CVSS V3 from RBS", - "vulnerable_component": "gav://io.netty:netty-codec:4.1.66.Final", - "impacted_artifact": "docker://elasticsearch/7.15.0-test2:latest", + "jfrog_severity": "High", + "vulnerable_components": ["gav://io.netty:netty-codec:4.1.66.Final"], + "impacted_artifacts": ["docker://elasticsearch/7.15.0-test2:latest"], "impact_path": [ "docker://elasticsearch/7.15.0-test2:latest", "generic://sha256:a53372ba228046f81171efd357179b7b02a95acccee17925e3d0295829cb42ea/sha256__a53372ba228046f81171efd357179b7b02a95acccee17925e3d0295829cb42ea.tar.gz", "gav://io.netty:netty-codec:4.1.66.Final" ], "path": "forks-release-local/elasticsearch/7.15.0-test2/latest/", + "paths": ["forks-release-local/elasticsearch/7.15.0-test2/latest/"], + "physical_path": "/app/lib/netty-codec-4.1.66.Final.jar", + "project_keys": ["test-project"], + "applicability": false, + "applicability_result": "Not Applicable", "fixed_versions": [ "4.1.68.Final" ], diff --git a/tests/xrayreport_test.go b/tests/xrayreport_test.go index e3ebd79de..71b41320e 100644 --- a/tests/xrayreport_test.go +++ b/tests/xrayreport_test.go @@ -5,13 +5,14 @@ package tests import ( "bytes" "encoding/json" + "strconv" + "testing" + "github.com/jfrog/jfrog-client-go/artifactory/services/utils/tests/xray" "github.com/jfrog/jfrog-client-go/http/jfroghttpclient" "github.com/jfrog/jfrog-client-go/utils" "github.com/jfrog/jfrog-client-go/xray/services" "github.com/stretchr/testify/assert" - "strconv" - "testing" ) var testXrayReportService *services.ReportService diff --git a/xray/services/report.go b/xray/services/report.go index f910d8029..0eac8b0d3 100644 --- a/xray/services/report.go +++ b/xray/services/report.go @@ -60,11 +60,13 @@ type Row struct { Cves []ReportCve `json:"cves,omitempty"` Cvsv2MaxScore float64 `json:"cvss2_max_score,omitempty"` Cvsv3MaxScore float64 `json:"cvss3_max_score,omitempty"` + Cwe []string `json:"cwe,omitempty"` Summary string `json:"summary,omitempty"` Severity string `json:"severity,omitempty"` SeveritySource string `json:"severity_source,omitempty"` - VulnerableComponent string `json:"vulnerable_component,omitempty"` - ImpactedArtifact string `json:"impacted_artifact,omitempty"` + JFrogSeverity string `json:"jfrog_severity,omitempty"` + VulnerableComponents []string `json:"vulnerable_components,omitempty"` + ImpactedArtifacts []string `json:"impacted_artifacts,omitempty"` ImpactPath []string `json:"impact_path,omitempty"` FixedVersions []string `json:"fixed_versions,omitempty"` Published string `json:"published,omitempty"` @@ -74,6 +76,11 @@ type Row struct { Description string `json:"description,omitempty"` ExternalAdvisorySource string `json:"external_advisory_source,omitempty"` ExternalAdvisorySeverity string `json:"external_advisory_severity,omitempty"` + PhysicalPath string `json:"physical_path,omitempty"` + ProjectKeys []string `json:"project_keys,omitempty"` + Applicability *bool `json:"applicability,omitempty"` + ApplicabilityResult string `json:"applicability_result,omitempty"` + Paths []string `json:"paths,omitempty"` // Licenses Report field License string `json:"license,omitempty"` LicenseName string `json:"license_name,omitempty"`