Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Defender: Azure Cosmos DB should disable public network access #4324

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ BUG FIXES:
* Fix Azure ML network tags to use name rather than ID ([[#4151](https://github.com/microsoft/AzureTRE/issues/4151)])
* Windows R version must be 4.1.2 otherwise post install script doesn't update package mirror URL ([#4288](https://github.com/microsoft/AzureTRE/issues/4288))
* Recreate tre_output.json if empty. ([[#4292](https://github.com/microsoft/AzureTRE/issues/4292)])
* Defender: Azure Cosmos DB should disable public network access ([#4322](https://github.com/microsoft/AzureTRE/issues/4322))

COMPONENTS:

Expand Down
17 changes: 9 additions & 8 deletions core/terraform/cosmos_mongo.tf
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
resource "azurerm_cosmosdb_account" "mongo" {
name = "cosmos-mongo-${var.tre_id}"
location = azurerm_resource_group.core.location
resource_group_name = azurerm_resource_group.core.name
offer_type = "Standard"
kind = "MongoDB"
automatic_failover_enabled = false
mongo_server_version = 4.2
ip_range_filter = "${local.azure_portal_cosmos_ips}${var.enable_local_debugging ? ",${local.myip}" : ""}"
name = "cosmos-mongo-${var.tre_id}"
location = azurerm_resource_group.core.location
resource_group_name = azurerm_resource_group.core.name
offer_type = "Standard"
kind = "MongoDB"
automatic_failover_enabled = false
mongo_server_version = 4.2
ip_range_filter = var.enable_local_debugging ? "${local.azure_portal_cosmos_ips},${local.myip}" : ""
public_network_access_enabled = var.enable_local_debugging

capabilities {
name = "EnableServerless"
Expand Down
2 changes: 1 addition & 1 deletion core/terraform/locals.tf
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ locals {
docker_registry_server = data.azurerm_container_registry.mgmt_acr.login_server

# https://learn.microsoft.com/en-us/azure/cosmos-db/how-to-configure-firewall#allow-requests-from-the-azure-portal
azure_portal_cosmos_ips = "104.42.195.92,40.76.54.131,52.176.6.30,52.169.50.45,52.187.184.26"
azure_portal_cosmos_ips = "13.91.105.215,4.210.172.107,13.88.56.148,40.91.218.243"

# we define some zones in core despite not used by the core infra because
# it's the easier way to make them available to other services in the system.
Expand Down
3 changes: 2 additions & 1 deletion core/terraform/statestore.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ resource "azurerm_cosmosdb_account" "tre_db_account" {
offer_type = "Standard"
kind = "GlobalDocumentDB"
automatic_failover_enabled = false
ip_range_filter = "${local.azure_portal_cosmos_ips}${var.enable_local_debugging ? ",${local.myip}" : ""}"
ip_range_filter = var.enable_local_debugging ? "${local.azure_portal_cosmos_ips},${local.myip}" : ""
local_authentication_disabled = true
tags = local.tre_core_tags
public_network_access_enabled = var.enable_local_debugging

dynamic "capabilities" {
# We can't change an existing cosmos
Expand Down
2 changes: 1 addition & 1 deletion core/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.11.22"
__version__ = "0.11.23"
Loading