mitre-attack / attack-navigator

Web app that provides basic navigation and annotation of ATT&CK matrices
https://mitre-attack.github.io/attack-navigator
Apache License 2.0
2.01k stars 593 forks source link

"Cannot GET /" when deploying with Dockerfile. #574

Closed 0xShokz closed 1 year ago

0xShokz commented 1 year ago

Built an image using the directions in README. When running a container with the image, errors are displayed to the console followed by a message ** Angular Live Development Server is listening on 0.0.0.0:4200, open your browser on http://localhost:4200/ **.

When opening the URL in a browser, I get the following error: Cannot GET /

I saw a similar issue from pablo97dr previously, however I am not seeing the file watcher errors. I am getting this same result trying to build on Windows and on Ubuntu.

Log file attached

0xShokz commented 1 year ago

I noticed after a few minutes I received the file watcher limit errors on my Ubuntu machine. After applying the fix recommended (fs.inotify.max_user_watches=524288) and rebooting, the issue with "Cannot GET /" is still not resolved. I still have to forcefully stop the container.

jorgecastro2 commented 1 year ago

@0xShokz did you ever figure out the issue? Tried running the navigator locally and I'm also getting Cannot GET /

0xShokz commented 1 year ago

@0xShokz did you ever figure out the issue? Tried running the navigator locally and I'm also getting Cannot GET /

Unfortunately no, so far I have not identified a workaround to resolve the issue using the Dockerfile provided and recommended fixes.

FideliusFalcon commented 1 year ago

I was getting a lot of imports errors like:

Error: node_modules/@angular/material/paginator/paginator-module.d.ts:8:22 - error NG6002: Appears in the NgModule.imports of AppModule, but could not be resolved to an NgModule class.

And then I was thinking it could be a permission issue. I tried to run as root instead of node, and then I stopped getting the errors, and it worked. But of course this is not security best practice - Then I saw it changes the user to nodereally late in the Dockerfile - I tried to change it before the install packages and build and now it worked.

I have created a pull request for this - https://github.com/mitre-attack/attack-navigator/pull/576

mnyethecyberguy commented 1 year ago

This worked for me as well @FideliusFalcon . Its worth noting I was able to get the app working successfully by using a node container to build the app, and then copying the data over to an nginx alpine image. The size of the resulting image was substantially smaller at 114MB instead of 1.8GB. docker-attack-navigator

jorgecastro2 commented 1 year ago

@FideliusFalcon Modifying the Dockerfile worked for me. Thank you!

clemiller commented 1 year ago

The changes mentioned above have been staged on develop (https://github.com/mitre-attack/attack-navigator/pull/411) and will be included in the upcoming release next week. Thank you all for your discussion and to @FideliusFalcon for identifying a solution!