-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Have server.py automatically configure Magma .env when build flag set #2977
Conversation
Tested successfully on Ubuntu on Chrome and Firefox. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks @djlawren
Looks like this PR broke my tool that uses Caldera with remote hosting on AWS EC2 instance. I'm getting a similar error that I received before on #2885 Was this tested on Caldera running on non-localhost or was it tested only on localhost? |
I did test before merging with remote hosting on a cloud VM, with port 8888 on the remote VM forwarded to localhost. To make it work with these changes, I had to change the The changes set the URL that the Vue UI sends requests to from the host and port values of the Caldera config. With the default values in the Caldera config the UI will attempt to send requests to We added a corresponding paragraph to the documentation to note the required remediation: https://caldera.readthedocs.io/en/latest/Server-Configuration.html#configuration-file If this doesn't get towards addressing the issue for you, I'm happy to continue the discussion on fixing this problem in a way that supports remote hosting more generally. |
Thanks for the details @djlawren . What about TLS support with this new PR? Did you test this out and what are users to do if they want to run magma with SSL support? I see what it is doing now and I"m able to build and run with http and port 8888. However, my system was built for SSL on port 8443. It looks here like your --build with server.py is hard-coding to build the Would be good to have an option to make this configurable for https or http just like host and port variables on local.yml. https://github.com/mitre/caldera/blob/master/server.py#L155 Cc @prcabral |
Description
These changes modify
server.py
to set the contents of./plugins/magma/.env
when--build
is used. The contents of Magma'sVITE_CALDERA_URL
environment variable is set to thehost
andport
values set in the Caldera config.A discrepancy between the URL used by Magma's router and the location of the Caldera server was noted as the cause of multiple issues: #2901, #2944, #2955
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
The change was manually verified by starting the Caldera server and noting through browser developer tools that the URL used for Caldera's requests changed when the Caldera config values changed, and the UI was rebuilt.
It should be noted that the inciting bug was still present the first time I tested. In testing, I used Caldera by running on a cloud VM and port forwarding to my local machine. The Caldera config's default host value of
0.0.0.0
caused the login screen to be impassable. In my specific situation, I had to change the config's host value tolocalhost
or the VM's domain name to get past the login screen.Checklist: