inspec / inspec-azure

InSpec Azure Resource Pack
https://www.inspec.io/
Other
97 stars 80 forks source link

CLI Integrated Authentication #626

Open bdwyertech opened 2 years ago

bdwyertech commented 2 years ago

Add support for consuming Azure credentials from ~/.azure and/or retrieve access key by shelling out to az

Context

It would be much better to leverage the CLI token provider to automatically retrieve a properly scoped access token so end-users don't have to. kitchen-azurerm already does this.

Possible Implementation

I see that this is lightweight and does not pull in any Azure SDK. Thats fine, the logic can be stolen directly from the SDK

https://github.com/Azure/azure-sdk-for-ruby/blob/master/runtime/ms_rest_azure/lib/ms_rest_azure/credentials/azure_cli_token_provider.rb