From 41292c274098da796ac0727311adc149ea13380d Mon Sep 17 00:00:00 2001 From: Christian Zunker Date: Mon, 4 Dec 2023 12:03:39 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Extend=20vulnmgmt=20for=20cnspec?= =?UTF-8?q?=20vuln=20command?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Christian Zunker --- providers-sdk/v1/upstream/gql/vulnmgmt_gql.go | 2 ++ providers/vsphere/resources/vulnmgmt.go | 1 + 2 files changed, 3 insertions(+) diff --git a/providers-sdk/v1/upstream/gql/vulnmgmt_gql.go b/providers-sdk/v1/upstream/gql/vulnmgmt_gql.go index a60798a8b6..365241d23d 100644 --- a/providers-sdk/v1/upstream/gql/vulnmgmt_gql.go +++ b/providers-sdk/v1/upstream/gql/vulnmgmt_gql.go @@ -219,6 +219,7 @@ func (c *MondooClient) GetIncognitoVulnReport(platform mondoogql.PlatformInput, Packages []struct { Package } + Stats ReportStats } `graphql:"... on AssetIncognitoVulnerabilityReport"` } `graphql:"analyseIncognitoAssetVulnerabilities(input: $input)"` } @@ -236,6 +237,7 @@ func (c *MondooClient) GetIncognitoVulnReport(platform mondoogql.PlatformInput, Advisories: make([]*Advisory, len(m.AssetVulnerabilityReportResponse.AssetIncognitoVulnerabilityReport.Advisories)), Cves: make([]*Cve, len(m.AssetVulnerabilityReportResponse.AssetIncognitoVulnerabilityReport.Cves)), Packages: make([]*Package, len(m.AssetVulnerabilityReportResponse.AssetIncognitoVulnerabilityReport.Packages)), + Stats: &m.AssetVulnerabilityReportResponse.AssetIncognitoVulnerabilityReport.Stats, } for i := range m.AssetVulnerabilityReportResponse.AssetIncognitoVulnerabilityReport.Advisories { diff --git a/providers/vsphere/resources/vulnmgmt.go b/providers/vsphere/resources/vulnmgmt.go index b0b777ab39..399b1f0952 100644 --- a/providers/vsphere/resources/vulnmgmt.go +++ b/providers/vsphere/resources/vulnmgmt.go @@ -169,6 +169,7 @@ func (v *mqlVulnmgmt) getReport() (*gql.VulnReport, error) { } func (v *mqlVulnmgmt) getIncognitoReport(mondooClient *gql.MondooClient) (*gql.VulnReport, error) { + // FIXME: wrong connection conn := v.MqlRuntime.Connection.(shared.Connection) platform := conn.Asset().Platform