@@ -51,31 +51,23 @@ type typePair struct {
51
51
Type string
52
52
}
53
53
54
- func newPair (subType string , tpe string ) typePair {
55
- return typePair {
56
- SubType : subType ,
57
- Type : tpe ,
58
- }
59
- }
60
-
61
54
var AzureAssetTypeToTypePair = map [string ]typePair {
62
- inventory .ClassicStorageAccountAssetType : newPair (fetching .AzureClassicStorageAccountType , fetching .CloudStorage ),
63
- inventory .DiskAssetType : newPair (fetching .AzureDiskType , fetching .CloudCompute ),
64
- inventory .DocumentDBDatabaseAccountAssetType : newPair (fetching .AzureDocumentDBDatabaseAccountType , fetching .CloudDatabase ),
65
- inventory .MySQLDBAssetType : newPair (fetching .AzureMySQLDBType , fetching .CloudDatabase ),
66
- inventory .FlexibleMySQLDBAssetType : newPair (fetching .AzureFlexibleMySQLDBType , fetching .CloudDatabase ),
67
- inventory .NetworkWatchersFlowLogAssetType : newPair (fetching .AzureNetworkWatchersFlowLogType , fetching .MonitoringIdentity ),
68
- inventory .FlexiblePostgreSQLDBAssetType : newPair (fetching .AzureFlexiblePostgreSQLDBType , fetching .CloudDatabase ),
69
- inventory .PostgreSQLDBAssetType : newPair (fetching .AzurePostgreSQLDBType , fetching .CloudDatabase ),
70
- inventory .SQLServersAssetType : newPair (fetching .AzureSQLServerType , fetching .CloudDatabase ),
71
- inventory .StorageAccountAssetType : newPair (fetching .AzureStorageAccountType , fetching .CloudStorage ),
72
- inventory .VirtualMachineAssetType : newPair (fetching .AzureVMType , fetching .CloudCompute ),
73
- inventory .WebsitesAssetType : newPair (fetching .AzureWebSiteType , fetching .CloudCompute ),
74
- inventory .VaultAssetType : newPair (fetching .AzureVaultType , fetching .KeyManagement ),
75
- inventory .RoleDefinitionsType : newPair (fetching .AzureRoleDefinitionType , fetching .CloudIdentity ),
76
-
55
+ inventory .ClassicStorageAccountAssetType : {fetching .AzureClassicStorageAccountType , fetching .CloudStorage },
56
+ inventory .DiskAssetType : {fetching .AzureDiskType , fetching .CloudCompute },
57
+ inventory .DocumentDBDatabaseAccountAssetType : {fetching .AzureDocumentDBDatabaseAccountType , fetching .CloudDatabase },
58
+ inventory .MySQLDBAssetType : {fetching .AzureMySQLDBType , fetching .CloudDatabase },
59
+ inventory .FlexibleMySQLDBAssetType : {fetching .AzureFlexibleMySQLDBType , fetching .CloudDatabase },
60
+ inventory .NetworkWatchersFlowLogAssetType : {fetching .AzureNetworkWatchersFlowLogType , fetching .MonitoringIdentity },
61
+ inventory .FlexiblePostgreSQLDBAssetType : {fetching .AzureFlexiblePostgreSQLDBType , fetching .CloudDatabase },
62
+ inventory .PostgreSQLDBAssetType : {fetching .AzurePostgreSQLDBType , fetching .CloudDatabase },
63
+ inventory .SQLServersAssetType : {fetching .AzureSQLServerType , fetching .CloudDatabase },
64
+ inventory .StorageAccountAssetType : {fetching .AzureStorageAccountType , fetching .CloudStorage },
65
+ inventory .VirtualMachineAssetType : {fetching .AzureVMType , fetching .CloudCompute },
66
+ inventory .WebsitesAssetType : {fetching .AzureWebSiteType , fetching .CloudCompute },
67
+ inventory .VaultAssetType : {fetching .AzureVaultType , fetching .KeyManagement },
68
+ inventory .RoleDefinitionsType : {fetching .AzureRoleDefinitionType , fetching .CloudIdentity },
77
69
// This asset type is used only for enrichment purposes, but is sent to OPA layer, producing no findings.
78
- inventory .NetworkSecurityGroupAssetType : newPair ( fetching .AzureNetworkSecurityGroupType , fetching .MonitoringIdentity ) ,
70
+ inventory .NetworkSecurityGroupAssetType : { fetching .AzureNetworkSecurityGroupType , fetching .MonitoringIdentity } ,
79
71
}
80
72
81
73
// In order to simplify the mappings, we are trying to query all AzureAssetTypeToTypePair on every asset group
0 commit comments