Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
mongo-uri-safe-log
Advanced tools
This library is inteded for use within node. Specifically it is useful for safely logging mongodb URIs, which is useful for debugging. It allows you to easily remove username and password from the log output.
This library is inteded for use within node. Specifically it is useful for safely logging mongodb URIs, which is useful for debugging. It allows you to easily remove username and password from the log output.
You can override default behavior to hide more or less information
mongoUriSafeLog(uri, supressUser, supressPass) | Output |
---|---|
mongoUriSafeLog(uri) | mongodb://actual-username:PASSWORD@... |
mongoUriSafeLog(uri, true) | mongodb://USERNAME:PASSWORD@... |
mongoUriSafeLog(uri, true, false) | mongodb://USERNAME:actual-password@... |
const mongoUriSafeLog = require('mongo-uri-safe-log')
const mongoURI = 'mongodb://service-account:super-secret-password@db.somedomain.com:27017/collection?readPreference=primary&authSource=admin'
console.log(`Connecting to: ${mongoUriSafeLog(mongoURI)})
Output:
# mongoUriSafeLog(mongoURI)
mongodb://service-account:PASSWORD@db.somedomain.com:27017/collection?readPreference=primary&authSource=admin
# mongoUriSafeLog(mongoURI, true)
mongodb://USERNAME:PASSWORD@db.somedomain.com:27017/collection?readPreference=primary&authSource=admin
# mongoUriSafeLog(mongoURI, false, false)
mongodb://service-account:kdns673#8=@db.somedomain.com:27017/collection?readPreference=primary&authSource=admin
FAQs
This library is inteded for use within node. Specifically it is useful for safely logging mongodb URIs, which is useful for debugging. It allows you to easily remove username and password from the log output.
We found that mongo-uri-safe-log demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.