output "perimeter_id" { description = "The perimeter, for associations made elsewhere." value = azurerm_network_security_perimeter.data.id } output "profile_id" { description = "The profile resources join through." value = azurerm_network_security_perimeter_profile.data.id } output "verify" { description = "How to prove the perimeter works, and the policies with it." value = <<-EOT From an address outside allowed_ip_ranges, against any protected storage account: az storage blob list --account-name --container-name --auth-mode login ${var.access_mode == "Enforced" ? "Expect an authorization failure." : "In Learning mode the account's own firewall decides, and the log shows the request under NspPublicInboundResourceRulesAllowed or Denied."} ${local.log ? "In the workspace: NSPAccessLogs | summarize count() by Category | order by count_ desc. The access log can take up to 90 minutes to start after the first apply." : "Set log_analytics_workspace_id to see every refusal."} ${local.alert ? "Create and then delete a diagnostic setting on a test resource: data-perimeter-diagnostic-setting-written and data-perimeter-diagnostic-setting-deleted follow. Remove one lock with terraform destroy -target='azurerm_management_lock.alerts[\"refused\"]' (module.standard. in front in Hardened), then apply again: data-perimeter-lock-deleted follows.${local.same_subscription ? " Delete the rule's Log Analytics Reader assignment on the workspace, then apply again: data-perimeter-rule-access-removed follows." : " The workspace is in another subscription, so nothing here reports the rule's read access removed."}" : "Set alert_emails to be told of every refusal."} ${local.policy_mg || local.policy_sub ? "Under the policies: az storage account update --name --resource-group --allow-shared-key-access true is refused by policy data-perimeter." : "Set policy_management_group_id, or assign_policies_to_subscription, to refuse the storage settings that go around the perimeter."} EOT }