
Research
Security News
Lazarus Strikes npm Again with New Wave of Malicious Packages
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
@janiscommerce/log
Advanced tools
A package for creating logs in S3
npm install @janiscommerce/log
JANIS_SERVICE_NAME
(required): The name of the service that will create the log.
add(bucketName, log)
Parameters: bucketName [String]
, log [Object]
Puts the recieved log into the specified S3 bucket.
The log [Object]
parameter have the following structure:
type [String|Number]
(required): The log typeentity [String]
(required): The name of the entity that is creating the logentity_id [String]
(optional): The ID of the entity that is creating the logmessage [String]
(optional): A general message about the loglog [Object]
(optional): This property is a JSON that includes all the technical data about your log.date_created [unix_timestamp]
(optional): The date created of the log. Default will be auto-generated.id [String]
(optional): The ID of the log in UUID V4 format. Default will be auto-generated.{
type: 'new',
entity: 'api',
entity_id: 'log',
service: 'trace',
message: '[GET] Request from 12.345.67.89 to /log',
date_created: 1559103066,
log: {
verb: 'GET',
headers: {
'x-forwarded-for': '12.345.67.89',
'x-forwarded-proto: 'https',
'x-forwarded-port: '443',
},
responseHttpCode: 200
},
id: '0acefd5e-cb90-4531-b27a-e4d236f07539'
}
on(event, callback)
Parameters: event [String]
, callback [Function]
Calls a callback when the specified event is emitted.
The errors are informed with a LogError
.
This object has a code that can be useful for a correct error handling.
The codes are the following:
Code | Description |
---|---|
1 | Invalid log |
2 | Invalid bucket |
3 | S3 Error |
4 | Unknown service name |
In case of error while creating your log into S3, this package will emit an event called create-error
, you can handle it using the on()
method.
const Log = require('@janiscommerce/log');
Log.add('my-bucket', {
type: 1,
entity: 'api',
entity_id: 'product',
message: '[GET] Request from 0.0.0.0 of custom_data'
// ...
});
Log.on('create-error', (log, err) => {
console.error(`An error occurred while creating the log ${err.message}`);
});
In order to connect into S3, this package requires the aws volume in the docker-compose.yml
.
volumes:
~/.aws:/root/.aws
[1.1.0] - 2019-10-08
index.js
FAQs
A package for creating logs in Janis Trace Service
The npm package @janiscommerce/log receives a total of 261 weekly downloads. As such, @janiscommerce/log popularity was classified as not popular.
We found that @janiscommerce/log demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 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
Security News
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
Security News
Socket CEO Feross Aboukhadijeh discusses the open web, open source security, and how Socket tackles software supply chain attacks on The Pair Program podcast.
Security News
Opengrep continues building momentum with the alpha release of its Playground tool, demonstrating the project's rapid evolution just two months after its initial launch.