Skip to content
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

File cannot be created on Windows due to ":" in filename #5

Closed
karl-barbour opened this issue Dec 14, 2021 · 1 comment · Fixed by #6
Closed

File cannot be created on Windows due to ":" in filename #5

karl-barbour opened this issue Dec 14, 2021 · 1 comment · Fixed by #6
Labels
bug Something isn't working

Comments

@karl-barbour
Copy link
Contributor

Description

When running the tool, the file cannot be created as new Date()).toISOString() results in a filename containing illegal characters (:).

Steps to Reproduce

Execute file node nr-find-log4j.js

Expected Behavior

Script runs and produces CSV/JSON output file.

Relevant Logs / Console output

Checking api key...  OK, found 215 accounts.
Scanning your accounts, this may take some time...
Checking 109 java services... done. Actual service count is 109.
Scanning modules (service 109 of 109)...  done.

OK, scan took 81 seconds. Found 15 services with log4j-core.
node:fs:585
  handleErrorFromBinding(ctx);
  ^

Error: ENOENT: no such file or directory, open 'log4j_scan_2021-12-14T13:30:13.870Z.csv'
    at Object.openSync (node:fs:585:3)
    at Object.writeFileSync (node:fs:2153:35)
    at writeResults (D:\git\nr-find-log4j\nr-find-log4j.js:542:8)
    at findModulesByEntity (D:\git\nr-find-log4j\nr-find-log4j.js:367:3)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async findServices (D:\git\nr-find-log4j\nr-find-log4j.js:281:5)
    at async D:\git\nr-find-log4j\nr-find-log4j.js:199:7 {
  errno: -4058,
  syscall: 'open',
  code: 'ENOENT',
  path: 'log4j_scan_2021-12-14T13:30:13.870Z.csv'
}

Your Environment

Windows 11
Tested on Node 14, Node 16

Additional context

n/a

@karl-barbour
Copy link
Contributor Author

Created pull request #6 to resolve

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant