From 70f95b451619a4267a228566c93ee5c0731a7ac0 Mon Sep 17 00:00:00 2001 From: kooomix Date: Mon, 6 Jan 2025 16:41:12 +0200 Subject: [PATCH] rename cloud account GUID attribute and update validation error messages --- identifiers/designators.go | 2 +- notifications/integrationref.go | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/identifiers/designators.go b/identifiers/designators.go index 91ac158..c6b81cf 100644 --- a/identifiers/designators.go +++ b/identifiers/designators.go @@ -161,7 +161,7 @@ const ( // CSPM related attributes const ( - AttributeCloudAccountGUID = "accountGUID" + AttributeCloudAccountGUID = "cloudAccountGUID" AttributeCloudAccountID = "accountID" AttributeCloudAccountName = "accountName" AttributeFramework = "framework" diff --git a/notifications/integrationref.go b/notifications/integrationref.go index a75f126..4182505 100644 --- a/notifications/integrationref.go +++ b/notifications/integrationref.go @@ -205,8 +205,8 @@ func (e *EntityIdentifiers) Validate() error { return fmt.Errorf("security risk id, category and name are required for %s", e.Type) } case EntityTypeCloudResource: - if e.Name == "" || e.ResourceHash == "" || e.ResourceID == "" || e.CloudAccountGUID == "" { - return fmt.Errorf("name, resource hash, resource id and cloud account guid are required for %s", e.Type) + if e.ResourceHash == "" || e.ResourceID == "" || e.CloudAccountGUID == "" { + return fmt.Errorf("resource hash, resource id and cloud account guid are required for %s", e.Type) } case EntityTypeCloudRule: if e.RuleHash == "" || e.CloudControlHash == "" || e.Severity == "" { @@ -290,11 +290,11 @@ func (e *EntityIdentifiers) ToMap() map[string]string { } if e.RuleHash != "" { - entityMap["ruleHash"] = e.RuleHash + entityMap[identifiers.AttributeCloudRuleHash] = e.RuleHash } if e.CloudAccountGUID != "" { - entityMap["cloudAccountGUID"] = e.CloudAccountGUID + entityMap[identifiers.AttributeCloudAccountGUID] = e.CloudAccountGUID } return entityMap