matanolabs / matano

Open source security data lake for threat hunting, detection & response, and cybersecurity analytics at petabyte scale on AWS
https://matano.dev
Apache License 2.0
1.46k stars 100 forks source link

Add option to Use VPCs in lambdas if specified by user #26

Closed Samrose-Ahmed closed 1 year ago

Samrose-Ahmed commented 1 year ago

Overview

We currently let the user define a VPC id in their matano.config.yml like so:

vpc:
  id: vpc-05175918865d89771

However, we don't currently use the VPC in all the generated resources.

Goal

If the user specifies a VPC ID in their config, use the VPC when generating all resources.

Relevant resource currently is just Lambda functions.

Notes

const vpc: cdk.aws_ec2.IVpc | undefined = (cdk.Stack.of(this) as MatanoStack).matanoVpc;
gdrapp commented 1 year ago

I would ask that you make it optional for the Lambdas to run in the VPC. There’s little value for a Lambda that’s reading/writing to S3 or SQS to run in a VPC. Plus, if you didn’t size the VPC to run a bunch of Lambdas it’s easy to quickly run out of IP addresses.

Samrose-Ahmed commented 1 year ago

Yeah that makes sense. Actually going to punt this to when/if we have resources that require VPCs.