Skip to content

Commit

Permalink
Add CWE and CWE Details in Vulnerabilities model (jfrog#935)
Browse files Browse the repository at this point in the history
  • Loading branch information
angshumukherjee100 authored Apr 9, 2024
1 parent 62ee027 commit 4e96d77
Showing 1 changed file with 21 additions and 7 deletions.
28 changes: 21 additions & 7 deletions xray/services/scan.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@ package services

import (
"encoding/json"
"github.com/jfrog/jfrog-client-go/utils/log"
xrayUtils "github.com/jfrog/jfrog-client-go/xray/services/utils"
"net/http"
"strings"
"time"

"github.com/jfrog/jfrog-client-go/utils/log"
xrayUtils "github.com/jfrog/jfrog-client-go/xray/services/utils"

"github.com/jfrog/jfrog-client-go/artifactory/services/utils"
"github.com/jfrog/jfrog-client-go/auth"
"github.com/jfrog/jfrog-client-go/http/jfroghttpclient"
Expand Down Expand Up @@ -349,11 +350,24 @@ type ImpactPathNode struct {
}

type Cve struct {
Id string `json:"cve,omitempty"`
CvssV2Score string `json:"cvss_v2_score,omitempty"`
CvssV2Vector string `json:"cvss_v2_vector,omitempty"`
CvssV3Score string `json:"cvss_v3_score,omitempty"`
CvssV3Vector string `json:"cvss_v3_vector,omitempty"`
Id string `json:"cve,omitempty"`
CvssV2Score string `json:"cvss_v2_score,omitempty"`
CvssV2Vector string `json:"cvss_v2_vector,omitempty"`
CvssV3Score string `json:"cvss_v3_score,omitempty"`
CvssV3Vector string `json:"cvss_v3_vector,omitempty"`
Cwe []string `json:"cwe,omitempty"`
CweDetails map[string]Cwe `json:"cwe_details,omitempty"`
}

type Cwe struct {
Name string `json:"name,omitempty"`
Description string `json:"description,omitempty"`
Categories []CweCategory `json:"categories,omitempty"`
}

type CweCategory struct {
Category string `json:"category,omitempty"`
Rank string `json:"rank,omitempty"`
}

type ExtendedInformation struct {
Expand Down

0 comments on commit 4e96d77

Please sign in to comment.