ci: point SonarCloud analysis at the ASF project (apache/apache_caldera) (#3448)

* ci: point SonarCloud analysis at the ASF project (apache/apache_caldera)

Update sonar-project.properties and the Sonar workflows to use organization apache and project key apache_caldera (INFRA-28688), replacing the pre-donation mitre project. The scan needs a SONAR_TOKEN valid for the apache SonarCloud org.

* Apply suggestion from @HackedRico

* ci: read the SonarCloud token from SONARCLOUD_TOKEN

The scan step fails with HTTP 403 because SONAR_TOKEN is the repo secret from before the donation. The apache org token is shared with this repo as SONARCLOUD_TOKEN.

* Apply suggestion from @HackedRico

* ci: read SONARCLOUD_TOKEN in the fork PR scan

quality.yml reads the apache org token from SONARCLOUD_TOKEN. The fork PR scan still read SONAR_TOKEN, the repo secret from before the donation, which SonarCloud rejects with HTTP 403.

* Apply suggestion from @HackedRico

* Update SonarQube scan action to continue on error

Allow SonarQube scan to continue on error in workflow.

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Ricky Chen <124005584+HackedRico@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
3 files changed
tree: b812f90a352d0cff781f8443cbf26472f638c99a
  1. .github/
  2. app/
  3. conf/
  4. data/
  5. licenses/
  6. plugins/
  7. static/
  8. templates/
  9. tests/
  10. tools/
  11. .asf.yaml
  12. .coveragerc
  13. .dockerignore
  14. .eslintrc.js
  15. .flake8
  16. .gitignore
  17. .gitmodules
  18. .pre-commit-config.yaml
  19. .readthedocs.yaml
  20. .stylelintrc.json
  21. CITATION.cff
  22. CONTRIBUTING.md
  23. DISCLAIMER-WIP
  24. docker-compose.yml
  25. Dockerfile
  26. LICENSE
  27. NOTICE
  28. package-lock.json
  29. package.json
  30. README.md
  31. RELEASING.md
  32. requirements-dev.txt
  33. requirements-ldap.txt
  34. requirements.txt
  35. SECURITY.md
  36. server.py
  37. sonar-project.properties
  38. tox.ini
README.md

Release Testing Status Security Status codecov Documentation Status

Apache Caldera (Incubating)

Apache Caldera (Incubating) is a cyber security platform designed to easily automate adversary emulation, assist manual red-teams, and automate incident response.

It is built on the MITRE ATT&CK™ framework and was originally developed at MITRE.

The framework consists of two components:

  1. The core system. This is the framework code, consisting of what is available in this repository. Included is an asynchronous command-and-control (C2) server with a REST API and a web interface.
  2. Plugins. These repositories expand the core framework capabilities and providing additional functionality. Examples include agents, reporting, collections of TTPs and more.

Resources & Socials

Plugins

:star: Create your own plugin! Plugin generator: Skeleton :star:

Default

These plugins are supported and maintained by the Caldera team.

  • Access (red team initial access tools and techniques)
  • Atomic (Atomic Red Team project TTPs)
  • Builder (dynamically compile payloads)
  • Caldera for OT (ICS/OT capabilities for Caldera)
  • Compass (ATT&CK visualizations)
  • Debrief (operations insights)
  • Emu (CTID emulation plans)
  • Fieldmanual (documentation)
  • GameBoard (visualize joint red and blue operations)
  • Human (create simulated noise on an endpoint)
  • Magma (VueJS UI for Caldera v5)
  • Manx (shell functionality and reverse shell payloads)
  • Response (incident response)
  • Sandcat (default agent)
  • SSL (enable https for caldera)
  • Stockpile (technique and profile storehouse)
  • Training (certification and training course)

More

These plugins are ready to use but are not included by default and are not maintained by the Caldera team.

Requirements

These requirements are for the computer running the core framework:

  • Any Linux or MacOS
    • Python 3.11+ (with Pip3)
  • Recommended hardware to run on is 8GB+ RAM and 2+ CPUs
  • Recommended: GoLang 1.24+ to dynamically compile GoLang-based agents.
  • NodeJS (v16+ recommended for v5 VueJS UI)

Installation

Note: we HIGHLY recommend installing Caldera in a Python virtual environment to avoid issues with pip packages. You can use an existing environment if you wish or create a new one from scratch:

python3 -m venv .calderavenv
source .calderavenv/bin/activate

Concise installation steps:

git clone https://github.com/apache/caldera.git --recursive
cd caldera
pip3 install -r requirements.txt
pip3 install -r plugins/debrief/requirements.txt  # the debrief plugin, enabled by default
python3 server.py --insecure --build

Full steps: Start by cloning this repository recursively, passing the desired version/release in x.x.x format. This will pull in all available plugins.

git clone https://github.com/apache/caldera.git --recursive --branch x.x.x

If you start from the source release archive (apache-caldera-x.x.x-incubating-src.tar.gz) instead of a clone, note that it holds the core framework only. The plugin directories in it are empty, and the server needs the plugins to start. The file plugin-revisions.txt in the archive lists the repository and the exact commit of each plugin for that release. To fetch them, run this in the top directory of the unpacked archive:

grep -v '^#' plugin-revisions.txt | while read -r path commit url; do
    if [ ! -d "$path/.git" ]; then
        git clone "$url" "$path" || exit 1
    fi
    git -C "$path" checkout --detach "$commit" || exit 1
done

If a plugin cannot be fetched, the loop stops with an error. Run it again to continue: plugins that were already cloned are reused. The recursive clone of the same version gives the same plugin commits.

Next, install the PIP requirements:

pip3 install -r requirements.txt

LDAP login is optional. To use it, also install the LDAP requirements, which are kept in a separate file because the ldap3 package is licensed under the LGPL 3.0:

pip3 install -r requirements-ldap.txt

Some plugins have their own requirements.txt. Install it for each one you enable. The debrief plugin is enabled by default and does not load without its requirements:

pip3 install -r plugins/debrief/requirements.txt

This installs svglib, which draws the graphs in debrief's PDF reports and is licensed under the LGPL 3.0.

These commands apply to an installation on the host. The Docker images include neither ldap3 nor svglib. See Docker Installation for how to add them to an image.

Finally, start the server.

python3 server.py --insecure --build

The --build flag automatically installs any VueJS UI dependencies, bundles the UI into a dist directory and is served by the Caldera server. You will only have to use the --build flag again if you add any plugins or make any changes to the UI. Once started, log into http://localhost:8888 using the default credentials red/admin. Then go into Plugins -> Training and complete the capture-the-flag style training course to learn how to use Caldera.

If you prefer to not use the new VueJS UI, revert to Caldera v4.2.0. Correspondingly, do not use the --build flag for earlier versions as not required.

Additionally, please note security recommendations for deploying Caldera.

Docker Installation

Local build:

git clone https://github.com/apache/caldera.git --recursive
cd caldera
docker build --build-arg VARIANT=full -t caldera .
docker run -it -p 8888:8888 caldera

Adjust the port forwarding (-p) and build args (--build-arg) as desired to make ports accessible or change the Caldera variant. The ports that you expose depend on which contacts you plan on using (see Dockerfile and docker-compose.yml for reference).

Pre-Built Image (from GitHub Container Registry):

docker run -p 8888:8888 ghcr.io/apache/caldera:latest

This container may be slightly outdated, we recommend building the container yourself.

To gracefully terminate your docker container, do the following:

# Find the container ID for your docker container running Caldera
docker ps

# Stop the container
docker stop <container ID>

There are two variants available, full and slim. The slim variant doesn't include files necessary for the emu and atomic plugins, which will be downloaded on-demand if the plugins are ever enabled. The full variant is suitable for operation in environments without an internet connection. Slim images on GHCR are prefixed with “slim”.

The Docker images of version 5.4.0 and later leave out two packages that are licensed under the LGPL 3.0: ldap3, which LDAP login needs, and svglib, which draws the graphs in the PDF reports of the debrief plugin. Without svglib, debrief still builds PDF reports, with a note in place of each graph. Installing those packages on the host does not add them to a container. To use these features with Docker, build your own image on top of a Caldera image and install the files you need. Both files are in the image's working directory, /usr/src/app. Save the following as Dockerfile.extended, keeping only the lines you need:

FROM ghcr.io/apache/caldera:latest
# LDAP login
RUN pip3 install --break-system-packages --no-cache-dir -r requirements-ldap.txt
# Graphs in the PDF reports of the debrief plugin
RUN pip3 install --break-system-packages --no-cache-dir -r plugins/debrief/requirements.txt

Then build and run it:

docker build -t caldera-extended -f Dockerfile.extended .
docker run -it -p 8888:8888 caldera-extended

To extend an image that you built locally, use its name in the FROM line, for example FROM caldera.

Docker Container Notes

  • The Caldera container will automatically generate keys/usernames/password on first start.
  • If you wish to override the default configuration or avoid automatically generated keys/passwords, consider bind-mounting your own configuration file with the -v <your_path>/conf.yml:/usr/src/app/conf/local.yml flag.
  • Data stored by Caldera is ephemeral by default. If you wish to make it persistent, use docker volumes and/or bind mounts (-v <path_to_your_data_or_volume_name>:/usr/src/app/data/). Ensure that the directory structure is the same as in the data/ directory on GitHub, as Caldera will refuse to create these sub-directories if they are missing. Lastly, make sure that the configuration file is also made persistent to prevent issues with encryption keys.
  • The builder plugin will not work within Docker.
  • If you wish to modify data used by the atomic plugin, clone the Atomic Red Team repository outside the container, apply your modifications and bind-mount it (-v) to /usr/src/app/plugins/atomic/data/atomic-red-team within the container.
  • If you wish to modify data used by emu, clone the adversary_emulation_library repository locally and bind-mount it (-v) to /usr/src/app/plugins/emu/data/adversary-emulation-plans.

Additionally, please note security recommendations for deploying Caldera.

User Interface Development

If you'll be developing the UI, there are a few more additional installation steps.

Requirements

  • NodeJS (v16+ recommended)

Setup

  1. Add the Magma submodule if you haven't already: git submodule add https://github.com/mitre/magma
  2. Install NodeJS dependencies: cd plugins/magma && npm install && cd ..
  3. Start the Caldera server with an additional flag: python3 server.py --uidev localhost

Your Caldera server is available at http://localhost:8888 as usual, but there will now be a hot-reloading development server for the VueJS front-end available at http://localhost:3000. Both logs from the server and the front-end will display in the terminal you launched the server from.

Security

The Caldera team highly reccommends standing up the Caldera server on a secure environment/network, and not exposing it to the internet. The Caldera server does not have a hardened and thoroughly pentested web application interface, but only basic authentication and security features. Both MITRE and MITRE‘s US Government sponsors nearly exclusively only use Caldera on secure environments and do not rely on Caldera’s own security protocols for proper cyber security.

Vulnerability Disclosures

To report a security issue, see SECURITY.md. Apache Caldera follows the Apache Software Foundation security process. Please do not report security issues in public GitHub issues.

Recent Vulnerability Disclosures

🚨Security Notice🚨: (17 Feb 2025 10:00 EST) Please pull v5.1.0+ for a recent security patch for CVE-2025-27364. Please update your Caldera instance, especially if you host Caldera on a publicly accessible network. Vulnerability walkthrough.

Contributing

Refer to our contributor documentation.

Disclaimer

Apache Caldera (incubating) is an effort undergoing incubation at The Apache Software Foundation (ASF), sponsored by the Apache Incubator. Incubation is required of all newly accepted projects until a further review indicates that the infrastructure, communications, and decision-making process have stabilized in a manner consistent with other successful ASF projects. While incubation status is not necessarily a reflection of the completeness or stability of the code, it does indicate that the project has yet to be fully endorsed by the ASF.

See the DISCLAIMER-WIP file for the full disclaimer and the list of known issues.