Skip to content

Commit 4fe8ca3

Browse files
authored
Fix Private Endpoint DNS conflict in Airlock Review Workspace (#3215)
* fix airlock review workspace private endpoint dns * changelog
1 parent 19fe846 commit 4fe8ca3

File tree

3 files changed

+5
-100
lines changed

3 files changed

+5
-100
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ BUG FIXES:
4747
* Create Workspace AppInsights via AzAPI provider due to an issue with AzureRM [#3207](https://github.com/microsoft/AzureTRE/pull/3207)
4848
* 'Workspace Owner' is now able to access Airlock request's SAS URL even if the request is not in review [#3208](https://github.com/microsoft/AzureTRE/pull/3208)
4949
* Ignore changes in log_analytics_destination_type to prevent redundant updates [#3217](https://github.com/microsoft/AzureTRE/pull/3217)
50+
* Fix DNS conflict in airlock-review workspace that could make the entire airlock module inoperable [#3215](https://github.com/microsoft/AzureTRE/pull/3215)
5051
5152
COMPONENTS:
5253

templates/workspaces/airlock-import-review/porter.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
schemaVersion: 1.0.0
33
name: tre-workspace-airlock-import-review
4-
version: 0.8.1
4+
version: 0.8.2
55
description: "A workspace to do Airlock Data Import Reviews for Azure TRE"
66
dockerfile: Dockerfile.tmpl
77
registry: azuretre

templates/workspaces/airlock-import-review/workspace_base.diff

Lines changed: 3 additions & 99 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,6 @@ diff -Naur ../base/terraform/airlock/data.tf terraform/airlock/data.tf
1313
diff -Naur ../base/terraform/airlock/locals.tf terraform/airlock/locals.tf
1414
--- ../base/terraform/airlock/locals.tf 2022-08-17 12:09:06.000000000 +0100
1515
+++ terraform/airlock/locals.tf 2022-09-14 23:46:54.000000000 +0100
16-
@@ -1,4 +1,5 @@
17-
locals {
18-
+ core_vnet = "vnet-${var.tre_id}"
19-
core_resource_group_name = "rg-${var.tre_id}"
20-
workspace_resource_name_suffix = "${var.tre_id}-ws-${var.short_workspace_id}"
21-
2216
@@ -11,6 +12,8 @@
2317

2418
# STorage AirLock IMport APProved
@@ -28,25 +22,6 @@ diff -Naur ../base/terraform/airlock/locals.tf terraform/airlock/locals.tf
2822
# STorage AirLock EXport INTernal
2923
export_internal_storage_name = lower(replace("stalexint${substr(local.workspace_resource_name_suffix, -8, -1)}", "-", ""))
3024
# STorage AirLock EXport InProgress
31-
@@ -19,18 +22,4 @@
32-
export_rejected_storage_name = lower(replace("stalexrej${substr(local.workspace_resource_name_suffix, -8, -1)}", "-", ""))
33-
# STorage AirLock EXport BLOCKED
34-
export_blocked_storage_name = lower(replace("stalexblocked${substr(local.workspace_resource_name_suffix, -8, -1)}", "-", ""))
35-
-
36-
- airlock_blob_data_contributor = [
37-
- azurerm_storage_account.sa_import_approved.id,
38-
- azurerm_storage_account.sa_export_internal.id,
39-
- azurerm_storage_account.sa_export_inprogress.id,
40-
- azurerm_storage_account.sa_export_rejected.id,
41-
- azurerm_storage_account.sa_export_blocked.id
42-
- ]
43-
-
44-
- api_sa_data_contributor = [
45-
- azurerm_storage_account.sa_import_approved.id,
46-
- azurerm_storage_account.sa_export_internal.id,
47-
- azurerm_storage_account.sa_export_inprogress.id
48-
- ]
49-
}
5025
diff -Naur ../base/terraform/airlock/storage_accounts.tf terraform/airlock/storage_accounts.tf
5126
--- ../base/terraform/airlock/storage_accounts.tf 2022-08-17 12:09:06.000000000 +0100
5227
+++ terraform/airlock/storage_accounts.tf 2022-09-14 23:46:54.000000000 +0100
@@ -57,20 +32,20 @@ diff -Naur ../base/terraform/airlock/storage_accounts.tf terraform/airlock/stora
5732
+# 'In progress' storage account
5833
+
5934
+resource "azurerm_private_endpoint" "sa_import_inprogress_pe" {
60-
+ name = "stg-ip-import-blob-${var.tre_id}-ws-${var.short_workspace_id}"
35+
+ name = "stg-ip-import-blob-${local.workspace_resource_name_suffix}"
6136
+ location = var.location
6237
+ resource_group_name = var.ws_resource_group_name
6338
+ subnet_id = var.services_subnet_id
6439
+
6540
+ lifecycle { ignore_changes = [tags] }
6641
+
6742
+ private_dns_zone_group {
68-
+ name = "private-dns-zone-group-stg-import-ip"
43+
+ name = "pdzg-stg-ip-import-blob-${local.workspace_resource_name_suffix}"
6944
+ private_dns_zone_ids = [data.azurerm_private_dns_zone.blobcore.id]
7045
+ }
7146
+
7247
+ private_service_connection {
73-
+ name = "psc-stgipimport-${var.tre_id}"
48+
+ name = "psc-stg-ip-import-blob-${local.workspace_resource_name_suffix}"
7449
+ private_connection_resource_id = data.azurerm_storage_account.sa_import_inprogress.id
7550
+ is_manual_connection = false
7651
+ subresource_names = ["Blob"]
@@ -81,77 +56,6 @@ diff -Naur ../base/terraform/airlock/storage_accounts.tf terraform/airlock/stora
8156

8257
# 'Drop' location for export
8358
resource "azurerm_storage_account" "sa_export_internal" {
84-
@@ -259,19 +283,59 @@
85-
}
86-
}
87-
88-
-# we can't use for_each due to the data object
89-
-resource "azurerm_role_assignment" "airlock_blob_data_contributor" {
90-
- count = length(local.airlock_blob_data_contributor)
91-
- scope = local.airlock_blob_data_contributor[count.index]
92-
- role_definition_name = "Storage Blob Data Contributor"
93-
+resource "azurerm_role_assignment" "sa_import_approved" {
94-
+ scope = azurerm_storage_account.sa_import_approved.id
95-
+ role_definition_name = "Contributor"
96-
+ principal_id = data.azurerm_user_assigned_identity.airlock_id.principal_id
97-
+}
98-
+
99-
+
100-
+resource "azurerm_role_assignment" "sa_export_internal" {
101-
+ scope = azurerm_storage_account.sa_export_internal.id
102-
+ role_definition_name = "Contributor"
103-
principal_id = data.azurerm_user_assigned_identity.airlock_id.principal_id
104-
}
105-
106-
-# This might be considered redundent since we give Virtual Machine Contributor
107-
-# at the subscription level, but best to be explicit.
108-
-resource "azurerm_role_assignment" "api_sa_data_contributor" {
109-
- count = length(local.api_sa_data_contributor)
110-
- scope = local.api_sa_data_contributor[count.index]
111-
- role_definition_name = "Storage Blob Data Contributor"
112-
+resource "azurerm_role_assignment" "sa_export_inprogress" {
113-
+ scope = azurerm_storage_account.sa_export_inprogress.id
114-
+ role_definition_name = "Contributor"
115-
+ principal_id = data.azurerm_user_assigned_identity.airlock_id.principal_id
116-
+}
117-
+
118-
+resource "azurerm_role_assignment" "sa_export_rejected" {
119-
+ scope = azurerm_storage_account.sa_export_rejected.id
120-
+ role_definition_name = "Contributor"
121-
+ principal_id = data.azurerm_user_assigned_identity.airlock_id.principal_id
122-
+}
123-
+
124-
+resource "azurerm_role_assignment" "sa_export_blocked" {
125-
+ scope = azurerm_storage_account.sa_export_blocked.id
126-
+ role_definition_name = "Contributor"
127-
+ principal_id = data.azurerm_user_assigned_identity.airlock_id.principal_id
128-
+}
129-
+
130-
+
131-
+resource "azurerm_role_assignment" "sa_import_approved_reader" {
132-
+ scope = azurerm_storage_account.sa_import_approved.id
133-
+ role_definition_name = "Reader and Data Access"
134-
+ principal_id = data.azurerm_user_assigned_identity.api_id.principal_id
135-
+}
136-
+
137-
+
138-
+resource "azurerm_role_assignment" "sa_export_internal_reader" {
139-
+ scope = azurerm_storage_account.sa_export_internal.id
140-
+ role_definition_name = "Reader and Data Access"
141-
+ principal_id = data.azurerm_user_assigned_identity.api_id.principal_id
142-
+}
143-
+
144-
+resource "azurerm_role_assignment" "sa_export_inprogress_reader" {
145-
+ scope = azurerm_storage_account.sa_export_inprogress.id
146-
+ role_definition_name = "Reader and Data Access"
147-
+ principal_id = data.azurerm_user_assigned_identity.api_id.principal_id
148-
+}
149-
+
150-
+resource "azurerm_role_assignment" "sa_export_rejected_reader" {
151-
+ scope = azurerm_storage_account.sa_export_rejected.id
152-
+ role_definition_name = "Reader and Data Access"
153-
principal_id = data.azurerm_user_assigned_identity.api_id.principal_id
154-
}
15559
diff -Naur ../base/terraform/storage.tf terraform/storage.tf
15660
--- ../base/terraform/storage.tf 2022-08-10 10:15:54.000000000 +0100
15761
+++ terraform/storage.tf 2022-09-14 23:46:54.000000000 +0100

0 commit comments

Comments
 (0)