Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 Add id to CVSS score #5163

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 2 additions & 0 deletions providers/os/resources/os.lr
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,8 @@ platform.cves {

// Common Vulnerability Scoring System (CVSS) score
private audit.cvss @defaults("score") {
// ID to identify the CVSS score
id string
// CVSS score ranging from 0.0 to 10.0
score float
// CVSS score represented as a vector string
Expand Down
19 changes: 18 additions & 1 deletion providers/os/resources/os.lr.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions providers/os/resources/os.lr.manifest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ resources:
min_mondoo_version: 5.15.0
audit.cvss:
fields:
id:
min_mondoo_version: 9.0.0
score: {}
vector: {}
is_private: true
Expand Down
6 changes: 6 additions & 0 deletions providers/os/resources/vulnmgmt.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ package resources

import (
"errors"
"fmt"
"time"

"github.com/rs/zerolog/log"
Expand Down Expand Up @@ -309,3 +310,8 @@ func (p *mqlVulnPackage) id() (string, error) {
id := p.Name.Data + "-" + p.Version.Data
return id, p.Name.Error
}

func (a *mqlAuditCvss) id() (string, error) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, thanks. I wasn't aware this is possible. I changed the code.

id := fmt.Sprintf("%.1f-%s", a.Score.Data, a.Vector.Data)
return id, a.Score.Error
}
Loading