
Security News
Feross on TBPN: How North Korea Hijacked Axios
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.
@steadybit/failure-lambda
Advanced tools
Description | How to with SSM Parameter | How to with AppConfig | Usage | Examples | Notes | Changelog
failure-lambda is a small Node module for injecting failure into AWS Lambda (https://aws.amazon.com/lambda). It offers a simple failure injection wrapper for your Lambda handler where you then can choose to inject failure by setting the failureMode to latency, exception, denylist, diskspace or statuscode. You control your failure injection using SSM Parameter Store or AWS AppConfig.
failure-lambda module using NPM.npm install failure-lambda
const failureLambda = require("failure-lambda");
exports.handler = failureLambda(async (event, context) => {
...
})
{
"isEnabled": false,
"failureMode": "latency",
"rate": 1,
"minLatency": 100,
"maxLatency": 400,
"exceptionMsg": "Exception message!",
"statusCode": 404,
"diskSpace": 100,
"denylist": ["s3.*.amazonaws.com", "dynamodb.*.amazonaws.com"]
}
aws ssm put-parameter --region eu-west-1 --name failureLambdaConfig --type String --overwrite --value "{\"isEnabled\": false, \"failureMode\": \"latency\", \"rate\": 1, \"minLatency\": 100, \"maxLatency\": 400, \"exceptionMsg\": \"Exception message!\", \"statusCode\": 404, \"diskSpace\": 100, \"denylist\": [\"s3.*.amazonaws.com\", \"dynamodb.*.amazonaws.com\"]}"
failure-lambda module using NPM.npm install failure-lambda
const failureLambda = require("failure-lambda");
exports.handler = failureLambda(async (event, context) => {
...
})
FAILURE_APPCONFIG_APPLICATION: YOUR APPCONFIG APPLICATION
FAILURE_APPCONFIG_ENVIRONMENT: YOUR APPCONFIG ENVIRONMENT
FAILURE_APPCONFIG_CONFIGURATION: YOUR APPCONFIG CONFIGURATION PROFILE
Edit the values of your parameter in SSM Parameter Store or hosted configuration in AWS AppConfig to use the failure injection module.
isEnabled: true means that failure is injected into your Lambda function.isEnabled: false means that the failure injection module is disabled and no failure is injected.failureMode selects which failure you want to inject. The options are latency, exception, denylist, diskspace or statuscode as explained below.rate controls the rate of failure. 1 means that failure is injected on all invocations and 0.5 that failure is injected on about half of all invocations.minLatency and maxLatency is the span of latency in milliseconds injected into your function when failureMode is set to latency.exceptionMsg is the message thrown with the exception created when failureMode is set to exception.statusCode is the status code returned by your function when failureMode is set to statuscode.diskSpace is size in MB of the file created in tmp when failureMode is set to diskspace.denylist is an array of regular expressions, if a connection is made to a host matching one of the regular expressions it will be blocked.In the subfolder example is a sample application which will install an AWS Lambda function, an Amazon DynamoDB table, and a parameter in SSM Parameter Store. You can install it using AWS SAM, AWS CDK, or Serverless Framework.
cd example/sam
npm install
sam build
sam deploy --guided
cd example/cdk
npm install
cdk deploy
cd example/sls
npm install
sls deploy
This module is a fork of Gunnar Grosch's failure-lambda.
Inspired by Yan Cui's articles on latency injection for AWS Lambda (https://hackernoon.com/chaos-engineering-and-aws-lambda-latency-injection-ddeb4ff8d983) and Adrian Hornsby's chaos injection library for Python (https://github.com/adhorn/aws-lambda-chaos-injection/).
FAQs
Module for failure injection into AWS Lambda
The npm package @steadybit/failure-lambda receives a total of 1 weekly downloads. As such, @steadybit/failure-lambda popularity was classified as not popular.
We found that @steadybit/failure-lambda demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 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.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.

Security News
OpenSSF has issued a high-severity advisory warning open source developers of an active Slack-based campaign using impersonation to deliver malware.

Research
/Security News
Malicious packages published to npm, PyPI, Go Modules, crates.io, and Packagist impersonate developer tooling to fetch staged malware, steal credentials and wallets, and enable remote access.