Skip to content

Commit

Permalink
Add vulnmgmt to vSphere
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Zunker <[email protected]>
  • Loading branch information
czunker committed Dec 4, 2023
1 parent 8b2fecb commit a37a388
Show file tree
Hide file tree
Showing 6 changed files with 849 additions and 7 deletions.
1 change: 1 addition & 0 deletions providers/os/resources/os.lr
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ platform {
vulnerabilityReport() dict
}

// Vulnerability Information
extend vulnmgmt {
// List of all CVEs affecting the asset
cves() []vuln.cve
Expand Down
6 changes: 0 additions & 6 deletions providers/os/resources/vulnmgmt.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,12 +184,6 @@ func (v *mqlVulnmgmt) getReport() (*gql.VulnReport, error) {
}

func (v *mqlVulnmgmt) getIncognitoReport(mondooClient *gql.MondooClient) (*gql.VulnReport, error) {
// FIXCME: when we don't have a MRN, we need to:
// - creeate asset
// - create packages
// - get "incognito" vulnReport
// - procede as usual

conn := v.MqlRuntime.Connection.(shared.Connection)
platform := conn.Asset().Platform

Expand Down
69 changes: 68 additions & 1 deletion providers/vsphere/resources/vsphere.lr
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ extend asset {
// Common Platform Enumeration (CPE) for the asset
cpes() []core.cpe
// Advisory & vulnerability report
// Will be deprecated; Full advisory & vulnerability report
// Will be deprecated in version 10.0; Full advisory & vulnerability report
// use vulnmgmt instead
vulnerabilityReport() dict
}

Expand All @@ -19,6 +20,72 @@ platform {
vulnerabilityReport() dict
}

// Vulnerability Information
extend vulnmgmt {
// List of all CVEs affecting the asset
cves() []vuln.cve
// List of all Advisories affecting the asset
advisories() []vuln.advisory
// List of all packages affected by vulnerabilities
packages() []vuln.package
// Last time the vulnerability information was updated
lastAssessment() time
}

// CVE information
private vuln.cve @defaults("id") {
// CVE ID
id string
// CVE state
state string
// Summary description
summary string
// Whether the CVE has a CVSS score
unscored bool
// Publication date
published time
// Last modification date
modified time
// Worst CVSS score of all assigned CVEs
worstScore audit.cvss
}

// Advisory information
private vuln.advisory @defaults("id") {
// Advisory ID
id string
// Title of the advisory
title string
// Description of the advisory
description string
// Advisory publication date
published time
// Last modification date
modified time
// Worst CVSS score of all assigned CVEs
worstScore audit.cvss
}

// Package information relevant for vulnerability management
private vuln.package @defaults("name version") {
// Package name
name string
// Package version
version string
// Available package version
available string
// Architecture of this package
arch string
}

// Common Vulnerability Scoring System (CVSS) score
private audit.cvss {
// CVSS score ranging from 0.0 to 10.0
score float
// CVSS score represented as a vector string
vector string
}

// VMware vSphere resource
vsphere {
// System information including the name, type, version, and build number
Expand Down
Loading

0 comments on commit a37a388

Please sign in to comment.