output "workstation_id" { description = "Connect with az network bastion ssh --target-resource-id ." value = azurerm_linux_virtual_machine.workstation.id } output "verify" { description = "Proof the workstation reaches evidence and nothing else, and that trying is noticed." value = <<-EOT Connect: az network bastion ssh --name bastion-forensics --resource-group rg-forensics --target-resource-id ${azurerm_linux_virtual_machine.workstation.id} --auth-type ssh-key --username analyst --ssh-key On the workstation: getent hosts .blob.core.windows.net # a ${local.endpoints_prefix} address: the private endpoint TOKEN=$(curl -s -H Metadata:true "http://169.254.169.254/metadata/identity/oauth2/token?api-version=2018-02-01&resource=https://storage.azure.com/" | python3 -c 'import json,sys; print(json.load(sys.stdin)["access_token"])') curl -s -H "Authorization: Bearer $TOKEN" -H "x-ms-version: 2021-08-06" "https://.blob.core.windows.net/?restype=container&comp=list" # lists the evidence curl -m 5 -sI https://example.com # times out After the first apply, wait until NTANetAnalytics has rows in the workspace before this drill. Then, within 25 minutes, the refused-connection alert emails ${join(", ", var.alert_emails)}. Create and then delete a diagnostic setting on a test resource: forensic-workstation-diagnostic-setting-written and forensic-workstation-diagnostic-setting-deleted follow. Remove one lock with terraform destroy -target='azurerm_management_lock.record["refused"]' (module.standard. in front in Hardened), then apply again: forensic-workstation-lock-deleted follows. In the workspace: MicrosoftAzureBastionAuditLogs | project TimeGenerated, UserName, TargetVMIPAddress EOT }