A collection of AWS Security controls for AWS Lambda. Controls include templates to create Lambda Functions, AWS Config rules for monitoring compliance, and Service Control Policies. Configuration templates are available in AWS CloudFormation, AWS CLI and Terraform
Configuration template to create a Lambda Function. The template includes options to customize the function's settings such as name, runtime, code location (inline, ZIP or S3), memory size, timeout and more
This template creates a version from the current code and configuration of a Lambda function. It includes a Lambda function resource with a specified handler, role, code, runtime, and tracing configuration. The version resource is associated with the Lambda function and has a description and provisioned concurrency configuration.
This template grants Amazon S3 permission to invoke a function resource named `my-lambda-function` created in the same template, to process notifications for a bucket resource named `Bucket`.
This template grants public, unauthenticated access to invoke your function named `my-lambda-function` via its function URL.
This template grants account 123456789012 permission to invoke a Lambda function created in the same template. The Lambda function stores its code `function.zip` on an S3 bucket `my-bucket` and uses the IAM role `lambda-role`
This template creates an `AWS::Lambda::LayerVersionPermission` resource to grant layer usage permission to accounts in organization `o-t194hfs8cz`. The `Action` property is set to `lambda:GetLayerVersion`, the `LayerVersionArn` property is set to `arn:aws:lambda:us-west-2:123456789012:layer:my-layer:1`, the `OrganizationId` property is set to `o-t194hfs8cz`, and the `Principal` property is set to `*`.
This template creates a Lambda layer named `my-layer` with the following properties: CompatibleRuntimes: [python3.6, python3.7], Content: {S3Bucket: my-bucket-us-west-2-123456789012, S3Key: layer.zip}, Description: My layer, LayerName: my-layer, LicenseInfo: MIT
This template creates an AWS Lambda function connected to a VPC. The function is associated with an execution role and has a deployment package stored in an S3 bucket. The function has a timeout of 5 seconds and active tracing configuration. It is also configured with a VPC, with specified security group IDs and subnet IDs.
This template creates an inline AWS Lambda function using Node.js runtime. The function lists Amazon S3 buckets in the `us-east-1` region. The function is associated with an execution role
This template creates an AWS Lambda function using Node.js runtime. The function is associated with an execution role and has a deployment package stored in an S3 bucket. The function has a timeout of 25 seconds and active tracing configuration.
This template creates an event source mapping that reads events from Amazon Kinesis and invokes a Lambda function in the same template.
This template creates a Lambda function with error handling and destination configuration. It also creates a version of the function and configures an event invoke configuration for asynchronous invocation. The function is written in Node.js and has a tracing configuration set to active. The event invoke configuration specifies a destination for both success and failure cases, sets a maximum event age of 300 seconds, a maximum retry attempts of 1, and uses the version as the qualifier.
This template creates a Lambda function with two versions and an alias. The function code is provided as a zip file. The alias is used to provide clients with a function identifier that can be updated to invoke a different version. The alias has a routing configuration that routes requests to both versions, with a weight of 0.5 for the first version and 0.5 for the second version. The function has an active tracing configuration.
This template creates a Node.js Lambda function with a version and alias. The function code is provided as a zip file. The alias is used to provide clients with a function identifier that can be updated to invoke a different version. The function has an active tracing configuration.
This template invokes an AWS Lambda function and retrieves a specific value from the JSON result.
Creates an alias named 'my_alias' for a specified AWS Lambda function version, with routing configuration to another version.
Creates a Lambda code signing configuration with specified allowed publishers and deployment policies.
Maps a self-managed Apache Kafka topic to a Lambda function, including VPC configuration for secure access.
Maps an SQS queue to a Lambda function with a filter to process messages based on specific criteria.
Maps an Amazon MQ (ActiveMQ) broker to a Lambda function, including authentication configuration.
Maps an Amazon MQ (RabbitMQ) broker to a Lambda function, including virtual host and authentication configuration.
Configures a Lambda function to send invocation results to specific AWS services on success or failure.
Defines two Lambda function URLs with different authorization settings and CORS configurations.
Invokes an AWS Lambda function with static input values and outputs a specific result entry.
Invokes an AWS Lambda function dynamically based on changes to the environment, using triggers to detect changes.
This Terraform template grants permission to a specific AWS account to access a Lambda Layer version.
Grants permission for CloudWatch Events to invoke a specific Lambda function.
Allows an SNS topic to invoke a Lambda function.
Configures permissions for an API Gateway to invoke a Lambda function.
Allows a CloudWatch Log Group to invoke a Lambda function for logging purposes.
Sets up a Lambda function URL to be invoked by a specific IAM role from a different AWS account.
Ensures Lambda permissions are re-applied when the underlying function changes, using a lifecycle configuration.
This template sets up a basic AWS Lambda function with an IAM role and a zipped source file.
This template configures a Lambda function with increased ephemeral storage up to 10 GB.
Checks whether the AWS Lambda function policy attached to the Lambda resource prohibits public access. If the Lambda function policy allows public access it is noncompliant.
A Config rule that checks that the lambda function settings for runtime, role, timeout, and memory size match the expected values.
A config rule that checks that all the lambda functions have at least one defined version and alias, also ensure that no alias pointing to $LATEST version
A config rule that checks whether the AWS Lambda function is configured for function-level concurrent execution limit.
A config rule that checks whether the AWS Lambda function is in a VPC or not
A config rule that checks whether each Lambda function has the permission for logging. Each Lambda functions should have an IAM role with appropriate IAM permissions to publish its Lambda function logs to CloudWatch.
A Config rule that checks whether an AWS Lambda function is configured with a dead-letter queue. The rule is NON_COMPLIANT if the Lambda function is not configured with a dead-letter queue
A Config rule that checks if Lambda has more than 1 availability zone associated. The rule is NON_COMPLIANT if only 1 availability zone is associated with the Lambda or the number of availability zones associated is less than number specified in the optional parameter.
This SCP prevents users from creating open Lambda HTTP URLs that do not required authentication and enforces AWS_IAM authentication on all Lambda URLs
This SCP restricts IAM principals in accounts from making changes to specific Lambda Functions with the exception of a specific IAM role (This could be a common administrative IAM role created in all accounts in your organization)