You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/cosmos-db/audit-control-plane-logs.md
+76-4Lines changed: 76 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,11 +11,17 @@ ms.author: sngun
11
11
12
12
# How to audit Azure Cosmos DB control plane operations
13
13
14
-
Control plane operations include changes to the Azure Cosmos account or container. For example, create an Azure Cosmos account, add a region, update throughput, region failover, add a VNet etc. are some of the control plane operations. This article explains how to audit the control plane operations in Azure Cosmos DB.
14
+
Control Plane for Cosmos DB is a RESTful service that enables customers to perform diverse set of operations on the Cosmos DB account. It exposes public resource model (e.g. database account) and exposes various operations to end-users to perform actions on resource model.Control plane operations include changes to the Azure Cosmos account or container. For example, create an Azure Cosmos account, add a region, update throughput, region failover, add a VNet etc. are some of the control plane operations. This article explains how to audit the control plane operations in Azure Cosmos DB. These operations can be done through cli, powershell or portal for accounts and through cli and ps for containers.
15
+
16
+
Couple examples of such scenarios
17
+
• Customer wants to get an alert when firewall rules for Cosmos DB are modified. This is required to catch unauthorized modifications to rules that govern network security of the Cosmos DB account and take quick action.
18
+
• Customer wants to get an alert if a Cosmos DB region is added / removed. Add / remove region has implications on billing, data sovereignty requirements. The alert will help detect an accidental add / remove region on the Cosmos DB account.
19
+
* Customer wants to get more detail from diagnostic log for what was changed for example in case a vnet was changed.
15
20
16
21
## Disable key based metadata write access
17
22
18
-
Before you audit the control plane operations in Azure Cosmos DB, disable the key-based metadata write access on your account. When key based metadata write access is disabled, clients connecting to the Azure Cosmos account through account keys are prevented from accessing the account. You can disable write access by setting the `disableKeyBasedMetadataWriteAccess` property to true. After you set this property, changes to any resource can happen from a user with the proper Role-based access control(RBAC) role and credentials only. To learn more on how to set this property, see the [Preventing changes from SDKs](role-based-access-control.md#preventing-changes-from-cosmos-sdk) article.
23
+
Before you audit the control plane operations in Azure Cosmos DB, disable the key-based metadata write access on your account. When key based metadata write access is disabled, clients connecting to the Azure Cosmos account through account keys are prevented from accessing the account. You can disable write access by setting the `disableKeyBasedMetadataWriteAccess` property to true. After you set this property, changes to any resource can happen from a user with the proper Role-based access control(RBAC) role and credentials. To learn more on how to set this property, see the [Preventing changes from SDKs](role-based-access-control.md#preventing-changes-from-cosmos-sdk) article.
24
+
This implies SDK based changes to throughput, index will not be rejected.
19
25
20
26
Consider the following points when turning off the metadata write access:
21
27
@@ -25,7 +31,9 @@ Before you audit the control plane operations in Azure Cosmos DB, disable the ke
25
31
26
32
## Enable diagnostic logs for control plane operations
27
33
28
-
You can enable diagnostic logs for control plane operations by using the Azure portal. Use the following steps to enable logging on control plane operations:
34
+
You can enable diagnostic logs for control plane operations by using the Azure portal. Once enabled diagnostic log will record the operation as a pair of Start and Complete events with relevent details. For example RegionFailoverStart and RegionFailoverComplete will complete the RegionFailover event as start to end.
35
+
36
+
Use the following steps to enable logging on control plane operations:
29
37
30
38
1. Sign into [Azure portal](https://portal.azure.com) and navigate to your Azure Cosmos account.
31
39
@@ -64,7 +72,71 @@ If you want to debug further, you can identify a specific operation in the **Act
64
72
65
73

66
74
75
+
## Control plane operations for account which are emitted in metrics
76
+
Many operations are tracked at account level
77
+
* Region Added
78
+
* Region Removed
79
+
* Account Deleted
80
+
* Region Failed Over
81
+
* Account Created
82
+
* Virtual Network Deleted
83
+
* Account Network Settings Updated
84
+
* Account Replication Settings
85
+
* Updated Account Keys
86
+
* Account Backup Settings Updated
87
+
* Account Diagnostic Settings Updated
88
+
89
+
## Control plane operations for database or containers emitted in metrics
For the ApiKind operation ResourceDetails contains the hole resource body coming as request payload which will contain all the properties requested to update.
135
+
136
+
137
+
138
+
67
139
## Next steps
68
140
69
141
*[Explore Azure Monitor for Azure Cosmos DB](../azure-monitor/insights/cosmosdb-insights-overview.md?toc=/azure/cosmos-db/toc.json&bc=/azure/cosmos-db/breadcrumb/toc.json)
70
-
*[Monitor and debug with metrics in Azure Cosmos DB](use-metrics.md)
142
+
*[Monitor and debug with metrics in Azure Cosmos DB](use-metrics.md)
0 commit comments