Error on attack_range.py build
Just pulled the latest image earlier today, when trying to run an attack range build I get this:
Error: Reference to undeclared input variable │ │ on modules/windows/resources.tf line 108, in resource "azurerm_virtual_machine" "windows": │ 108: "caldera_server": ${jsonencode(var.caldera_server)}, │ │ An input variable with the name "caldera_server" has not been declared. This variable can be declared with a variable "caldera_server" {} block.
This is my attack_range.yml file: general: cloud_provider: azure attack_range_password: key_name: root-46081 ip_whitelist: attack_range_name: VR-AttackRange azure: subscription_id: private_key_path: /attack_range/root-46081.key public_key_path: /attack_range/root-46081.pub location: North Central US windows_servers:
- hostname: ar-win-dc windows_image: windows-server-2022 create_domain: '1' install_red_team_tools: '1' bad_blood: '1' linux_servers:
- hostname: ar-linux
This should be fixed. Can you try it again with the latest develop branch?
The error still persists with the latest update.
@P4T12ICK - I still get the same error, should the variable caldera_server be defined in /terraform/azure/modules/windows/variable.tf instead of where you added it to terraform/azure/variable.tf?
I have added variable "caldera_server" { } to /terraform/azure/modules/windows/variable.tf and now got this error.
But no idea what I'm doing never worked with terraform.
│ Error: Missing required argument │ │ on ressources.tf line 34, in module "windows-server": │ 34: module "windows-server" { │ │ The argument "caldera_server" is required, but no definition was found.
When I removed line 105 of /terraform/azure/modules/windows/resources.tf "caldera_server": ${jsonencode(var.caldera_server)}, the deployment went further but did not deploy all my VMs (I think some other error).
I switched to AWS and saw that a lot more stuff is available (like caldera, nginx, snort and zeek), it should be in the manual that the full stack is only available with AWS. Also it was a lot quicker and worker directy on the first try.
I think it was no intended to have caldera in Azure at the moment because there is no module in https://github.com/splunk/attack_range/tree/develop/terraform/azure/modules.
@rew822 - interesting observation, thanks for the insight. Guess I might just have to wait till they get the Azure stuff all sorted. Disappointing since they removed the ability to deploy on-prem and only support public cloud providers which is why our security team was asking to get this spun up in Azure.
I will take a look into this issue.
As this is an open source project, it's hard to always keep all features on all cloud platforms. The on-prem option is Ludus Attack Range. https://docs.ludus.cloud/docs/environment-guides/splunk-attack-range/