Add tenant filter, verbose logging, and default api version#29
Add tenant filter, verbose logging, and default api version#29jmattheus wants to merge 4 commits into
Conversation
|
While it might help a little, I think specifying the api version of ARM isn't the best implementation. That's because API versions vary by resource type, so a VM may have a different list of API versions for each resource. That 2018 date was selected because the original version of Stormspotter was written in early 2019 so getting resources from an API from that far back isn't ideal. Also, I'm not sure that user really needs any control over the api version, since we generally just want them to have the most updated API, especially since a lot of the older ones have a different structure for So the options would be to either specify a new common API across resources by default, or just build the cache as you mentioned in Teams. I'm a bigger fan of the cache, since that has a greater chance of reducing the amount of requests made with longer runs. Alternatively, we could create a dictionary of resources and their latest api versions. I'm not sure if that info is easily accessible but we can probably just parse https://github.com/Azure/azure-sdk-for-python to grab the latest API versions from each management client and load that info at runtime. |
|
So it turns out that we can list the resource providers per subscription and get the API versions from there. It's actually already part of the same package already being used, which is perfect. I think listing these providers and then grabbing the I say newer is better because last I checked, there are a few API versions for some resources that were not with the expected structures, so I have no issue using the preview versions. |
|
I agree. I actually have half a branch that gets gets the version from the RP but I didn't stop to look at the parsing logic to understand if the latest was really what we wanted rather than just a fallback. I think ripping the arm version arg out of this PR then adding the version caching layer in a subsequent PR is the right approach. |
|
I just realized this might cause some unwanted behavior on the AAD side. There won't be an issue with SPN credentials, since those require that the tenant be specified in the arguments (and the tenants argument here will be ignored), but additional logic is going to have to be implemented to handle CLI credentials or possibly others in the future. AAD enumeration is done via REST APIs. The REST endpoints include the tenant ID in them (i.e. If a user has access to multiple tenants (they might be a guest in another tenant), they may expect to enumerate all the tenants they have access to. The AAD logic needs to account for this. The gather tasks would need to reflect that there are multiple tenants to enumerate. |
|
Doing some work on Stormspotter this week so I'm going to revisit this idea and separate them into different PRs. |
|
@legra-ms any news is this project currently maintained or in low maintenance? Is it just abandoned because, I've seen the last commit on main is from 3 years ago |
No description provided.