Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 18 additions & 4 deletions artifactory/services/utils/tests/xray/consts.go
Original file line number Diff line number Diff line change
Expand Up @@ -1240,18 +1240,25 @@ 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",
"generic://sha256:e1a7a6f8262f89cad679f309ec7875c9a995099ee0fee1a1380ee71692657a4c/elasticsearch-sql-cli-7.15.0.jar",
"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"
],
Expand Down Expand Up @@ -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"
],
Expand Down
5 changes: 3 additions & 2 deletions tests/xrayreport_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 9 additions & 2 deletions xray/services/report.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand All @@ -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"`
Expand Down
Loading