Skip to content

Commit f176821

Browse files
authored
Updated information about events
We need to update the schema.
1 parent c4c1e50 commit f176821

File tree

1 file changed

+76
-4
lines changed

1 file changed

+76
-4
lines changed

articles/cosmos-db/audit-control-plane-logs.md

Lines changed: 76 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,17 @@ ms.author: sngun
1111

1212
# How to audit Azure Cosmos DB control plane operations
1313

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.
1520

1621
## Disable key based metadata write access
1722

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.
1925

2026
Consider the following points when turning off the metadata write access:
2127

@@ -25,7 +31,9 @@ Before you audit the control plane operations in Azure Cosmos DB, disable the ke
2531

2632
## Enable diagnostic logs for control plane operations
2733

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:
2937

3038
1. Sign into [Azure portal](https://portal.azure.com) and navigate to your Azure Cosmos account.
3139

@@ -64,7 +72,71 @@ If you want to debug further, you can identify a specific operation in the **Act
6472

6573
![Use the activity ID and find the operations](./media/audit-control-plane-logs/find-operations-with-activity-id.png)
6674

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
90+
* SQL Database Updated
91+
* SQL Container Updated
92+
* SQL Database Throughput Updated
93+
* SQL Container Throughput Updated
94+
* SQL Database Deleted
95+
* SQL Container Deleted
96+
* Cassandra Keyspace Updated
97+
* Cassandra Table Updated
98+
* Cassandra Keyspace Throughput Updated
99+
* Cassandra Table Throughput Updated
100+
* Cassandra Keyspace Deleted
101+
* Cassandra Table Deleted
102+
* Gremlin Database Updated
103+
* Gremlin Graph Updated
104+
* Gremlin Database Throughput Updated
105+
* Gremlin Graph Throughput Updated
106+
* Gremlin Database Deleted
107+
* Gremlin Graph Deleted
108+
* Mongo Database Updated
109+
* Mongo Collection Updated
110+
* Mongo Database Throughput Updated
111+
* Mongo Collection Throughput Updated
112+
* Mongo Database Deleted
113+
* Mongo Collection Deleted
114+
* AzureTable Table Updated
115+
* AzureTable Table Throughput Updated
116+
* AzureTable Table Deleted
117+
118+
## Diagnostic log operations
119+
* RegionAddStart, RegionAddComplete
120+
* RegionRemoveStart, RegionRemoveComplete
121+
* AccountDeleteStart, AccountDeleteComplete
122+
* RegionFailoverStart, RegionFailoverComplete
123+
* AccountCreateStart, AccountCreateComplete
124+
* AccountUpdateStart, AccountUpdateComplete
125+
* VirtualNetworkDeleteStart, VirtualNetworkDeleteComplete
126+
* DiagnosticLogUpdateStart, DiagnosticLogUpdateComplete
127+
* ApiKind + ApiKindResourceType + OperationType + Start/Complete
128+
* ApiKind + ApiKindResourceType + "Throughput" + operationType + Start/Complete
129+
130+
Ex:
131+
* CassandraKeyspacesUpdateStart, CassandraKeyspacesUpdateComplete
132+
* CassandraKeyspacesThroughputUpdateStart, CassandraKeyspacesThroughputUpdateComplete
133+
134+
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+
67139
## Next steps
68140

69141
* [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

Comments
 (0)