Skip to content

Commit 408e363

Browse files
committed
disbale eventgrid local auth
1 parent 49da7fc commit 408e363

File tree

10 files changed

+63
-32
lines changed

10 files changed

+63
-32
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ ENHANCEMENTS:
3535
* Add option to force tunnel TRE's Firewall ([#4237](https://github.com/microsoft/AzureTRE/issues/4237))
3636
* Add EventGrid diagnostics to identify airlock issues ([#4258](https://github.com/microsoft/AzureTRE/issues/4258))
3737
* Surface the server-layout parameter of Guacamole [server-layout](https://guacamole.apache.org/doc/gug/configuring-guacamole.html#session-settings) ([#4234](https://github.com/microsoft/AzureTRE/issues/4234))
38+
* Airlock function host storage to use the user-assigned managed identity ([#4276](https://github.com/microsoft/AzureTRE/issues/4276))
39+
* Disable local authentication in EventGrid ([[#4254](https://github.com/microsoft/AzureTRE/issues/4254)])
3840

3941
BUG FIXES:
4042
* Update KeyVault references in API to use the version so Terraform cascades the update ([#4112](https://github.com/microsoft/AzureTRE/pull/4112))

airlock_processor/BlobCreatedTrigger/function.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,13 @@
1313
{
1414
"type": "eventGrid",
1515
"name": "stepResultEvent",
16-
"topicEndpointUri": "EVENT_GRID_STEP_RESULT_TOPIC_URI_SETTING",
17-
"topicKeySetting": "EVENT_GRID_STEP_RESULT_TOPIC_KEY_SETTING",
16+
"connection": "EVENT_GRID_STEP_RESULT_CONNECTION",
1817
"direction": "out"
1918
},
2019
{
2120
"type": "eventGrid",
2221
"name": "dataDeletionEvent",
23-
"topicEndpointUri": "EVENT_GRID_DATA_DELETION_TOPIC_URI_SETTING",
24-
"topicKeySetting": "EVENT_GRID_DATA_DELETION_TOPIC_KEY_SETTING",
22+
"connection": "EVENT_GRID_DATA_DELETION_CONNECTION",
2523
"direction": "out"
2624
}
2725
]

airlock_processor/ScanResultTrigger/function.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@
1212
{
1313
"type": "eventGrid",
1414
"name": "outputEvent",
15-
"topicEndpointUri": "EVENT_GRID_STEP_RESULT_TOPIC_URI_SETTING",
16-
"topicKeySetting": "EVENT_GRID_STEP_RESULT_TOPIC_KEY_SETTING",
15+
"connection": "EVENT_GRID_STEP_RESULT_CONNECTION",
1716
"direction": "out"
1817
}
1918
]

airlock_processor/StatusChangedQueueTrigger/function.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,13 @@
1111
{
1212
"type": "eventGrid",
1313
"name": "stepResultEvent",
14-
"topicEndpointUri": "EVENT_GRID_STEP_RESULT_TOPIC_URI_SETTING",
15-
"topicKeySetting": "EVENT_GRID_STEP_RESULT_TOPIC_KEY_SETTING",
14+
"connection": "EVENT_GRID_STEP_RESULT_CONNECTION",
1615
"direction": "out"
1716
},
1817
{
1918
"type": "eventGrid",
2019
"name": "dataDeletionEvent",
21-
"topicEndpointUri": "EVENT_GRID_DATA_DELETION_TOPIC_URI_SETTING",
22-
"topicKeySetting": "EVENT_GRID_DATA_DELETION_TOPIC_KEY_SETTING",
20+
"connection": "EVENT_GRID_DATA_DELETION_CONNECTION",
2321
"direction": "out"
2422
}
2523
]

airlock_processor/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "0.8.0"
1+
__version__ = "0.8.1"

core/terraform/airlock/airlock_processor.tf

Lines changed: 25 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -66,25 +66,31 @@ resource "azurerm_linux_function_app" "airlock_function_app" {
6666
}
6767

6868
app_settings = {
69-
"SB_CONNECTION_STRING" = var.airlock_servicebus.default_primary_connection_string
70-
"BLOB_CREATED_TOPIC_NAME" = azurerm_servicebus_topic.blob_created.name
71-
"TOPIC_SUBSCRIPTION_NAME" = azurerm_servicebus_subscription.airlock_processor.name
72-
"EVENT_GRID_STEP_RESULT_TOPIC_URI_SETTING" = azurerm_eventgrid_topic.step_result.endpoint
73-
"EVENT_GRID_STEP_RESULT_TOPIC_KEY_SETTING" = azurerm_eventgrid_topic.step_result.primary_access_key
74-
"EVENT_GRID_DATA_DELETION_TOPIC_URI_SETTING" = azurerm_eventgrid_topic.data_deletion.endpoint
75-
"EVENT_GRID_DATA_DELETION_TOPIC_KEY_SETTING" = azurerm_eventgrid_topic.data_deletion.primary_access_key
76-
"WEBSITES_ENABLE_APP_SERVICE_STORAGE" = false
77-
"AIRLOCK_STATUS_CHANGED_QUEUE_NAME" = local.status_changed_queue_name
78-
"AIRLOCK_SCAN_RESULT_QUEUE_NAME" = local.scan_result_queue_name
79-
"AIRLOCK_DATA_DELETION_QUEUE_NAME" = local.data_deletion_queue_name
80-
"ENABLE_MALWARE_SCANNING" = var.enable_malware_scanning
81-
"ARM_ENVIRONMENT" = var.arm_environment
82-
"MANAGED_IDENTITY_CLIENT_ID" = azurerm_user_assigned_identity.airlock_id.client_id
83-
"TRE_ID" = var.tre_id
84-
"WEBSITE_CONTENTOVERVNET" = 1
85-
"STORAGE_ENDPOINT_SUFFIX" = module.terraform_azurerm_environment_configuration.storage_suffix
86-
"AzureWebJobsStorage__clientId" = azurerm_user_assigned_identity.airlock_id.client_id
87-
"AzureWebJobsStorage__credential" = "managedidentity"
69+
"SB_CONNECTION_STRING" = var.airlock_servicebus.default_primary_connection_string
70+
"BLOB_CREATED_TOPIC_NAME" = azurerm_servicebus_topic.blob_created.name
71+
"TOPIC_SUBSCRIPTION_NAME" = azurerm_servicebus_subscription.airlock_processor.name
72+
"WEBSITES_ENABLE_APP_SERVICE_STORAGE" = false
73+
"AIRLOCK_STATUS_CHANGED_QUEUE_NAME" = local.status_changed_queue_name
74+
"AIRLOCK_SCAN_RESULT_QUEUE_NAME" = local.scan_result_queue_name
75+
"AIRLOCK_DATA_DELETION_QUEUE_NAME" = local.data_deletion_queue_name
76+
"ENABLE_MALWARE_SCANNING" = var.enable_malware_scanning
77+
"ARM_ENVIRONMENT" = var.arm_environment
78+
"MANAGED_IDENTITY_CLIENT_ID" = azurerm_user_assigned_identity.airlock_id.client_id
79+
"TRE_ID" = var.tre_id
80+
"WEBSITE_CONTENTOVERVNET" = 1
81+
"STORAGE_ENDPOINT_SUFFIX" = module.terraform_azurerm_environment_configuration.storage_suffix
82+
"AzureWebJobsStorage__clientId" = azurerm_user_assigned_identity.airlock_id.client_id
83+
"AzureWebJobsStorage__credential" = "managedidentity"
84+
85+
"EVENT_GRID_STEP_RESULT_CONNECTION" = local.step_result_eventgrid_connection
86+
"${local.step_result_eventgrid_connection}__topicEndpointUri" = azurerm_eventgrid_topic.step_result.endpoint
87+
"${local.step_result_eventgrid_connection}__credential" = "managedidentity"
88+
"${local.step_result_eventgrid_connection}__clientId" = azurerm_user_assigned_identity.airlock_id.client_id
89+
90+
"EVENT_GRID_DATA_DELETION_CONNECTION" = local.data_deletion_eventgrid_connection
91+
"${local.data_deletion_eventgrid_connection}__topicEndpointUri" = azurerm_eventgrid_topic.data_deletion.endpoint
92+
"${local.data_deletion_eventgrid_connection}__credential" = "managedidentity"
93+
"${local.data_deletion_eventgrid_connection}__clientId" = azurerm_user_assigned_identity.airlock_id.client_id
8894
}
8995

9096
site_config {

core/terraform/airlock/eventgrid_topics.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ resource "azurerm_eventgrid_topic" "step_result" {
66
location = var.location
77
resource_group_name = var.resource_group_name
88
public_network_access_enabled = var.enable_local_debugging
9+
local_auth_enabled = false
910

1011
identity {
1112
type = "SystemAssigned"
@@ -60,6 +61,7 @@ resource "azurerm_eventgrid_topic" "status_changed" {
6061
location = var.location
6162
resource_group_name = var.resource_group_name
6263
public_network_access_enabled = var.enable_local_debugging
64+
local_auth_enabled = false
6365

6466
identity {
6567
type = "SystemAssigned"
@@ -113,6 +115,7 @@ resource "azurerm_eventgrid_topic" "data_deletion" {
113115
location = var.location
114116
resource_group_name = var.resource_group_name
115117
public_network_access_enabled = var.enable_local_debugging
118+
local_auth_enabled = false
116119

117120
identity {
118121
type = "SystemAssigned"
@@ -163,6 +166,7 @@ resource "azurerm_eventgrid_topic" "scan_result" {
163166
resource_group_name = var.resource_group_name
164167
# This is mandatory for the scan result to be published since private networks are not supported yet
165168
public_network_access_enabled = true
169+
local_auth_enabled = false
166170

167171
identity {
168172
type = "SystemAssigned"
@@ -323,6 +327,7 @@ resource "azurerm_eventgrid_topic" "airlock_notification" {
323327
location = var.location
324328
resource_group_name = var.resource_group_name
325329
public_network_access_enabled = var.enable_local_debugging
330+
local_auth_enabled = false
326331

327332
identity {
328333
type = "SystemAssigned"

core/terraform/airlock/identity.tf

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ resource "azurerm_role_assignment" "servicebus_receiver" {
2525
principal_id = azurerm_user_assigned_identity.airlock_id.principal_id
2626
}
2727

28-
resource "azurerm_role_assignment" "eventgrid_data_sender" {
28+
resource "azurerm_role_assignment" "eventgrid_data_sender_status_changed" {
2929
scope = azurerm_eventgrid_topic.status_changed.id
3030
role_definition_name = "EventGrid Data Sender"
3131
principal_id = var.api_principal_id
@@ -37,6 +37,18 @@ resource "azurerm_role_assignment" "eventgrid_data_sender_notification" {
3737
principal_id = var.api_principal_id
3838
}
3939

40+
resource "azurerm_role_assignment" "eventgrid_data_sender_step_result" {
41+
scope = azurerm_eventgrid_topic.step_result.id
42+
role_definition_name = "EventGrid Data Sender"
43+
principal_id = azurerm_user_assigned_identity.airlock_id.principal_id
44+
}
45+
46+
resource "azurerm_role_assignment" "eventgrid_data_sender_data_deletion" {
47+
scope = azurerm_eventgrid_topic.data_deletion.id
48+
role_definition_name = "EventGrid Data Sender"
49+
principal_id = azurerm_user_assigned_identity.airlock_id.principal_id
50+
}
51+
4052
resource "azurerm_role_assignment" "airlock_blob_data_contributor" {
4153
count = length(local.airlock_sa_blob_data_contributor)
4254
scope = local.airlock_sa_blob_data_contributor[count.index]
@@ -52,3 +64,11 @@ resource "azurerm_role_assignment" "api_sa_data_contributor" {
5264
role_definition_name = "Storage Blob Data Contributor"
5365
principal_id = var.api_principal_id
5466
}
67+
68+
# Permissions needed for the Function Host to work correctly.
69+
resource "azurerm_role_assignment" "function_host_storage" {
70+
for_each = toset(["Storage Account Contributor", "Storage Blob Data Owner", "Storage Queue Data Contributor"])
71+
scope = azurerm_storage_account.sa_airlock_processor_func_app.id
72+
role_definition_name = each.value
73+
principal_id = azurerm_user_assigned_identity.airlock_id.principal_id
74+
}

core/terraform/airlock/locals.tf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,4 +60,7 @@ locals {
6060
azurerm_storage_account.sa_import_in_progress.id,
6161
azurerm_storage_account.sa_export_approved.id
6262
]
63+
64+
step_result_eventgrid_connection = "EVENT_GRID_STEP_RESULT_CONNECTION"
65+
data_deletion_eventgrid_connection = "EVENT_GRID_DATA_DELETION_CONNECTION"
6366
}

core/version.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "0.11.17"
1+
__version__ = "0.11.18"

0 commit comments

Comments
 (0)