Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Asset Inventory][Azure] Add storage assets #2576

Open
wants to merge 17 commits into
base: main
Choose a base branch
from

Conversation

kubasobon
Copy link
Member

@kubasobon kubasobon commented Oct 1, 2024

Summary of your changes

Add 3 storage assets: Queues, Queue Services, and Blob Services.

Related Issues

Closes https://github.com/elastic/security-team/issues/10162
Closes https://github.com/elastic/security-team/issues/10163

Checklist

  • I have added tests that prove my fix is effective or that my feature works
  • I have added the necessary README/documentation (if appropriate)

Copy link

mergify bot commented Oct 1, 2024

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
    NOTE: backport-v8.x has been added to help with the transition to the new branch 8.x.

@mergify mergify bot added the backport-v8.x label Oct 1, 2024
@kubasobon kubasobon marked this pull request as ready for review October 3, 2024 09:05
@kubasobon kubasobon requested a review from a team as a code owner October 3, 2024 09:05
Comment on lines +105 to +106
SubTypeAzureStorageQueue AssetSubType = "azure-storage-queue"
SubTypeAzureStorageQueueService AssetSubType = "azure-storage-queue-service"
Copy link
Member

Choose a reason for hiding this comment

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

What is the difference between azure-storage-queue and azure-storage-queue-service?

Copy link
Member Author

Choose a reason for hiding this comment

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

Queue Service (and other Services in this context) are properties tied to Storage Account, e.g. Storage Account > Blob Service > Blob anonymous access: enabled.

Relationship chart looks like this:

graph LR;
    SA[Storage Account];
    B[Blob Service];
    F[File Service];
    Q[Queue Service];
    T[Table Service];
    BB[Blobs...];
    FF[Files...];
    QQ[Queues...];
    TT[Tables...];
    

    SA --> B;
    SA --> F;
    SA --> Q;
    SA --> T;
    SA --> BB;
    SA --> FF;
    SA --> QQ;
    SA --> TT;
Loading

}

func (f *storageFetcher) fetch(ctx context.Context, storageAccounts []azurelib.AzureAsset, resourceName string, function storageProviderFunc, classification inventory.AssetClassification, assetChan chan<- inventory.AssetEvent) {
f.logger.Infof("Fetching %s", resourceName)
Copy link
Member

Choose a reason for hiding this comment

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

Do we have this for every fetcher? I wonder if we are not over-logging

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes we do. Assuming we'll have ~200 assets, even if we're scanning every minute, that's 400 lines/minute. I'd say that is a very tame amount of logs. If we want to change the approach, then let's do it in a separate PR for all of the fetchers.

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.

2 participants