Feature/661 Azure specific resource group #1542
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Allows to add the flag --resource-group "RG_NAME" to only scan the specified resource group in Azure.
This is achieved by passing the value of the flag up the abstractions until the facade creation. Then when resources are fetched the Facade classes check if self.resource_group is set, and if it is, it only fetches from that resource group using the appropriate APIs (either list_by_resource_group(resource_group_name=self.resource_group) or list(resource_group_name=self.resource_group) ).
Not sure if this is the best place to put it, let me know if you want refactoring.
I tested it on resources that I spawned up and it worked, I didn't see any existing relevant test suites for Azure.
Didn't modify Facade for AAD, RBAC and security center since those checks are inherently subscription level checks.
Fixes #661
Type of change
Select the relevant option(s):
Checklist: