-
Notifications
You must be signed in to change notification settings - Fork 10
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
Changed output filename to remove :
character
#6
Conversation
:
character
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the quick PR to fix this!
I tested a few environments and found that replaceAll()
isn't supported on my version of node v12 or v14. I suggest using .replace(/:/g, '-')
instead.
nr-find-log4j.js
Outdated
@@ -429,7 +429,7 @@ function writeResults(state) { | |||
state.scanDurationSec = Math.ceil((state.scanCompleted - state.scanStarted) / 1000); | |||
|
|||
process.stdout.write(`\nOK, scan took ${state.scanDurationSec} seconds. Found ${vulnerableApplications.length} services with log4j-core.\n`); | |||
const fileTimestamp = (new Date()).toISOString(); | |||
const fileTimestamp = new Date().toISOString().replaceAll(":","_"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
string.replaceAll() isn't supported in the Node v12 and v14 versions I tested with. we could use the regex global version of replace instead: .replace(//g, '')
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're absolutely correct, apologies @fightingmonk - I had upgraded to 16 to see if it fixed the initial issue and didn't test backwards compatibility. New change suggested.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
perfect, thanks for the fix!
Fixes #5