From d7cff22f5da3cd1e15925c828478397dab9bf5a2 Mon Sep 17 00:00:00 2001 From: vjeffrey Date: Wed, 21 Feb 2024 08:12:27 -0700 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=B9=20ensure=20we=20grab=20the=20tags?= =?UTF-8?q?=20for=20the=20ssm=20instance=20during=20discovery=20(#3376)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit since tags is noted as an optional field, tags(), on ssm instances, we have to call get to actually fetch them --- providers/aws/resources/discovery_conversion.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/providers/aws/resources/discovery_conversion.go b/providers/aws/resources/discovery_conversion.go index 95f0f1cf93..0fbbf65db5 100644 --- a/providers/aws/resources/discovery_conversion.go +++ b/providers/aws/resources/discovery_conversion.go @@ -338,7 +338,7 @@ func getInstanceName(id string, labels map[string]string) string { func addConnectionInfoToSSMAsset(instance *mqlAwsSsmInstance, accountId string, conn *connection.AwsConnection) *inventory.Asset { asset := &inventory.Asset{} - asset.Labels = mapStringInterfaceToStringString(instance.Tags.Data) + asset.Labels = mapStringInterfaceToStringString(instance.GetTags().Data) asset.Labels["mondoo.com/platform"] = instance.PlatformName.Data asset.Labels["mondoo.com/region"] = instance.Region.Data @@ -378,7 +378,7 @@ func addConnectionInfoToSSMAsset(instance *mqlAwsSsmInstance, accountId string, log.Warn().Str("asset", asset.Name).Str("id", instance.InstanceId.Data).Msg("cannot use ssm session credentials for connection") asset = MqlObjectToAsset(accountId, mqlObject{ - name: asset.Name, labels: mapStringInterfaceToStringString(instance.Tags.Data), + name: asset.Name, labels: asset.Labels, awsObject: awsObject{ account: accountId, region: instance.Region.Data, arn: instance.Arn.Data, id: instance.InstanceId.Data, service: "ssm", objectType: "instance",