Skip to content

Conversation

@kubasobon
Copy link
Member

Summary of your changes

Fixes missing cloud.service.name values for Azure assets (were all assigned Azure).

Related Issues

Fixes https://github.com/elastic/security-team/issues/13159

@kubasobon kubasobon requested a review from a team as a code owner July 24, 2025 09:13
@mergify
Copy link

mergify bot commented Jul 24, 2025

This pull request does not have a backport label. Could you fix it @kubasobon? 🙏
To fixup this pull request, you need to add the backport labels for the needed
branches, such as:

  • backport-v./d./d./d is the label to automatically backport to the 8./d branch. /d is the digit
  • backport-active-all is the label that automatically backports to all active branches.
  • backport-active-8 is the label that automatically backports to all active minor branches for the 8 major.
  • backport-active-9 is the label that automatically backports to all active minor branches for the 9 major.

Copy link
Member

@romulets romulets left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmmm, maybe it's good to double check with @caitlinbetz about the names. I see that AWS mostly matches existing service names

{"Snapshots", azurelib.AssetGroupResources, azurelib.SnapshotAssetType, inventory.AssetClassificationAzureSnapshot},
{"Storage Accounts", azurelib.AssetGroupResources, azurelib.StorageAccountAssetType, inventory.AssetClassificationAzureStorageAccount},
{"Virtual Machines", azurelib.AssetGroupResources, azurelib.VirtualMachineAssetType, inventory.AssetClassificationAzureVirtualMachine},
{"App Services", "Azure Compute", azurelib.AssetGroupResources, azurelib.WebsitesAssetType, inventory.AssetClassificationAzureAppService},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't the name Azure App Services? 🤔

Image

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was looking at All Services view, but with Azure it usually can be both.
image

{"App Services", "Azure Compute", azurelib.AssetGroupResources, azurelib.WebsitesAssetType, inventory.AssetClassificationAzureAppService},
{"Container Registries", "Azure Containers", azurelib.AssetGroupResources, azurelib.ContainerRegistryAssetType, inventory.AssetClassificationAzureContainerRegistry},
{"Cosmos DB Accounts", "Azure Databases", azurelib.AssetGroupResources, azurelib.DocumentDBDatabaseAccountAssetType, inventory.AssetClassificationAzureCosmosDBAccount},
{"Cosmos DB SQL Databases", "Azure Databases", azurelib.AssetGroupResources, azurelib.CosmosDBForSQLDatabaseAssetType, inventory.AssetClassificationAzureCosmosDBSQLDatabase},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is Databases the official name? I think it needs to match a service in Azure, doesn't it?

Image

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto
image

{"Storage Accounts", azurelib.AssetGroupResources, azurelib.StorageAccountAssetType, inventory.AssetClassificationAzureStorageAccount},
{"Virtual Machines", azurelib.AssetGroupResources, azurelib.VirtualMachineAssetType, inventory.AssetClassificationAzureVirtualMachine},
{"App Services", "Azure Compute", azurelib.AssetGroupResources, azurelib.WebsitesAssetType, inventory.AssetClassificationAzureAppService},
{"Container Registries", "Azure Containers", azurelib.AssetGroupResources, azurelib.ContainerRegistryAssetType, inventory.AssetClassificationAzureContainerRegistry},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the name Container registries?

Image

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And this one again:
image

@kubasobon kubasobon requested a review from romulets July 28, 2025 09:30
@kubasobon
Copy link
Member Author

@kubasobon
Copy link
Member Author

@caitlinbetz I'd love your input from product perspective on this naming convention.
@uri-weisman I'd love your input on what the final shape of service names for Azure should be. Should it just reflect Azure + Asset Type?

@mergify
Copy link

mergify bot commented Jul 29, 2025

This pull request is now in conflicts. Could you fix it? 🙏
To fixup this pull request, you can check out it locally. See documentation: https://help.github.com/articles/checking-out-pull-requests-locally/

git fetch upstream
git checkout -b azure-svc-name upstream/azure-svc-name
git merge upstream/main
git push upstream azure-svc-name

@caitlinbetz
Copy link

@kubasobon I am good with the naming changes you have outlined

@kubasobon
Copy link
Member Author

@romulets updated service names according to your remarks, PTAL :)

{"Cosmos DB SQL Databases", "Azure Cosmos DB", azurelib.AssetGroupResources, azurelib.CosmosDBForSQLDatabaseAssetType, inventory.AssetClassificationAzureCosmosDBSQLDatabase},
{"Disks", "Azure Storage", azurelib.AssetGroupResources, azurelib.DiskAssetType, inventory.AssetClassificationAzureDisk},
{"Elastic Pools", "Azure SQL Elastic Pools", azurelib.AssetGroupResources, azurelib.ElasticPoolAssetType, inventory.AssetClassificationAzureElasticPool},
{"MySQL Flexible Servers", "Azure SQL Servers", azurelib.AssetGroupResources, azurelib.FlexibleMySQLDBAssetType, inventory.AssetClassificationAzureSQLServer},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is FlexibleMySQLDBAssetType a SQL Server? As far as I know is just another offering of MySQL and I would classify as Azure SQL Databases, not as SQL Server. I could be wrong of course 🤓

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think SQL Servers are azurelib.SQLServersAssetType ones. We are not fetching them it seems?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

Our docs specify we need to fetch two kinds of resources:

Category Old Type Current Type
Database Azure SQL Database Azure SQL Database
Database Azure SQL Server Azure SQL Server

But the Azure offering contains:

  • Azure Database for PostgreSQL flexible servers
  • SQL virtual machines
  • Azure Arc (and within it)
    • SQL Server instances
    • SQL managed instances
    • PostgreSQL servers
    • MySQL servers
  • SQL Server stretch databases
  • Azure SQL Database Hyperscale
  • Azure Database for MySQL flexible servers
  • SQL Managed instances (different to those in Azure Arc)

...and more, but I've omitted ones that did not fit SQL Database or SQL Server description. Some of those are PaaS, some IaaS, some managed by Azure, some by the user. I don't have enough information to make an educated guess as to which ones we should be querying. @romulets How do you feel about merging this and bringing the database question to product?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm fine with your decision @kubasobon

My point was

We are saying:

  • azurelib.FlexibleMySQLDBAssetType -> Azure SQL Servers
  • azurelib.MySQLDatabaseAssetType -> Azure SQL Databases

I thought we had to keep those consistent. But I also don't fully understand the Azure distribution. So I trust your call!

@kubasobon kubasobon enabled auto-merge (squash) August 25, 2025 11:20
@kubasobon kubasobon merged commit 7e3234f into main Aug 25, 2025
9 checks passed
@kubasobon kubasobon deleted the azure-svc-name branch August 25, 2025 11:38
@github-actions
Copy link

@Mergifyio backport 8.17 8.18 8.19 9.0 9.1

@mergify
Copy link

mergify bot commented Aug 25, 2025

backport 8.17 8.18 8.19 9.0 9.1

✅ Backports have been created

mergify bot pushed a commit that referenced this pull request Aug 25, 2025
…#3466)

* update test cases

* update Azure service names

* apply review remarks

* rename FlexibleMySQLDBAssetType

* rename MySQLDBAssetType

* gofmt

(cherry picked from commit 7e3234f)

# Conflicts:
#	internal/inventory/azurefetcher/fetcher_resource_graph.go
#	internal/inventory/azurefetcher/fetcher_resource_graph_test.go
#	internal/inventory/azurefetcher/fetcher_storage.go
mergify bot pushed a commit that referenced this pull request Aug 25, 2025
…#3466)

* update test cases

* update Azure service names

* apply review remarks

* rename FlexibleMySQLDBAssetType

* rename MySQLDBAssetType

* gofmt

(cherry picked from commit 7e3234f)

# Conflicts:
#	internal/inventory/azurefetcher/fetcher_account.go
#	internal/inventory/azurefetcher/fetcher_account_test.go
#	internal/inventory/azurefetcher/fetcher_activedirectory.go
#	internal/inventory/azurefetcher/fetcher_activedirectory_test.go
#	internal/inventory/azurefetcher/fetcher_resource_graph.go
#	internal/inventory/azurefetcher/fetcher_resource_graph_test.go
#	internal/inventory/azurefetcher/fetcher_storage.go
#	internal/inventory/azurefetcher/fetcher_storage_test.go
#	internal/resources/fetching/fetchers/azure/assets_fetcher.go
mergify bot pushed a commit that referenced this pull request Aug 25, 2025
…#3466)

* update test cases

* update Azure service names

* apply review remarks

* rename FlexibleMySQLDBAssetType

* rename MySQLDBAssetType

* gofmt

(cherry picked from commit 7e3234f)

# Conflicts:
#	internal/inventory/azurefetcher/fetcher_activedirectory.go
#	internal/inventory/azurefetcher/fetcher_activedirectory_test.go
#	internal/inventory/azurefetcher/fetcher_resource_graph.go
#	internal/inventory/azurefetcher/fetcher_resource_graph_test.go
#	internal/inventory/azurefetcher/fetcher_storage.go
#	internal/inventory/azurefetcher/fetcher_storage_test.go
#	internal/resources/fetching/fetchers/azure/assets_fetcher.go
mergify bot pushed a commit that referenced this pull request Aug 25, 2025
…#3466)

* update test cases

* update Azure service names

* apply review remarks

* rename FlexibleMySQLDBAssetType

* rename MySQLDBAssetType

* gofmt

(cherry picked from commit 7e3234f)

# Conflicts:
#	internal/inventory/azurefetcher/fetcher_resource_graph.go
#	internal/inventory/azurefetcher/fetcher_resource_graph_test.go
#	internal/inventory/azurefetcher/fetcher_storage.go
mergify bot pushed a commit that referenced this pull request Aug 25, 2025
…#3466)

* update test cases

* update Azure service names

* apply review remarks

* rename FlexibleMySQLDBAssetType

* rename MySQLDBAssetType

* gofmt

(cherry picked from commit 7e3234f)

# Conflicts:
#	internal/inventory/azurefetcher/fetcher_resource_graph.go
#	internal/inventory/azurefetcher/fetcher_resource_graph_test.go
#	internal/inventory/azurefetcher/fetcher_storage.go
kubasobon added a commit that referenced this pull request Sep 1, 2025
…#3466)

* update test cases

* update Azure service names

* apply review remarks

* rename FlexibleMySQLDBAssetType

* rename MySQLDBAssetType

* gofmt

(cherry picked from commit 7e3234f)

# Conflicts:
#	internal/inventory/azurefetcher/fetcher_resource_graph.go
#	internal/inventory/azurefetcher/fetcher_resource_graph_test.go
#	internal/inventory/azurefetcher/fetcher_storage.go
kubasobon added a commit that referenced this pull request Sep 1, 2025
…#3466)

* update test cases

* update Azure service names

* apply review remarks

* rename FlexibleMySQLDBAssetType

* rename MySQLDBAssetType

* gofmt

(cherry picked from commit 7e3234f)

# Conflicts:
#	internal/inventory/azurefetcher/fetcher_resource_graph.go
#	internal/inventory/azurefetcher/fetcher_resource_graph_test.go
#	internal/inventory/azurefetcher/fetcher_storage.go
kubasobon added a commit that referenced this pull request Sep 1, 2025
…#3466)

* update test cases

* update Azure service names

* apply review remarks

* rename FlexibleMySQLDBAssetType

* rename MySQLDBAssetType

* gofmt

(cherry picked from commit 7e3234f)

# Conflicts:
#	internal/inventory/azurefetcher/fetcher_resource_graph.go
#	internal/inventory/azurefetcher/fetcher_resource_graph_test.go
#	internal/inventory/azurefetcher/fetcher_storage.go
kubasobon added a commit that referenced this pull request Sep 1, 2025
…s (cloud.service.name) (#3545)

* [Asset Inventory][Azure] Fix Azure service names (cloud.service.name) (#3466)

* update test cases

* update Azure service names

* apply review remarks

* rename FlexibleMySQLDBAssetType

* rename MySQLDBAssetType

* gofmt

(cherry picked from commit 7e3234f)

# Conflicts:
#	internal/inventory/azurefetcher/fetcher_resource_graph.go
#	internal/inventory/azurefetcher/fetcher_resource_graph_test.go
#	internal/inventory/azurefetcher/fetcher_storage.go

* resolve conflicts

* update tests

* make linter happy

---------

Co-authored-by: Kuba Soboń <[email protected]>
kubasobon added a commit that referenced this pull request Sep 1, 2025
…s (cloud.service.name) (#3544)

* [Asset Inventory][Azure] Fix Azure service names (cloud.service.name) (#3466)

* update test cases

* update Azure service names

* apply review remarks

* rename FlexibleMySQLDBAssetType

* rename MySQLDBAssetType

* gofmt

(cherry picked from commit 7e3234f)

# Conflicts:
#	internal/inventory/azurefetcher/fetcher_resource_graph.go
#	internal/inventory/azurefetcher/fetcher_resource_graph_test.go
#	internal/inventory/azurefetcher/fetcher_storage.go

* resolve conflicts

* update tests

* make linter happy

---------

Co-authored-by: Kuba Soboń <[email protected]>
kubasobon added a commit that referenced this pull request Sep 1, 2025
…es (cloud.service.name) (#3543)

* [Asset Inventory][Azure] Fix Azure service names (cloud.service.name) (#3466)

* update test cases

* update Azure service names

* apply review remarks

* rename FlexibleMySQLDBAssetType

* rename MySQLDBAssetType

* gofmt

(cherry picked from commit 7e3234f)

# Conflicts:
#	internal/inventory/azurefetcher/fetcher_resource_graph.go
#	internal/inventory/azurefetcher/fetcher_resource_graph_test.go
#	internal/inventory/azurefetcher/fetcher_storage.go

* resolve conflicts

* update tests

* make linter happy

---------

Co-authored-by: Kuba Soboń <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants