Installas Caldera Windows Agent on Linux Server
Hi there
I ran in other error by installing the Attack Range on a local Linux:
TASK [caldera_agent : Install Windows Agent [Caldera Agent]] ******************* fatal: [ar-linux-attack-range-key-pair-ar-0]: FAILED! => {"msg": "The conditional check 'caldera_server.caldera_server == "1" and linux_servers.install_caldera_agent == "1"' failed. The error was: error while evaluating conditional (caldera_server.caldera_server == "1" and linux_servers.install_caldera_agent == "1"): 'caldera_server' is undefined. 'caldera_server' is undefined\n\nThe error appears to be in '/.../attack_range/terraform/ansible/roles/caldera_agent/tasks/windows.yml': line 2, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n---\n- name: Install Windows Agent [Caldera Agent]\n ^ here\n"}
Looks like it tries to install/check the Windows Caldera Agent on the Linux server where caldera_server is not defined. Couldn't find the failure actually.
Many thanks for your help!
Greets Tom
Hi, I just built the attack range with the given configuration and didn't run into this issue. Can you share your attack_range.yml config?
I have the exact same error building the attack range in local environment. this is my attack_range.yml, which is a modified version of the attack_range_default.yml
general:
attack_range_password: "R4domP4ssw0rd"
# Attack Range Master Password for all accounts in Attack Range.
cloud_provider: "local"
# Cloud Provider: aws/azure/local
attack_range_name: "ar"
# Attack range Name let you build multiple Attack Ranges by changing this parameter.
ip_whitelist: "0.0.0.0/0"
# Blocks from which Attack Range machines can be reached.
# This allow comma-separated blocks
# ip_whitelist = 0.0.0.0/0,35.153.82.195/32
install_contentctl: "0"
# Install splunk/contentctl on linux servers
local:
provider: "Virtual Box"
# Attack Range Local used Virtualbox and Vagrant to build the Attack Range.
splunk_server:
s3_bucket_url: "https://attack-range-appbinaries.s3-us-west-2.amazonaws.com"
# S3 bucket containing the Splunk Apps which will be installed in Attack Range.
splunk_uf_url: "https://download.splunk.com/products/universalforwarder/releases/9.3.0/linux/splunkforwarder-9.3.0-51ccf43db5bd-linux-2.6-amd64.deb"
# Url to download Splunk Universal Forwarder Linux.
splunk_uf_win_url: "https://download.splunk.com/products/universalforwarder/releases/9.3.0/windows/splunkforwarder-9.3.0-51ccf43db5bd-x64-release.msi"
# Url to download Splunk Universal Forwarder Windows.
splunk_apps:
- TA-aurora-0.2.0.tar.gz
- TA-osquery.tar.gz
- app-for-circleci_011.tgz
- microsoft-defender-advanced-hunting-add-on-for-splunk_141.tgz
- punchcard---custom-visualization_150.tgz
- snort-3-json-alerts_105.tgz
- snort-alert-for-splunk_112.tgz
- splunk-add-on-for-microsoft-office-365_480.tgz
- splunk-add-on-for-microsoft-security_241.tgz
- splunk-add-on-for-microsoft-windows_901.tgz
- splunk-add-on-for-nginx_330.tgz
- splunk-add-on-for-sysmon-for-linux_100.tgz
- splunk-add-on-for-sysmon_402.tgz
- splunk-add-on-for-unix-and-linux_1000.tgz
- splunk-app-for-stream_813.tgz
- splunk-common-information-model-(cim)_602.tgz
- splunk-sankey-diagram---custom-visualization_160.tgz
- splunk-security-essentials_381.tgz
- splunk-ta-for-suricata_233.tgz
- splunk-timeline---custom-visualization_162.tgz
- splunk_attack_range_reporting-1.0.9.tar.gz
- status-indicator---custom-visualization_150.tgz
- ta-for-zeek_108.tgz
# List of Splunk Apps to install on the Splunk Server
windows_servers:
- hostname: ar-win-dc
# Define the hostname for the Windows Server.
windows_image: "windows-server-2019"
# Name of the image of the Windows Server.
# allowd values: windows-server-2016, windows-server-2019, windows-server-2022
create_domain: "1"
# Create Domain will turn this Windows Server into a Domain Controller. Enable by setting this to 1.
join_domain: "0"
# Join a domain by setting this to 1 or 0.
win_sysmon_config: "SwiftOnSecurity.xml"
# Specify a Sysmon config located under configs/ .
install_red_team_tools: "0"
# Install different read team tools by setting this to 1 or 0.
bad_blood: "1"
# Install Bad Blood by setting this to 1 or 0.
# More information in chapter Bad Blood under Attack Range Features.
install_caldera_agent: "1"
# Install a MITRE Caldera agent that connects to the Caldera Server.
aurora_agent: "0"
# Install Aurora Agent
advanced_logging: "0"
# Enable verbose windows security logs by setting this to 1.
linux_servers:
- hostname: ar-linux
# Define the hostname for the Linux Server.
sysmon_config: "SysMonLinux-CatchAll.xml"
# Specify a Sysmon config located under configs/ .
install_caldera_agent: "1"
# Install a MITRE Caldera agent that connects to the Caldera Server.
kali_server:
kali_server: "1"
# Enable Kali Server by setting this to 1.
nginx_server:
nginx_server: "1"
# Enable Nginx Server by setting this to 1.
hostname: "nginx"
# Specify the image used for Nginx Server.
proxy_server_ip: "10.0.1.12"
# Specify what ip to proxy.
proxy_server_port: "8000"
# Specify what port to proxy.
zeek_server:
zeek_server: "1"
# Enable Zeek Server by setting this to 1.
snort_server:
snort_server: "1"
# Enable Snort Server by setting this to 1.
caldera_server:
caldera_server: "1"
# Enable MITRE Caldera Server by setting this to 1.
hostname: "caldera"
# Specify the image used for Caldera Server.
# ------ Changing below this line could break MITRE Caldera -------------- #
caldera_version: ""
# MITRE Caldera Version to install (https://github.com/mitre/caldera/releases). Default: (left blank to pull latest) # caldera_version: "--branch 5.0.0"
go_version: "1.23.3"
# GO version to install (https://go.dev/dl/).
nvm_version: "0.40.1"
# NVM version to install (https://github.com/nvm-sh/nvm/releases).
node_version: "22"
# Node version to install (https://nodejs.org/en/download/package-manager).
upx_version: "4.2.4"
# UPX version to install (https://github.com/upx/upx/releases).
private_ip: "10.0.1.70"
# internal ip for the Caldera server (used for agent communication - no need to change).
simulation:
atomic_red_team_repo: redcanaryco
# Specify the repository owner for Atomic Red Team.
atomic_red_team_branch: master
# Specify the branch for Atomic Red Team.
with this configuration I'm able to build the Splunk server the Windows server and the Linux server until this error. I post also few lines before I received the error:
TASK [linux_install_art : debug] ***********************************************
ok: [ar-linux-attack-range-key-pair-ar-0] => {
"output_art.stdout_lines": [
"Installation of Invoke-AtomicRedTeam is complete. You can now use the Invoke-AtomicTest function",
"See Wiki at https://github.com/redcanaryco/invoke-atomicredteam/wiki for complete details"
]
}
TASK [linux_server_post : include_tasks] ***************************************
included: /home/alberto/attack_range/terraform/ansible/roles/linux_server_post/tasks/change_splunk_password.yml for ar-linux-attack-range-key-pair-ar-0
TASK [linux_server_post : change password splunk] ******************************
changed: [ar-linux-attack-range-key-pair-ar-0]
TASK [linux_server_post : Change hostname] *************************************
changed: [ar-linux-attack-range-key-pair-ar-0]
TASK [linux_server_post : Change servername] ***********************************
changed: [ar-linux-attack-range-key-pair-ar-0]
TASK [linux_server_post : Restart splunk uf] ***********************************
changed: [ar-linux-attack-range-key-pair-ar-0]
TASK [update_sysmon_config_linux : include_tasks] ******************************
skipping: [ar-linux-attack-range-key-pair-ar-0]
TASK [splunk_byo_linux : include_tasks] ****************************************
skipping: [ar-linux-attack-range-key-pair-ar-0]
TASK [contentctl : include_tasks] **********************************************
skipping: [ar-linux-attack-range-key-pair-ar-0]
TASK [contentctl : include_tasks] **********************************************
skipping: [ar-linux-attack-range-key-pair-ar-0]
TASK [crowdstrike_falcon_agent_linux : include_tasks] **************************
skipping: [ar-linux-attack-range-key-pair-ar-0]
TASK [cisco_secure_endpoint_linux : include_tasks] *****************************
skipping: [ar-linux-attack-range-key-pair-ar-0]
TASK [caldera_agent : Install Windows Agent [Caldera Agent]] *******************
I found some references in a old local repo
https://github.com/splunk/attack_range_local
Is it included in a new way? can i use old repo to port the local caldera implemenation?
After careful consideration, we have decided to deprecate Attack Range Local in a future release due to ongoing challenges with VirtualBox and Vagrant. We will release a Ludus environment template to build a Attack Range with Ludus. Ludus is a great cyber range to deploy cyber ranges locally.
Thank you, Ludus seem an interesting project.
I will try anyway to fix local provisiong since i like also your project. I will share any interesting update. Maybe i will do a PR. let's see.
Thank you man! Good Hack!