> For the complete documentation index, see [llms.txt](https://cortex-docs.paloaltonetworks.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cortex-docs.paloaltonetworks.com/appsec-rules/iac-security/storage/appsec-azure-100.md).

# Cosmos DB Accounts do not have CMKs encrypting data at rest misconfiguration detected in code

## Rule Details

|                        |                                       |
| ---------------------- | ------------------------------------- |
| Cortex AppSec Rule ID  | APPSEC\_AZURE\_100                    |
| Category - Subcategory | Storage - Encryption                  |
| Provider               | AZURE                                 |
| Severity               | LOW                                   |
| Framework              | ARM, Bicep, Terraform, Terraform Plan |

## Impact

Data stored in Azure Cosmos account is automatically encrypted with keys managed by Microsoft (service-managed keys). Customer-managed keys (CMKs) give users total control over the keys used by Azure Cosmos DB to encrypt their data at rest. Built as an additional encryption layer on top of the Azure Cosmos DB default encryption at rest with service managed keys, it uses Azure Key Vault to store encryption keys and provides a way to implement double encryption.

## How to Fix

*Resource:* azurerm\_cosmosdb\_account

* *Arguments:* key\_vault\_key\_id - (Optional) A versionless Key Vault Key ID for CMK encryption.

## Changing this forces a new resource to be created. \[source,go]

{ "resource "azurerm\_cosmosdb\_account" "db" { name = "tfex-cosmos-db-${random\_integer.ri.result}" location = azurerm\_resource\_group.rg.location resource\_group\_name = azurerm\_resource\_group.rg.name offer\_type = "Standard" kind = "GlobalDocumentDB"

enable\_automatic\_failover = true

capabilities { name = "EnableAggregationPipeline" }

capabilities { name = "mongoEnableDocLevelTTL" }

capabilities { name = "MongoDBv3.4" }

consistency\_policy { consistency\_level = "BoundedStaleness" max\_interval\_in\_seconds = 10 max\_staleness\_prefix = 200 }

geo\_location { location = var.failover\_location failover\_priority = 1 }

geo\_location { location = azurerm\_resource\_group.rg.location failover\_priority = 0 }

## } ", }


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://cortex-docs.paloaltonetworks.com/appsec-rules/iac-security/storage/appsec-azure-100.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
