Implement database security controls
Unlock the complete study guide + 25 practice exams totaling 1,500 questions.
Bundled into the existing Building AI Applications with Azure Cosmos DB premium course — no separate purchase.
14-day refund guarantee on one-time purchases and your first subscription charge.
Included in this chapter:
- Four controls between a request and your data
- Three credentials for the data plane
- Connecting with a managed identity
- Turning off account key authentication
- Rotating account keys without downtime
- Delegating access with resource tokens
- Building the REST authorization header
- Data actions and the built-in data roles
- Creating, assigning, and scoping data roles
- Control-plane roles for administrators
- Making configuration changes attributable
- Choosing among the network controls
- Configuring the IP firewall
- Admitting subnets through service endpoints
- Moving a subnet from IP rules to a service endpoint
- Connecting privately with Azure Private Link
- Resolving the account name to private addresses
- Adding a private endpoint to a live account
- Enabling dynamic data masking
- Writing a masking policy
- Granting unmasked access
- What masking does not protect
- Recognizing security scenarios in exam questions
IP firewall vs service endpoint vs private endpoint
| Network control | IP firewall | Service endpoint | Private endpoint |
|---|---|---|---|
| What the account admits | Public IP addresses or CIDR ranges (no private addresses) | A subnet's identity, matched by a virtual network rule | Traffic arriving through the private endpoint |
| Address the client connects to | The account's public address | The account's public address (DNS is unchanged) | Private IP addresses in your subnet: one global, one per account region |
| Other networks that can use it | Any source whose public IP is listed | Only subnets added to the account; peered networks need their own rules | Peered virtual networks and on-premises over VPN or ExpressRoute private peering |
| Settings to configure | ipRules (ipRangeFilter before API version 2020-04-01) | Microsoft.AzureCosmosDB on the subnet plus a virtual network rule on the account | Sql or SqlDedicated subresource plus a private DNS zone |
| Direct mode TCP ports to open | 10000 to 20000 | 10000 to 20000 | 0 to 65535 |
Decision tree
Cheat sheet
Unlock with Premium — includes all practice exams and the complete study guide.
Also tested in
References
- https://learn.microsoft.com/en-us/azure/cosmos-db/how-to-configure-firewall
- https://learn.microsoft.com/en-us/credentials/certifications/resources/study-guides/dp-420
- https://learn.microsoft.com/en-us/azure/cosmos-db/nosql/dynamic-data-masking
- https://learn.microsoft.com/en-us/azure/cosmos-db/reference-data-plane-security
- https://learn.microsoft.com/en-us/azure/cosmos-db/nosql/how-to-connect-role-based-access-control
- https://learn.microsoft.com/en-us/azure/cosmos-db/nosql/security
- https://learn.microsoft.com/en-us/rest/api/cosmos-db/access-control-on-cosmosdb-resources
- https://learn.microsoft.com/en-us/dotnet/api/azure.identity.defaultazurecredential
- https://learn.microsoft.com/en-us/azure/cosmos-db/nosql/how-to-rotate-keys
- https://learn.microsoft.com/en-us/azure/cosmos-db/audit-control-plane-logs
- https://learn.microsoft.com/en-us/rest/api/cosmos-db/permissions
- https://learn.microsoft.com/en-us/rest/api/cosmos-db/create-a-permission
- https://learn.microsoft.com/en-us/rest/api/cosmos-db-resource-provider/sql-resources/create-update-sql-role-definition
- https://learn.microsoft.com/en-us/rest/api/cosmos-db-resource-provider/database-accounts/list-read-only-keys
- https://learn.microsoft.com/en-us/azure/role-based-access-control/built-in-roles/databases
- https://learn.microsoft.com/en-us/azure/cosmos-db/how-to-configure-private-endpoints
- https://learn.microsoft.com/en-us/azure/cosmos-db/how-to-configure-vnet-service-endpoint
- https://learn.microsoft.com/en-us/azure/virtual-network/virtual-network-service-endpoints-overview
- https://learn.microsoft.com/en-us/azure/cosmos-db/dedicated-gateway
- https://learn.microsoft.com/en-us/azure/cosmos-db/nosql/sdk-connection-modes
- https://learn.microsoft.com/en-us/azure/expressroute/expressroute-circuit-peerings
- https://learn.microsoft.com/en-us/azure/cosmos-db/analytical-store-introduction
- https://learn.microsoft.com/en-us/azure/cosmos-db/analytical-store-private-endpoints
- https://learn.microsoft.com/en-us/azure/private-link/private-endpoint-overview
- https://learn.microsoft.com/en-us/azure/private-link/private-endpoint-dns-integration
- https://learn.microsoft.com/en-us/azure/firewall/dns-settings
- https://learn.microsoft.com/en-us/azure/dns/dns-private-resolver-overview
- https://learn.microsoft.com/en-us/azure/cosmos-db/how-to-manage-indexing-policy
- https://learn.microsoft.com/en-us/azure/cosmos-db/how-to-always-encrypted