SecurityRiskAdvisors / VECTR

VECTR is a tool that facilitates tracking of your red and blue team testing activities to measure detection and prevention capabilities across different attack scenarios
1.35k stars 159 forks source link

rta-builder - URIError: URI malformed #186

Closed blvrkr closed 2 years ago

blvrkr commented 2 years ago

Hi Team,

When I try to deploy vectr-8.4.3-ce, I get following error message:

$ docker-compose up
(...)
vectr-rta-builder_1    | /app/node_modules/mongodb/lib/utils.js:1020
vectr-rta-builder_1    |             let normalized = decodeURIComponent(hostname).toLowerCase();
vectr-rta-builder_1    |                              ^
vectr-rta-builder_1    |
vectr-rta-builder_1    | URIError: URI malformed
vectr-rta-builder_1    |     at decodeURIComponent (<anonymous>)
vectr-rta-builder_1    |     at new HostAddress (/app/node_modules/mongodb/lib/utils.js:1020:30)
vectr-rta-builder_1    |     at fromString (/app/node_modules/mongodb/lib/utils.js:1063:16)
vectr-rta-builder_1    |     at Array.map (<anonymous>)
vectr-rta-builder_1    |     at parseOptions (/app/node_modules/mongodb/lib/connection_string.js:216:45)
vectr-rta-builder_1    |     at new MongoClient (/app/node_modules/mongodb/lib/mongo_client.js:62:63)
vectr-rta-builder_1    |     at Object.<anonymous> (/app/mongodb.js:4:16)
vectr-rta-builder_1    |     at Module._compile (node:internal/modules/cjs/loader:1101:14)
vectr-rta-builder_1    |     at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
vectr-rta-builder_1    |     at Module.load (node:internal/modules/cjs/loader:981:32)
sandbox1_vectr-rta-builder_1 exited with code 1

VECTR_HOSTNAME set to short server name and FQDN give the same result.

Environment: docker-ce version 20.10.14, docker-compose version 1.29.2.

SRAPSpencer commented 2 years ago

What Linux distro and version are you on?

SRAPSpencer commented 2 years ago

Hi Team,

When I try to deploy vectr-8.4.3-ce, I get following error message:

$ docker-compose up
(...)
vectr-rta-builder_1    | /app/node_modules/mongodb/lib/utils.js:1020
vectr-rta-builder_1    |             let normalized = decodeURIComponent(hostname).toLowerCase();
vectr-rta-builder_1    |                              ^
vectr-rta-builder_1    |
vectr-rta-builder_1    | URIError: URI malformed
vectr-rta-builder_1    |     at decodeURIComponent (<anonymous>)
vectr-rta-builder_1    |     at new HostAddress (/app/node_modules/mongodb/lib/utils.js:1020:30)
vectr-rta-builder_1    |     at fromString (/app/node_modules/mongodb/lib/utils.js:1063:16)
vectr-rta-builder_1    |     at Array.map (<anonymous>)
vectr-rta-builder_1    |     at parseOptions (/app/node_modules/mongodb/lib/connection_string.js:216:45)
vectr-rta-builder_1    |     at new MongoClient (/app/node_modules/mongodb/lib/mongo_client.js:62:63)
vectr-rta-builder_1    |     at Object.<anonymous> (/app/mongodb.js:4:16)
vectr-rta-builder_1    |     at Module._compile (node:internal/modules/cjs/loader:1101:14)
vectr-rta-builder_1    |     at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
vectr-rta-builder_1    |     at Module.load (node:internal/modules/cjs/loader:981:32)
sandbox1_vectr-rta-builder_1 exited with code 1

VECTR_HOSTNAME set to short server name and FQDN give the same result.

Environment: docker-ce version 20.10.14, docker-compose version 1.29.2.

Looking into this further, are you using a custom external MongoDB connection and not the built in container? That could be causing an issue, but we'd need more information on your operating environment. We are able to get other errors with unescaped characters but this particular error we can't recreate.

blvrkr commented 2 years ago

Red Hat Enterprise Linux 8.6

blvrkr commented 2 years ago

I'm using default MongoDB connection, here's what I have in .env file: MONGO_URL=mongodb://vectr-mongo:27017/?authSource=admin

I had earlier version installed before but right now everything is removed (images, containers, volumes, networks, etc.)

carlvonderheid commented 2 years ago

Are you using the default docker-compose.yml file? The hostname is expected to be the service name, which is "vectr-mongo".

blvrkr commented 2 years ago

Yes, it's from sra-vectr-runtime-8.4.3-ce.zip

SRAPSpencer commented 2 years ago

Yes, it's from sra-vectr-runtime-8.4.3-ce.zip

Honestly I'm worried it has to do with running in RHEL 8.x. RHEL is unsupported on x86 systems(AMD/Intel CPUs) and we've had nothing but issues with people trying to get it working from connectivity to weird errors like this.

https://docs.docker.com/engine/install/

Since we can't replicate you can shoot us an email vectrops@securityriskadvisors.com and we can briefly verify there's nothing obvious wrong on a call.

blvrkr commented 2 years ago

Ok, I've managed to find the cause of this problem. It seems that special characters are no longer allowed in MONGO_INITDB_ROOT_PASSWORD. I think it's related to one of recent changes because it worked with VECTR 8.3.2 before.

SRAPSpencer commented 2 years ago

Thanks for reporting back the cause. I'll log this in our internal tracker to update our documentation