
Research
Two Malicious Rust Crates Impersonate Popular Logger to Steal Wallet Keys
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
@keboola/middy-error-logger
Advanced tools
Errors logging middleware for Middy.
The middleware catches thrown exceptions and rejected promises and logs them comprehensibly to the console. All logs are enriched with event and context.
It works with http-errors
module and creates a proper HTTP response for them using the message and the status code.
import createError from 'http-errors';
import middy from 'middy';
import errorLogger from '@keboola/middy-error-logger';
export const handler = middy(() => {
throw new createError.UnprocessableEntity();
});
handler
.use(errorLogger());
This sample code writes such a stringified json to the console:
{
"message": "Unprocessable Entity",
"statusCode": 422,
"stack": [
"UnprocessableEntityError: Unprocessable Entity",
"at Function._callee$ (/var/task/src/lambda.js:6:19)",
"at tryCatch (/var/task/node_modules/regenerator-runtime/runtime.js:62:40)",
"..."
],
"event": {
"resource": "/",
"httpMethod": "GET",
"queryStringParameters": null,
"body": null
},
"context": {
"sourceIp": "214.178.123.91",
"userAgent": "Paw/3.1.7 (Macintosh; OS X/10.14.0) GCDHTTPRequest"
},
"awsRequestId": "ab022f5a-d3ad-11e8-89f6-89a425b4ca0a"
}
And return this message to the request response:
{
"errorMessage": "Unprocessable Entity",
"errorCode": 422,
"requestId": "ab022f5a-d3ad-11e8-89f6-89a425b4ca0a"
}
If the error is not an instance from http-errors
, the error message in the response is replaced with "Internal Error." and the status code is set to 500.
FAQs
Error logger middleware for Middy
We found that @keboola/middy-error-logger demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 7 open source maintainers 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
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
Research
A malicious package uses a QR code as steganography in an innovative technique.
Research
/Security News
Socket identified 80 fake candidates targeting engineering roles, including suspected North Korean operators, exposing the new reality of hiring as a security function.