target / attack-navigator-docker Goto Github PK
View Code? Open in Web Editor NEWA simple Docker container that serves the MITRE ATT&CK Navigator web app
License: MIT License
A simple Docker container that serves the MITRE ATT&CK Navigator web app
License: MIT License
Describe the bug
The make command in Readme for building the docker image are not working
Below is the output
[root@centos73_v182101_01 attack-navigator-docker]# make
docker pull node:"10-slim"
Trying to pull repository docker.io/library/node ...
10-slim: Pulling from docker.io/library/node
Digest: sha256:115c3f43131bee55da9f240a3e3a74bb125a3efe3a10a55196a08d0ba2ee1a50
Status: Image is up to date for docker.io/node:10-slim
docker pull nginx:stable-alpine
Trying to pull repository docker.io/library/nginx ...
stable-alpine: Pulling from docker.io/library/nginx
Digest: sha256:270bea203d2fc3743fb9ce0193325e188b7e6233043487e3d3cf117ea4d3f337
Status: Image is up to date for docker.io/nginx:stable-alpine
git submodule init
git submodule update
docker run -it --rm -v pwd
/attack-navigator:/attack-navigator node:"10-slim" /bin/sh -c 'cd /attack-navigator/nav-app && npm install && npm run build'
Error: EACCES: permission denied, scandir '/attack-navigator/nav-app'
(node:7) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'loaded' of undefined
at exit (/usr/local/lib/node_modules/npm/lib/utils/error-handler.js:98:27)
at errorHandler (/usr/local/lib/node_modules/npm/lib/utils/error-handler.js:216:3)
at /usr/local/lib/node_modules/npm/bin/npm-cli.js:77:20
at cb (/usr/local/lib/node_modules/npm/lib/npm.js:225:22)
at /usr/local/lib/node_modules/npm/lib/npm.js:263:24
at /usr/local/lib/node_modules/npm/lib/config/core.js:83:7
at Array.forEach ()
at /usr/local/lib/node_modules/npm/lib/config/core.js:82:13
at f (/usr/local/lib/node_modules/npm/node_modules/once/once.js:25:25)
at /usr/local/lib/node_modules/npm/lib/config/core.js:112:20
(node:7) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:7) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
TypeError: Cannot read property 'loaded' of undefined
at process. (/usr/local/lib/node_modules/npm/lib/utils/error-handler.js:40:18)
at process.emit (events.js:198:13)
/usr/local/lib/node_modules/npm/lib/utils/error-handler.js:98
var doExit = npm.config.loaded ? npm.config.get('_exit') : true
^
TypeError: Cannot read property 'loaded' of undefined
at exit (/usr/local/lib/node_modules/npm/lib/utils/error-handler.js:98:27)
at process.errorHandler (/usr/local/lib/node_modules/npm/lib/utils/error-handler.js:216:3)
at process.emit (events.js:198:13)
at process._fatalException (internal/bootstrap/node.js:496:27)
make: *** [build] Error 7
[root@centos73_v182101_01 attack-navigator-docker]#
CentOS Linux release 7.6.1810
Docker version 1.13.1, build 7f2769b/1.13.1
Describe the bug
Tried to build the container. Build process aborts with an error message
To Reproduce
Steps to reproduce the behavior:
make
Error
> node scripts/install.js
/attack-navigator/nav-app/node_modules/@npmcli/fs/lib/fs.js:6
const fsSync = Object.fromEntries(Object.entries(fs).filter(([k, v]) =>
^
TypeError: Object.fromEntries is not a function
at Object.<anonymous> (/attack-navigator/nav-app/node_modules/@npmcli/fs/lib/fs.js:6:23)
at Module._compile (internal/modules/cjs/loader.js:778:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Module.require (internal/modules/cjs/loader.js:692:17)
at require (internal/modules/cjs/helpers.js:25:18)
at Object.<anonymous> (/attack-navigator/nav-app/node_modules/@npmcli/fs/lib/index.js:2:6)
at Module._compile (internal/modules/cjs/loader.js:778:30)
Expected behavior
Expected build to work
Screenshots
Nope.
Desktop (please complete the following information):
Smartphone (please complete the following information):
Additional context
Add any other context about the problem here.
Following the instructions in the README I've done the following
cd attack-navigator-docker
git submodule update --init --recursive
make > output.log 2>&1
It resulted in a build errror.
Attached is output.log
output.log
Is your feature request related to a problem? Please describe.
Use docker-compose instead of make files
Describe the solution you'd like
Use or adapt below docker-compose file
Describe alternatives you've considered
docker-compose is nice and tidy
Additional context
version: '3'
services:
attack-nav-node:
image: node:16
container_name: attack-nav-node
volumes:
- ./attack-navigator:/attack-navigator
command: sh -c "cd /attack-navigator/nav-app && npm install -g @angular/cli && npm install --unsafe-perm && ng build"
attack-nav-web:
container_name: attack-nav-web
depends_on:
- attack-nav-node
image: nginx:stable-alpine
ports:
- 8080:80
volumes:
- ./attack-navigator/nav-app/dist:/usr/share/nginx/html
Describe the bug
The make build fails
To Reproduce
Steps to reproduce the behavior:
1.run the make or make build command
the npm build exits with an error
Expected behavior
a running container
**Output of the error **
gyp info using [email protected]
gyp info using [email protected] | linux | x64
gyp verb command rebuild []
gyp verb command clean []
gyp verb clean removing "build" directory
gyp verb command configure []
gyp verb find Python Python is not set from command line or npm configuration
gyp verb find Python Python is not set from environment variable PYTHON
gyp verb find Python checking if "python3" can be used
gyp verb find Python - executing "python3" to get executable path
gyp verb find Python - "python3" is not in PATH or produced an error
gyp verb find Python checking if "python" can be used
gyp verb find Python - executing "python" to get executable path
gyp verb find Python - "python" is not in PATH or produced an error
gyp ERR! find Python
gyp ERR! find Python Python is not set from command line or npm configuration
gyp ERR! find Python Python is not set from environment variable PYTHON
gyp ERR! find Python checking if "python3" can be used
gyp ERR! find Python - "python3" is not in PATH or produced an error
gyp ERR! find Python checking if "python" can be used
gyp ERR! find Python - "python" is not in PATH or produced an error
gyp ERR! find Python
gyp ERR! find Python **********************************************************
gyp ERR! find Python You need to install the latest version of Python.
gyp ERR! find Python Node-gyp should be able to find and use Python. If not,
gyp ERR! find Python you can try one of the following options:
gyp ERR! find Python - Use the switch --python="/path/to/pythonexecutable"
gyp ERR! find Python (accepted by both node-gyp and npm)
gyp ERR! find Python - Set the environment variable PYTHON
gyp ERR! find Python - Set the npm configuration variable python:
gyp ERR! find Python npm config set python "/path/to/pythonexecutable"
gyp ERR! find Python For more information consult the documentation at:
gyp ERR! find Python https://github.com/nodejs/node-gyp#installation
gyp ERR! find Python **********************************************************
gyp ERR! find Python
gyp ERR! configure error
gyp ERR! stack Error: Could not find any Python installation to use
gyp ERR! stack at PythonFinder.fail (/attack-navigator/nav-app/node_modules/node-gyp/lib/find-python.js:330:47)
gyp ERR! stack at PythonFinder.runChecks (/attack-navigator/nav-app/node_modules/node-gyp/lib/find-python.js:159:21)
gyp ERR! stack at PythonFinder. (/attack-navigator/nav-app/node_modules/node-gyp/lib/find-python.js:202:16)
gyp ERR! stack at PythonFinder.execFileCallback (/attack-navigator/nav-app/node_modules/node-gyp/lib/find-python.js:294:16)
gyp ERR! stack at exithandler (child_process.js:301:5)
gyp ERR! stack at ChildProcess.errorhandler (child_process.js:313:5)
gyp ERR! stack at ChildProcess.emit (events.js:198:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:246:12)
gyp ERR! stack at onErrorNT (internal/child_process.js:415:16)
gyp ERR! stack at process._tickCallback (internal/process/next_tick.js:63:19)
gyp ERR! System Linux 5.10.60.1-microsoft-standard-WSL2
gyp ERR! command "/usr/local/bin/node" "/attack-navigator/nav-app/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd /attack-navigator/nav-app/node_modules/node-sass
gyp ERR! node -v v10.24.1
gyp ERR! node-gyp -v v8.4.1
gyp ERR! not ok
Build failed with error code: 1
npm WARN notsup Unsupported engine for [email protected]: wanted: {"node":">=12"} (current: {"node":"10.24.1","npm":"6.14.12"})
npm WARN notsup Not compatible with your version of node/npm: [email protected]
npm WARN notsup Unsupported engine for [email protected]: wanted: {"node":">=12"} (current: {"node":"10.24.1","npm":"6.14.12"})
npm WARN notsup Not compatible with your version of node/npm: [email protected]
npm WARN notsup Unsupported engine for [email protected]: wanted: {"node":"^12.13.0 || ^14.15.0 || >=16"} (current: {"node":"10.24.1","npm":"6.14.12"})
npm WARN notsup Not compatible with your version of node/npm: [email protected]
npm WARN notsup Unsupported engine for [email protected]: wanted: {"node":"^12.13.0 || ^14.15.0 || >=16"} (current: {"node":"10.24.1","npm":"6.14.12"})
npm WARN notsup Not compatible with your version of node/npm: [email protected]
npm WARN notsup Unsupported engine for [email protected]: wanted: {"node":"^12.13.0 || ^14.15.0 || >=16"} (current: {"node":"10.24.1","npm":"6.14.12"})
npm WARN notsup Not compatible with your version of node/npm: [email protected]
npm WARN notsup Unsupported engine for [email protected]: wanted: {"node":">=12"} (current: {"node":"10.24.1","npm":"6.14.12"})
npm WARN notsup Not compatible with your version of node/npm: [email protected]
npm WARN notsup Unsupported engine for [email protected]: wanted: {"node":">=12"} (current: {"node":"10.24.1","npm":"6.14.12"})
npm WARN notsup Not compatible with your version of node/npm: [email protected]
npm WARN @angular/[email protected] requires a peer of @angular/[email protected] but none is installed. You must install peer dependencies yourself.
npm WARN @angular/[email protected] requires a peer of @angular/[email protected] but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of @angular/common@^10.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of @angular/core@^10.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of @angular/platform-browser@^10.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of bootstrap@^4.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/webpack-dev-server/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/watchpack-chokidar2/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] postinstall: node scripts/build.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2022-02-12T06_44_53_173Z-debug.log
make: *** [Makefile:7: build] Error 1
Desktop (please complete the following information):
Hi,
Seems the following doesn't exist for a start. I get a raft of errors but can you suggest a replacement for the first?
https://github.com/sass/node-sass/releases/download/v4.7.2/linux-x64-64_binding.node
Full error report.
docker pull node:"10-slim"
10-slim: Pulling from library/node
Digest: sha256:ce0b8ec37c669bb12da1683a265a2aa6f85cdd7a692d959f7c48e8c26cc37585
Status: Image is up to date for node:10-slim
docker.io/library/node:10-slim
docker pull nginx:stable-alpine
stable-alpine: Pulling from library/nginx
Digest: sha256:5057451e461dda671da5e951019ddbff9d96a751fc7d548053523ca1f848c1ad
Status: Image is up to date for nginx:stable-alpine
docker.io/library/nginx:stable-alpine
git submodule init
git submodule update
docker run -it --rm -v pwd
/attack-navigator:/attack-navigator node:"10-slim" /bin/sh -c 'cd /attack-navigator/nav-app && npm install && npm run build'
[email protected] install /attack-navigator/nav-app/node_modules/node-sass
node scripts/install.js
**Downloading binary from https://github.com/sass/node-sass/releases/download/v4.7.2/linux-x64-64_binding.node
Cannot download "https://github.com/sass/node-sass/releases/download/v4.7.2/linux-x64-64_binding.node":
HTTP error 404 Not Found**
Hint: If github.com is not accessible in your location
try setting a proxy via HTTP_PROXY, e.g.
export HTTP_PROXY=http://example.com:1234
or configure npm proxy via
npm config set proxy http://example.com:8080
[email protected] postinstall /attack-navigator/nav-app/node_modules/node-sass
node scripts/build.js
Building: /usr/local/bin/node /attack-navigator/nav-app/node_modules/node-gyp/bin/node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
gyp info it worked if it ends with ok
gyp verb cli [ '/usr/local/bin/node',
gyp verb cli '/attack-navigator/nav-app/node_modules/node-gyp/bin/node-gyp.js',
gyp verb cli 'rebuild',
gyp verb cli '--verbose',
gyp verb cli '--libsass_ext=',
gyp verb cli '--libsass_cflags=',
gyp verb cli '--libsass_ldflags=',
gyp verb cli '--libsass_library=' ]
gyp info using [email protected]
gyp info using [email protected] | linux | x64
gyp verb command rebuild []
gyp verb command clean []
gyp verb clean removing "build" directory
gyp verb command configure []
gyp verb check python checking for Python executable "python2" in the PATH
gyp verb which
failed Error: not found: python2
gyp verb which
failed at getNotFoundError (/attack-navigator/nav-app/node_modules/which/which.js:13:12)
gyp verb which
failed at F (/attack-navigator/nav-app/node_modules/which/which.js:68:19)
gyp verb which
failed at E (/attack-navigator/nav-app/node_modules/which/which.js:80:29)
gyp verb which
failed at /attack-navigator/nav-app/node_modules/which/which.js:89:16
gyp verb which
failed at /attack-navigator/nav-app/node_modules/isexe/index.js:42:5
gyp verb which
failed at /attack-navigator/nav-app/node_modules/isexe/mode.js:8:5
gyp verb which
failed at FSReqWrap.oncomplete (fs.js:153:21)
gyp verb which
failed python2 { Error: not found: python2
gyp verb which
failed at getNotFoundError (/attack-navigator/nav-app/node_modules/which/which.js:13:12)
gyp verb which
failed at F (/attack-navigator/nav-app/node_modules/which/which.js:68:19)
gyp verb which
failed at E (/attack-navigator/nav-app/node_modules/which/which.js:80:29)
gyp verb which
failed at /attack-navigator/nav-app/node_modules/which/which.js:89:16
gyp verb which
failed at /attack-navigator/nav-app/node_modules/isexe/index.js:42:5
gyp verb which
failed at /attack-navigator/nav-app/node_modules/isexe/mode.js:8:5
gyp verb which
failed at FSReqWrap.oncomplete (fs.js:153:21)
gyp verb which
failed stack:
gyp verb which
failed 'Error: not found: python2\n at getNotFoundError (/attack-navigator/nav-app/node_modules/which/which.js:13:12)\n at F (/attack-navigator/nav-app/node_modules/which/which.js:68:19)\n at E (/attack-navigator/nav-app/node_modules/which/which.js:80:29)\n at /attack-navigator/nav-app/node_modules/which/which.js:89:16\n at /attack-navigator/nav-app/node_modules/isexe/index.js:42:5\n at /attack-navigator/nav-app/node_modules/isexe/mode.js:8:5\n at FSReqWrap.oncomplete (fs.js:153:21)',
gyp verb which
failed code: 'ENOENT' }
gyp verb check python checking for Python executable "python" in the PATH
gyp verb which
failed Error: not found: python
gyp verb which
failed at getNotFoundError (/attack-navigator/nav-app/node_modules/which/which.js:13:12)
gyp verb which
failed at F (/attack-navigator/nav-app/node_modules/which/which.js:68:19)
gyp verb which
failed at E (/attack-navigator/nav-app/node_modules/which/which.js:80:29)
gyp verb which
failed at /attack-navigator/nav-app/node_modules/which/which.js:89:16
gyp verb which
failed at /attack-navigator/nav-app/node_modules/isexe/index.js:42:5
gyp verb which
failed at /attack-navigator/nav-app/node_modules/isexe/mode.js:8:5
gyp verb which
failed at FSReqWrap.oncomplete (fs.js:153:21)
gyp verb which
failed python { Error: not found: python
gyp verb which
failed at getNotFoundError (/attack-navigator/nav-app/node_modules/which/which.js:13:12)
gyp verb which
failed at F (/attack-navigator/nav-app/node_modules/which/which.js:68:19)
gyp verb which
failed at E (/attack-navigator/nav-app/node_modules/which/which.js:80:29)
gyp verb which
failed at /attack-navigator/nav-app/node_modules/which/which.js:89:16
gyp verb which
failed at /attack-navigator/nav-app/node_modules/isexe/index.js:42:5
gyp verb which
failed at /attack-navigator/nav-app/node_modules/isexe/mode.js:8:5
gyp verb which
failed at FSReqWrap.oncomplete (fs.js:153:21)
gyp verb which
failed stack:
gyp verb which
failed 'Error: not found: python\n at getNotFoundError (/attack-navigator/nav-app/node_modules/which/which.js:13:12)\n at F (/attack-navigator/nav-app/node_modules/which/which.js:68:19)\n at E (/attack-navigator/nav-app/node_modules/which/which.js:80:29)\n at /attack-navigator/nav-app/node_modules/which/which.js:89:16\n at /attack-navigator/nav-app/node_modules/isexe/index.js:42:5\n at /attack-navigator/nav-app/node_modules/isexe/mode.js:8:5\n at FSReqWrap.oncomplete (fs.js:153:21)',
gyp verb which
failed code: 'ENOENT' }
gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.
gyp ERR! stack at PythonFinder.failNoPython (/attack-navigator/nav-app/node_modules/node-gyp/lib/configure.js:483:19)
gyp ERR! stack at PythonFinder. (/attack-navigator/nav-app/node_modules/node-gyp/lib/configure.js:397:16)
gyp ERR! stack at F (/attack-navigator/nav-app/node_modules/which/which.js:68:16)
gyp ERR! stack at E (/attack-navigator/nav-app/node_modules/which/which.js:80:29)
gyp ERR! stack at /attack-navigator/nav-app/node_modules/which/which.js:89:16
gyp ERR! stack at /attack-navigator/nav-app/node_modules/isexe/index.js:42:5
gyp ERR! stack at /attack-navigator/nav-app/node_modules/isexe/mode.js:8:5
gyp ERR! stack at FSReqWrap.oncomplete (fs.js:153:21)
gyp ERR! System Linux 4.18.0-80.4.2.el8_0.x86_64
gyp ERR! command "/usr/local/bin/node" "/attack-navigator/nav-app/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd /attack-navigator/nav-app/node_modules/node-sass
gyp ERR! node -v v10.19.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
Build failed with error code: 1
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/node-sass):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] postinstall: node scripts/build.js
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1
audited 8096 packages in 12.805s
found 300 vulnerabilities (28 low, 88 moderate, 183 high, 1 critical)
run npm audit fix
to fix them, or npm audit
for details
[email protected] build /attack-navigator/nav-app
ng build
92% chunk asset optimizationKilled
npm ERR! code ELIFECYCLE
npm ERR! errno 137
npm ERR! [email protected] build: ng build
npm ERR! Exit status 137
npm ERR!
npm ERR! Failed at the [email protected] build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2020-02-27T09_06_48_901Z-debug.log
make: *** [Makefile:7: build] Error 137
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.