e-m-b-a / embark

EMBArk - The firmware security scanning environment
https://www.securefirmware.de
MIT License
314 stars 46 forks source link

Wantes to access dashboard via ip from remote host within same network #66

Closed senthilkumarmoorthy closed 1 year ago

senthilkumarmoorthy commented 1 year ago

Hello, I deployed EMBA first and realized that I need a dashboard also so I deployed embark and this is in the esx server running a VM with Ubuntu Server 22.04.

I added 10.x.x.x embark.local embark.local 10.x.x.x in /etc/hosts

edited /var/www/httpd80/httpd.conf and added ip under redirect permanent but still I couldn’t access the dashboard using http://10.x.x.x:80 within being in the same network.

Please advise.

BenediktMKuehne commented 1 year ago

Hi, did you try using http://embark.local ?

BenediktMKuehne commented 1 year ago

The requests send to the server have to match the servername. (run-server.sh line 205)

senthilkumarmoorthy commented 1 year ago

Hi, did you try using http://embark.local ?

http://embark.local works fine locally. I mean I can access the dashboard from with in the VM. But I’m trying to access the dashboard from another machine. The machine from which I’m trying to access Embark VM both are on the same network. If I try to access embark host from other machine using http://10.x.x.x:80 I get you don’t have permission to access the resource message, even though I have registered a account to access embark dashboard.

BenediktMKuehne commented 1 year ago

The url has to stay the same regardless of the IP, since the Apache server only accepts requests with the same name. (name-virtual host) That's why the /etc/hosts entry is needed.

  1. Run server on VM/Server
  2. Do routing if necessary
  3. Add DNS resolve for embark.local to the correct host/ip:
    • if dns server: add entry
    • no dns -> edit hosts file (c:\windows\system32\drivers\etc\hosts.file on windows) on every client

Alternatively you could try adding an alias: --server-alias <HOSTNAME/IP> at run-server.sh line 205 but I never tried that

jblu42 commented 1 year ago

Was also looking for this. Just tried to modify the run-server.sh and added the line --server-alias and it works. Would be great to have this as an option (e.g. command line or config file) and/or quickly describe this in the README. Makes it possible to run EMBARK on a headless server.

senthilkumarmoorthy commented 1 year ago

Again, this works if the dashboard is accessed from the same host where the instance is deployed. Did you trying accessing the dashboard using the ip:port from a different host within the same network.?

jblu42 commented 1 year ago

@senthilkumarmoorthy Yes, just tried it. I added the line to run-server.sh at line 205 (--server-alias 192.168.0.55). The server runs in a VM with the IP 192.168.0.55. I can access EMBARK from a Browser on another system with http://192.168.0.55

Did not change anything else in EMBARK or host.

senthilkumarmoorthy commented 1 year ago

I will do a fresh installation then. Thank you so much everyone so far.

senthilkumarmoorthy commented 1 year ago

Great. It worked. I deployed it in a new VM and works flawlessly. Thank you @BenediktMKuehne & @jblu42