Control: Cosmos DB accounts should have local authentication disabled
Description
Ensure that local authentication is disabled on CosmosDB accounts.
Usage
Run the control in your terminal:
powerpipe control run terraform_azure_compliance.control.cosmodb_account_local_authentication_disabled
Snapshot and share results via Turbot Pipes:
powerpipe loginpowerpipe control run terraform_azure_compliance.control.cosmodb_account_local_authentication_disabled --share
SQL
This control uses a named query:
select address as resource, case when (attributes_std ->> 'kind') is not null and (attributes_std ->> 'kind') <> 'GlobalDocumentDB' then 'skip' when (attributes_std ->> 'local_authentication_disabled')::boolean then 'ok' else 'alarm' end status, split_part(address, '.', 2) || case when (attributes_std ->> 'kind') is not null and (attributes_std ->> 'kind') <> 'GlobalDocumentDB' then ' not GlobalDocumentDB' when (attributes_std ->> 'local_authentication_disabled')::boolean then ' local authentication disabled' else ' local authentication enabled' end || '.' reason , path || ':' || start_linefrom terraform_resourcewhere type = 'azurerm_cosmosdb_account';