Skip to content
This repository was archived by the owner on Sep 12, 2025. It is now read-only.

Commit eabc130

Browse files
fix: DNS zone changes in hub
1 parent 23e761d commit eabc130

18 files changed

+127
-18
lines changed

.azuredevops/pipelines/cd-infrastructure-dev-audit.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ resources:
1414
- repository: dtos-devops-templates
1515
type: github
1616
name: NHSDigital/dtos-devops-templates
17-
ref: 57e204e15509e40243551dccfe077f3452a31369
17+
ref: 50b7be9a048ad75097a409251687d9b527780079
1818
endpoint: NHSDigital
1919

2020
variables:

.azuredevops/pipelines/cd-infrastructure-dev-core.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ resources:
1414
- repository: dtos-devops-templates
1515
type: github
1616
name: NHSDigital/dtos-devops-templates
17-
ref: 57e204e15509e40243551dccfe077f3452a31369
17+
ref: 50b7be9a048ad75097a409251687d9b527780079
1818
endpoint: NHSDigital
1919

2020
variables:

.azuredevops/pipelines/cd-infrastructure-int-audit.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ resources:
1414
- repository: dtos-devops-templates
1515
type: github
1616
name: NHSDigital/dtos-devops-templates
17-
ref: 57e204e15509e40243551dccfe077f3452a31369
17+
ref: 50b7be9a048ad75097a409251687d9b527780079
1818
endpoint: NHSDigital
1919

2020
variables:

.azuredevops/pipelines/cd-infrastructure-int-core.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ resources:
1414
- repository: dtos-devops-templates
1515
type: github
1616
name: NHSDigital/dtos-devops-templates
17-
ref: 57e204e15509e40243551dccfe077f3452a31369
17+
ref: 50b7be9a048ad75097a409251687d9b527780079
1818
endpoint: NHSDigital
1919

2020
variables:

.azuredevops/pipelines/cd-infrastructure-nft-audit.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ resources:
1414
- repository: dtos-devops-templates
1515
type: github
1616
name: NHSDigital/dtos-devops-templates
17-
ref: 57e204e15509e40243551dccfe077f3452a31369
17+
ref: 50b7be9a048ad75097a409251687d9b527780079
1818
endpoint: NHSDigital
1919

2020
variables:

.azuredevops/pipelines/cd-infrastructure-nft-core.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ resources:
1414
- repository: dtos-devops-templates
1515
type: github
1616
name: NHSDigital/dtos-devops-templates
17-
ref: 57e204e15509e40243551dccfe077f3452a31369
17+
ref: 50b7be9a048ad75097a409251687d9b527780079
1818
endpoint: NHSDigital
1919

2020
variables:
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
locals {
2+
#APPSERVICEPLAN
3+
monitor_diagnostic_setting_appserviceplan_metrics = ["AllMetrics"]
4+
5+
#FUNCTIONAPP
6+
monitor_diagnostic_setting_function_app_enabled_logs = ["AppServiceAuthenticationLogs", "FunctionAppLogs"]
7+
monitor_diagnostic_setting_function_app_metrics = ["AllMetrics"]
8+
9+
# KEYVAULT
10+
monitor_diagnostic_setting_keyvault_enabled_logs = ["AuditEvent", "AzurePolicyEvaluationDetails"]
11+
monitor_diagnostic_setting_keyvault_metrics = ["AllMetrics"]
12+
13+
# LOG ANALYTICS WORKSPACE
14+
monitor_diagnostic_setting_log_analytics_workspace_enabled_logs = ["SummaryLogs", "Audit"]
15+
monitor_diagnostic_setting_log_analytics_workspace_metrics = ["AllMetrics"]
16+
17+
#SQL SERVER AND DATABASE
18+
monitor_diagnostic_setting_database_enabled_logs = ["SQLSecurityAuditEvents", "SQLInsights", "QueryStoreWaitStatistics", "Errors", "DatabaseWaitStatistics", "Timeouts"]
19+
monitor_diagnostic_setting_database_metrics = ["AllMetrics"]
20+
monitor_diagnostic_setting_sql_server_enabled_logs = ["SQLSecurityAuditEvents"]
21+
monitor_diagnostic_setting_sql_server_metrics = ["AllMetrics"]
22+
23+
#STORAGE ACCOUNT
24+
monitor_diagnostic_setting_storage_account_enabled_logs = ["StorageWrite", "StorageRead", "StorageDelete"]
25+
26+
#SUBNET
27+
monitor_diagnostic_setting_network_security_group_enabled_logs = ["NetworkSecurityGroupEvent", "NetworkSecurityGroupRuleCounter"]
28+
29+
#VNET
30+
monitor_diagnostic_setting_vnet_enabled_logs = ["VMProtectionAlerts"]
31+
monitor_diagnostic_setting_vnet_metrics = ["AllMetrics"]
32+
}

infrastructure/tf-audit/log_analytics_workspace.tf

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,11 @@ module "log_analytics_workspace_audit" {
66
name = module.regions_config[each.key].names.log-analytics-workspace
77
location = each.key
88

9-
law_sku = var.law.law_sku
10-
retention_days = var.law.retention_days
9+
law_sku = var.law.law_sku
10+
retention_days = var.law.retention_days
11+
12+
monitor_diagnostic_setting_log_analytics_workspace_enabled_logs = local.monitor_diagnostic_setting_log_analytics_workspace_enabled_logs
13+
monitor_diagnostic_setting_log_analytics_workspace_metrics = local.monitor_diagnostic_setting_log_analytics_workspace_metrics
1114

1215
resource_group_name = azurerm_resource_group.audit[each.key].name
1316

infrastructure/tf-audit/networking.tf

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
locals {
2+
primary_region = [for k, v in var.regions : k if v.is_primary_region][0]
3+
}
4+
15
resource "azurerm_resource_group" "rg_vnet" {
26
for_each = var.regions
37

@@ -22,6 +26,10 @@ module "vnet" {
2226
location = each.key
2327
vnet_address_space = each.value.address_space
2428

29+
log_analytics_workspace_id = module.log_analytics_workspace_audit[local.primary_region].id
30+
monitor_diagnostic_setting_vnet_enabled_logs = local.monitor_diagnostic_setting_vnet_enabled_logs
31+
monitor_diagnostic_setting_vnet_metrics = local.monitor_diagnostic_setting_vnet_metrics
32+
2533
dns_servers = [data.terraform_remote_state.hub.outputs.private_dns_resolver_inbound_ips[each.key].private_dns_resolver_ip]
2634

2735
tags = var.tags
@@ -51,6 +59,9 @@ module "subnets" {
5159
service_delegation_name = each.value.service_delegation_name != null ? each.value.service_delegation_name : ""
5260
service_delegation_actions = each.value.service_delegation_actions != null ? each.value.service_delegation_actions : []
5361

62+
log_analytics_workspace_id = module.log_analytics_workspace_audit[local.primary_region].id
63+
monitor_diagnostic_setting_network_security_group_enabled_logs = local.monitor_diagnostic_setting_network_security_group_enabled_logs
64+
5465
tags = var.tags
5566
}
5667

infrastructure/tf-audit/private_link_scopes.tf

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,11 @@ module "private_link_scope" {
3939
# Private Endpoint Configuration if enabled
4040
private_endpoint_properties = var.features.private_endpoints_enabled ? {
4141
private_dns_zone_ids = [
42-
data.terraform_remote_state.hub.outputs.private_dns_zone_app_insight[each.key].private_dns_zone.id,
43-
data.terraform_remote_state.hub.outputs.private_dns_zone_azure_automation[each.key].private_dns_zone.id,
44-
data.terraform_remote_state.hub.outputs.private_dns_zone_od_insights[each.key].private_dns_zone.id,
45-
data.terraform_remote_state.hub.outputs.private_dns_zone_op_insights[each.key].private_dns_zone.id,
46-
data.terraform_remote_state.hub.outputs.private_dns_zone_storage_blob[each.key].private_dns_zone.id
42+
data.terraform_remote_state.hub.outputs.private_dns_zones["${each.key}-app_insights"].id,
43+
data.terraform_remote_state.hub.outputs.private_dns_zones["${each.key}-automation"].id,
44+
data.terraform_remote_state.hub.outputs.private_dns_zones["${each.key}-operations_data_store"].id,
45+
data.terraform_remote_state.hub.outputs.private_dns_zones["${each.key}-operations_management_suite"].id,
46+
data.terraform_remote_state.hub.outputs.private_dns_zones["${each.key}-storage_blob"].id
4747
]
4848
private_endpoint_enabled = var.features.private_endpoints_enabled
4949
private_endpoint_subnet_id = module.subnets["${module.regions_config[each.key].names.subnet}-pep"].id

0 commit comments

Comments
 (0)