Using the emu plugin for CALDERA makes it easy, but it is not obvious how it works. The high level process is as follows:
NOTE: CALDERA 4.0.0-beta was used for the following instructions. Not tested on other versions.
NOTE: Assumes user has setup Vagrant and Virtualbox. Vagrant provides a straightforward workflow to create a reusable, repeatable environment shareable by vagrant users.
Within the cloud-analytics/emulation/caldera-vagrant/
directory, of the Cloud Analytics project, there is a vagrant configuration which will install CALDERA from scratch on a new virtual machine instance.
-
Open a terminal window, and change to the
caldera-vagrant
directory:cd ./cloud-analytics/emulation/caldera-vagrant/
-
Run
vagrant up
to initialize the vagrant environment. How long this takes is highly dependent on your network connection. Vagrant will first perform a one-time download of the base box,ubuntu/focal64
, and then provision the VM by installing and configuring CALDERA. -
Once CALDERA is fully provisioned, you should see a banner similar to the following, with a URL to connect to the Caldera web interface.
-
NOTE: Due to a quirk in the CALDERA 4.x beta, after vagrant is complete and the system boots up, you should wait approximately 3 minutes, then run
vagrant reload
from your host system to restart. Otherwise, Caldera may hang on plugin initialization and not fully startup the web interface. After waiting a few minutes and runningvagrant reload
, Caldera should properly start on all startups going forward. If you encounter aERR_CONNECTION_REFUSED
in your browser, you have encountered this issue. Just runvagrant reload
and the problem should be permanently fixed going forward.``` ########################################################### # # # # # # # # # Connect to CALDERA at http://192.168.56.24:8888 # # # # # # # # ########################################################### ```
-
-
Open a web browser and connect to CALDERA at the URL specified in the terminal, as shown in the previous step. You should see a login screen similar to the following.
-
Login with the default credentials
-
username: red password: admin
-
The CALDERA server application will act as the emulation controller, however we need Caldera Agents to perform the actual executions. In this example, we will deploy a Windows VM using Vagrant. The Windows instance will use a temporary evaluation license by default. Make sure this meets your organizational licensing requirements or install an appropriate license as needed.
- Open a separate terminal, and navigate to the
cloud-analytics/emulation/caldera-win-agent-1
directory. - Run
vagrant up
- After the Windows system is fully booted, continue with the next section to add the Windows system as a CALDERA agent.
- Within CALDERA, navigate to the
Campaigns -> agents
section. - Click the
Deploy an Agent
button. - Select
Sandcat
from the dropdown menu. - Select
windows
underPlatform
. - Edit the
app.contact.http
setting fromhttp://0.0.0.0:8888
to the URL printed out earlier on the terminal when CALDERA started up. In the earlier example, the URL ishttp://192.168.56.24:8888
. 1. - Copy the PowerShell code from the first section, with the title of
CALDERA's default agent, written in GoLang.
- Create a new file in the
caldera-win-agent-1
directory, titledcalderaSetup.ps1
. That directory should now have two files,Vagrantfile
andcalderaSetup.ps1
. - Open a GUI console session to the Windows VM.
- Open the Virtualbox application.
- Look in the list of VMs for a name that begins with
caldera-win-agent-1-
. Vagrant appends additional characters to the name, but you only have to match the initial section. - Select the VM on the left with a single click.
- Click the green
Show
button in the toolbar in the top right. - You should be logged in to a Windows VM. Use the Virtualbox -> View menu if you need to modify the display settings.
- If needed, the default Windows username and password are
vagrant
andvagrant
, respectively.
- From within the Windows guest, from the Start Menu, open the
Windows Powershell ISE
application as an Administrator. - Select
File -> Open
from the menu, and navigate toC:\vagrant\
. - Open the file
calderaSetup.ps1
. - Click the
Play
icon to run the script. - Windows Firewall will generate a notification due to the network access. For the Windows Firewall prompt, check both boxes and click
Allow Access
. - Navigate back to the
CALDERA
agents webpage on your host computer, and the new Windows agent should show in theAgents
list.
Make sure the emu plugin is enabled within CALDERA. If not, navigate to Configuration -> configuration-> Plugins, and enable the emu plugin, and restart Caldera. When enabled, you should see emu
on the left side menu.
NOTE: If you are using the Vagrant CALDERA setup installed earlier, read the following:
- You can ssh to the CALDERA instance by
cd cloud-analytics/emulation/caldera-vagrant
, then runningvagrant ssh
. - To copy the adversary emulation plan, copy the
aep1-package-caldera.tar.gz
package to the vagrant directory. For example,cp cloud-analytics/emulation/aep1-package-caldera.tar.gz cloud-analytics/emulation/caldera-vagrant/
.
- On the command line on the CALDERA system, navigate to the following directory (
CALDERA_HOME
denotes the home directory of the Caldera installation. For vagrant users,CALDERA_HOME=/home/vagrant/caldera
).cd CALDERA_HOME/plugins/emu/data/adversary-emulation-plans
- Copy the attached file to the CALDERA system, and decompress while in the directory in the previous step.
tar -zxvf /path/to/aep1-package-caldera.tar.gz
- Vagrant users: If you followed the steps at the beginning of this section, you can run
tar -zxvf /vagrant/aep1-package-caldera.tar.gz
.
- The resulting directory layout should look similar to the following:
Alternatively, you can manually recreate the same structure.
cd CALDERA_HOME/plugins/emu/data/adversary-emulation-plans
mkdir -p aep{1,-gcp1}/Emulation_Plan/yaml/
cp /path/to/aep1.yaml ./aep1/Emulation_Plan/yaml/
cp /path/to/aep-gcp1.yaml ./aep-gcp1/Emulation_Plan/yaml/
After completing one of the above versions, restart CALDERA. If using vagrant, run either sudo systemctl restart caldera.service
from the vagrant ssh command line interface, or run vagrant reload
from your host system.
NOTE: The Cloud Analytics adversary names are currently CAP, short for Cloud Analytics Project, and CAPGCP, Cloud Analytics Project Google Cloud Platform.
Within CALDERA, Adversary Profiles allow for collecting ATT&CK TTPs for a specific effect or scenario, such as an offensive or defensive scenario.
To validate the CAP profile is setup, within the CALDERA web interface, navigate to Plugins -> emu -> Adversaries -> Select a profile -> CAP.
A screen similar to the following should be displayed.
Within CALDERA, Fact Sources allow for using variables within an execution plan. Multiple fact source configurations can be setup for a profile, such as a fact source for the test environment. Along with Adversary Profiles, Fact Sources allow for executing predefined scenarios customized to a particular environment.
To validate the CAP Adversary Fact Source has been setup, within the CALDERA web interface, navigate to Configuration -> fact sources -> Select a source -> CAP.
A screen similar to the following should be displayed.
For Google Cloud, perform the following setup steps prior to running the adversary emulation plan.
- Setup a service account with appropriate permissions by following the Google Cloud documentation.
- Save the service account key file as
key.json
within thecaldera-win-agent-1
directory,cloud-analytics/emulation/caldera-win-agent-1/key.json
.- [Optional] If you used a different filename other than
key.json
, update within CALDERAFACTS
section, set theidentity.gcloud.key
value just the base filename. For example, if you usedsa.json
instead ofkey.json
, set the fact tosa.json
. Do not include the filepath.
- [Optional] If you used a different filename other than
- Set the
identity.gcloud.account
variable to the Google Cloud service account name, such as[email protected]
. - NOTE: It is strongly recommended to pre-install the gcloud CLI on the Windows agent prior to executing the GCP Adversary Emulation Plan, as it may timeout when run via CALDERA depending on available system resources. Reboot the Windows agent after installing the gcloud CLI.
- Official CALDERA documentation: https://caldera.mitre.org/