From 6f94b367d0b450fb9664d37d15d031b6936348e9 Mon Sep 17 00:00:00 2001 From: Christian Zunker Date: Thu, 15 Feb 2024 14:39:50 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fix=20cpes=20resource=20definiti?= =?UTF-8?q?on=20in=20vSphere?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Without the import, the resources.json file was created with as the resource for . This failed on lookup when compiling a query. Adding the import creates the resources.json file as the resource for . Then the lookup works again. Signed-off-by: Christian Zunker --- providers/vsphere/resources/vsphere.lr | 2 ++ providers/vsphere/resources/vsphere.lr.go | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/providers/vsphere/resources/vsphere.lr b/providers/vsphere/resources/vsphere.lr index 3fbfa2e231..79a7cf7f6b 100644 --- a/providers/vsphere/resources/vsphere.lr +++ b/providers/vsphere/resources/vsphere.lr @@ -1,6 +1,8 @@ // Copyright (c) Mondoo, Inc. // SPDX-License-Identifier: BUSL-1.1 +import "../../core/resources/core.lr" + option provider = "go.mondoo.com/cnquery/v9/providers/vsphere" option go_package = "go.mondoo.com/cnquery/v10/providers/vsphere/resources" diff --git a/providers/vsphere/resources/vsphere.lr.go b/providers/vsphere/resources/vsphere.lr.go index 839c4e91b6..1dbc5474d1 100644 --- a/providers/vsphere/resources/vsphere.lr.go +++ b/providers/vsphere/resources/vsphere.lr.go @@ -183,7 +183,7 @@ func CreateResource(runtime *plugin.Runtime, name string, args map[string]*llx.R var getDataFields = map[string]func(r plugin.Resource) *plugin.DataRes{ "asset.cpes": func(r plugin.Resource) *plugin.DataRes { - return (r.(*mqlAsset).GetCpes()).ToDataRes(types.Array(types.Resource("core.cpe"))) + return (r.(*mqlAsset).GetCpes()).ToDataRes(types.Array(types.Resource("cpe"))) }, "asset.vulnerabilityReport": func(r plugin.Resource) *plugin.DataRes { return (r.(*mqlAsset).GetVulnerabilityReport()).ToDataRes(types.Dict)