From b2941bc7b12956e3c61ec0cae70869a148e9c547 Mon Sep 17 00:00:00 2001 From: Gerben Kleijn Date: Mon, 16 Feb 2026 13:54:58 -0700 Subject: [PATCH] Minor changes to deployment output and files --- .../data/jump-host-template.json | 1 + .../image-inationcontinuation.tf | 4 + azure/main.tf | 116 +++++++++++------- 3 files changed, 76 insertions(+), 45 deletions(-) diff --git a/azure/challenges/Cloud Jumping/data/jump-host-template.json b/azure/challenges/Cloud Jumping/data/jump-host-template.json index e21ceeb..2361004 100644 --- a/azure/challenges/Cloud Jumping/data/jump-host-template.json +++ b/azure/challenges/Cloud Jumping/data/jump-host-template.json @@ -267,6 +267,7 @@ "storageProfile": { "osDisk": { "createOption": "FromImage", + "deleteOption": "Delete", "managedDisk": { "storageAccountType": "[variables('osDiskType')]" } diff --git a/azure/challenges/Image-ination Continuation/image-inationcontinuation.tf b/azure/challenges/Image-ination Continuation/image-inationcontinuation.tf index 799b1f9..110af74 100644 --- a/azure/challenges/Image-ination Continuation/image-inationcontinuation.tf +++ b/azure/challenges/Image-ination Continuation/image-inationcontinuation.tf @@ -31,6 +31,8 @@ resource "azurerm_key_vault_secret" "flag" { name = "flag" value = "Flag{imageinationContinuation:protectThoseServicePrincipalCreds}" key_vault_id = azurerm_key_vault.ctf.id + + depends_on = [azurerm_role_assignment.kv_admin] } # create an identity for the logic app @@ -117,6 +119,8 @@ resource "azurerm_role_assignment" "kv_admin" { scope = azurerm_key_vault.ctf.id } + + # get the logic app identity and store in a local file resource "null_resource" "get_logicapp_identity" { provisioner "local-exec" { diff --git a/azure/main.tf b/azure/main.tf index 960dfb4..7b7feed 100644 --- a/azure/main.tf +++ b/azure/main.tf @@ -94,55 +94,81 @@ module "challenge_cloudjumping" { } locals { - enabled_challenges = compact([ - var.notsosecret_enabled ? "Not So Secret (~$0.01/month)" : "", - var.permisery_enabled ? "Permisery (~$0/month)" : "", - var.imageination_enabled ? "Image-ination Challenges (~$5/month)" : "", - var.vmiam_enabled ? "VM I Am (~$15/month)" : "", - var.cloudjumping_enabled ? "Cloud Jumping (~$15/month)" : "" - ]) + challenge_catalog = [ + { + enabled = var.notsosecret_enabled + name = "Not So Secret" + cost = "~$0.01/month" + }, + { + enabled = var.permisery_enabled + name = "Permisery" + cost = "~$0/month" + }, + { + enabled = var.imageination_enabled + name = "Image-ination" + cost = "~$5/month" + }, + { + enabled = var.vmiam_enabled + name = "VM I Am" + cost = "~$15/month" + }, + { + enabled = var.cloudjumping_enabled + name = "Cloud Jumping" + cost = "~$15/month" + } + ] + + enabled_challenges = [ + for c in local.challenge_catalog : + format("| | %-31s | %-12s |", c.name, c.cost) + if c.enabled + ] } output "Next_Steps" { value = < 0 ? join("\n| | ", local.enabled_challenges) : "None"} - | +------------------------------------------------+ - | - +--------- - EOT ++--------- +| +| +---------------------------------------------------------------------------------------------+ +| | Deployment Information: | +| | | +| | CloudFoxable deployed to: Subscription ${data.azurerm_client_config.current.subscription_id}| +| | Tenant ${data.azurerm_client_config.current.tenant_id} | +| | Scoreboard URL: https://cloudfoxable.bishopfox.com | +| | CTF Starting User: Willem | +| | Credentials: cat credentials.txt | +| +---------------------------------------------------------------------------------------------+ +| +| Next steps: +| +| 1. Access the credentials for your CTF user: +| +| cat credentials.txt +| +| 2. Logout your admin user: +| +| az logout +| +| 3. Verify your CTF user's credentials are working: +| +| az login +| +| 3. Head back to https://cloudfoxable.bishopfox.com and complete the first Azure challenge! +| +| You'll need this: FLAG{congrats_you_set_up_Terraform_with_Azure} +| +| +---------------------------------+---------------+ +| | Currently Enabled Challenges | Cost/Month | +| +---------------------------------+---------------+ +${length(local.enabled_challenges) > 0 ? join("\n", local.enabled_challenges) : "| None | |"} +| +-------------------------------------------------+ +| ++--------- +EOT } locals {