Comments (6)
I'm not sure its related but I'm running into 500's on /api/v2/health
and the login page isn't shown or is unresponsive.
will investigate
from caldera.
PR included, docker builds fine now, and caldera boots up as expected 🎉
from caldera.
It does (need to be updated). We were allowing for a slight delay to make sure Magma was stable before updating the dockerfile. But I see you PR and it looks good. I will try to test it ASAP.
from caldera.
Are you setting the cookie in the API request?
I only get 500s if I dont set the cookie.
from caldera.
I've pulled the latest commit on the master (08c64d3), checked out the master branch and built with docker-compose build
, but I still have the same error:
caldera_1 | 2024-03-13 08:52:02 INFO Docs built successfully. hook.py:58
caldera_1 | Traceback (most recent call last):
caldera_1 | File "/opt/venv/caldera/lib/python3.11/site-packages/aiohttp/web_urldispatcher.py", line 561, in __init__
caldera_1 | raise ValueError("Not a directory")
caldera_1 | ValueError: Not a directory
caldera_1 |
caldera_1 | The above exception was the direct cause of the following exception:
caldera_1 |
caldera_1 | Traceback (most recent call last):
caldera_1 | File "/usr/src/app/server.py", line 281, in <module>
caldera_1 | run_tasks(services=app_svc.get_services(), run_vue_server=args.uiDevHost)
caldera_1 | File "/usr/src/app/server.py", line 89, in run_tasks
caldera_1 | loop.run_until_complete(RestApi(services).enable())
caldera_1 | File "/usr/lib/python3.11/asyncio/base_events.py", line 653, in run_until_complete
caldera_1 | return future.result()
caldera_1 | ^^^^^^^^^^^^^^^
caldera_1 | File "/usr/src/app/app/api/rest_api.py", line 32, in enable
caldera_1 | self.app_svc.application.router.add_static('/assets', 'plugins/magma/dist/assets/', append_version=True)
caldera_1 | File "/opt/venv/caldera/lib/python3.11/site-packages/aiohttp/web_urldispatcher.py", line 1136, in add_static
caldera_1 | resource = StaticResource(
caldera_1 | ^^^^^^^^^^^^^^^
caldera_1 | File "/opt/venv/caldera/lib/python3.11/site-packages/aiohttp/web_urldispatcher.py", line 563, in __init__
caldera_1 | raise ValueError(f"No directory exists at '{directory}'") from error
caldera_1 | ValueError: No directory exists at '/usr/src/app/plugins/magma/dist/assets'
from caldera.
I've pulled the latest commit on the master (08c64d3), checked out the master branch and built with
docker-compose build
, but I still have the same error:caldera_1 | 2024-03-13 08:52:02 INFO Docs built successfully. hook.py:58 caldera_1 | Traceback (most recent call last): caldera_1 | File "/opt/venv/caldera/lib/python3.11/site-packages/aiohttp/web_urldispatcher.py", line 561, in __init__ caldera_1 | raise ValueError("Not a directory") caldera_1 | ValueError: Not a directory caldera_1 | caldera_1 | The above exception was the direct cause of the following exception: caldera_1 | caldera_1 | Traceback (most recent call last): caldera_1 | File "/usr/src/app/server.py", line 281, in <module> caldera_1 | run_tasks(services=app_svc.get_services(), run_vue_server=args.uiDevHost) caldera_1 | File "/usr/src/app/server.py", line 89, in run_tasks caldera_1 | loop.run_until_complete(RestApi(services).enable()) caldera_1 | File "/usr/lib/python3.11/asyncio/base_events.py", line 653, in run_until_complete caldera_1 | return future.result() caldera_1 | ^^^^^^^^^^^^^^^ caldera_1 | File "/usr/src/app/app/api/rest_api.py", line 32, in enable caldera_1 | self.app_svc.application.router.add_static('/assets', 'plugins/magma/dist/assets/', append_version=True) caldera_1 | File "/opt/venv/caldera/lib/python3.11/site-packages/aiohttp/web_urldispatcher.py", line 1136, in add_static caldera_1 | resource = StaticResource( caldera_1 | ^^^^^^^^^^^^^^^ caldera_1 | File "/opt/venv/caldera/lib/python3.11/site-packages/aiohttp/web_urldispatcher.py", line 563, in __init__ caldera_1 | raise ValueError(f"No directory exists at '{directory}'") from error caldera_1 | ValueError: No directory exists at '/usr/src/app/plugins/magma/dist/assets'
Hi there, I was having the same problem starting the docker-compose file and I identified the problem with the volume mount referenced in the docker-compose file, I created a workaround for those that want to use the caldera's git folder as the containers /usr/src/app folder:
The problem I identified is that the docker-compose file, uses the current dir, supposedly the caldera's git folder, as its app folder:
volumes:
- ./:/usr/src/app
Now the problem with the latest build of the Docker file (f9b0ed2) is that it is using the /usr/src/app folder to install the magma plugin and when a new container is started with the volume mounted like in the docker-compose file, the contents of the plugins/magma/ folder get overridden with the default files of caldera's git folder.
My workaround was to create a ubuntu container with the caldera's github folder mounted inside it, run the instructions of the Dockerfile pertaining the magma plugin installation and thus achieve a permanent plugin installation.
First we create the fix file in the caldera's git folder, fix.sh:
#!/bin/sh
cd /app && \
apt-get update && \
apt-get install -y nodejs npm && \
# Directly use npm to install dependencies and build the application
(cd plugins/magma && npm install) && \
(cd plugins/magma && npm run build) && \
# Remove Node.js, npm, and other unnecessary packages
apt-get remove -y nodejs npm && \
apt-get autoremove -y && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
now save it and then give it execution permissions:
chmod +x fix.sh
now we create a temporary ubuntu docker container with the caldera folder mounted inside in /app path, and execute the fix.sh script:
docker run --rm -v $PWD:/app ubuntu:23.04 ./app/fix.sh
# --rm - remove the container once it is done
# -v mount the current directory ($PWD) in /app inside the container
now the files in plugins/magma/dist folder should be present and we can start the docker-compose project:
docker-compose up
A big thank you to the people developing this great project!
Update: included the "cd /app" line to the fix
from caldera.
Related Issues (20)
- Docker image (ghcr.io/mitre/caldera:5.0.0) does not contain Magma (dist) build files HOT 4
- FileNotFoundError: [WinError 2] Le fichier spécifié est introuvable HOT 2
- Unable to change agent group name or set agent group in WebUI . HOT 2
- psh executor for Windows agent not working HOT 4
- Not able to login HOT 13
- Attempting to achieve lateral movement using sandcat agent and metasploit HOT 3
- No review command button during empty operation Training Module HOT 5
- Wrong time format in event logs of operations HOT 1
- caldera-ot plugins apear on dashboard but when start operation don't work or apeare on operation or they don't execute? HOT 2
- Encoding error when approving link during manual operation HOT 1
- Confusion between obfuscated command and edited command in manual operations HOT 1
- fact_store's lifecycle? HOT 3
- Custom abilities do not support requirement definitions using stockpile basic parser HOT 14
- Agent communicates with base64 obfuscation despites different operation settings HOT 6
- install v5.0.0 error HOT 7
- Caldera and engage HOT 1
- Grap SVG error and extreme network utilization from console HOT 3
- Can not login to caldera 5.0 HOT 10
- Abilities' changes in adversaries' views are not updated consistlently, leading to potential loss HOT 1
- Atomic Red Team plug-in failing to load when starting Caldera HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from caldera.