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.
@guardian/elk-kinesis-logger
Advanced tools
Logging to a Kinesis stream for consumption into an ELK cluster
Send logs to an ELK stack via an AWS Kinesis stream.
The ELK stack should be using the Kinesis Input Plugin.
The main use case is for AWS Lambdas. When you console.log
within a Lambda, they go into CloudWatch Logs.
Whilst CloudWatch Logs is good, an ELK stack is better!
Using this module, we can easily get logs into an ELK stack.
npm install @guardian/elk-kinesis-logger
Import the module:
const ELKKinesisLogger = require('elk-kinesis-logger');
Create a new logger:
const logger = new ELKKinesisLogger({
stage: 'PROD',
stack: 'my-stack',
app: 'my-app',
streamName: 'my-stream'
});
Open the logger:
logger.open();
Write a log message:
logger.log('something happened');
Ensure all logs have written by closing the logger:
logger.close().then(() => {
});
ELKKinesisLogger uses a credential provider chain, loading credentials from:
You can set the AWS profile to use with SharedIniFileCredentials
by calling .withProfile()
:
const logger = new ELKKinesisLogger({
stage: 'PROD',
stack: 'my-stack',
app: 'my-app',
streamName: 'my-stream'
}).withProfile('profile1');
If the stream's access is restricted, you can specify a role arn to assume:
const logger = new ELKKinesisLogger({
stage: 'PROD',
stack: 'my-stack',
app: 'my-app',
streamName: 'my-stream'
}).withRole('arn:aws:iam::000000000000:role/my-role');
const ELKKinesisLogger = require('elk-kinesis-logger');
const logger = new ELKKinesisLogger({
stage: 'PROD',
stack: 'my-stack',
app: 'my-app',
streamName: 'my-stream'
}).open();
const value = 5 * 5;
logger.log(`the value is ${value}`);
logger.close().then((writtenLogs) => {
// other work
});
See the examples.
npm test
npm publish
FAQs
Logging to a Kinesis stream for consumption into an ELK cluster
We found that @guardian/elk-kinesis-logger demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 21 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
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.