I’m planning to do a HIPAA compliant web-app and curious if I would need a VPC for my lambda function, especially where I’m using managed services (which has been my approach for previous web-apps not requiring compliance). I’m planning to use architecture I’m used to and mentioned in this article:
CloudFront+S3
Cognito for auth
API Gateway authorized with Cognito
Lambda to handle API requests (context encryption will happen here for sensitive fields)
DynamoDB
KMS to encrypt the table, CloudTrail logs, and anything stored in parameter store for environment variables the lambda
I am also leaving out a lot of the standard encryption/HIPAA details (specifics on logging, encryption at rest/in-transit, using TLS, etc).
I understand that only Lambda would be placed within the VPC with endpoints to the DynamoDB table. Is it still best to have the VPC or defensible to not use it here?
There isn’t a huge downside to Lambda in VPC IMHO. So why leave it as something for the auditor to ask about?
FWIW when I had to create a similar setup, I used cdk-nag to tell me what I missed. It allows you to mark things as ignored in code, with a reason. So when the auditor comes, it’s a simple CSV export that includes results + ignore reasons.
hipaa is more about your controls and audit trail that whether every lambda sits in a vpc, but if you out it in a pvc you also take on endpoint and networking that your team has to maintatin
Will be ok for hipaa as long as you have all the encryption enabled like you said.
The biggest issue with lambdas is actually the customer cyber audit. If your customer is a big hospital they tend to have difficulty wrapping their head around this execution model and from experience will stall approval in a system. The biggest issues I have seen with lambdas not in vpc were not having mandatory firewall controls. For this they accept security groups in vpc even though that’s it really a “firewall”. And second issue in review is that they may ask for an endpoint detection and response software tool to be installed which really doesn’t make sense for lambda. We had so many issues with this that I converted to ECS fargate with guard duty even though technically there is more risk of the ECS task being taken over. But it as getting impossible to get through customers because they have a checkbox for EDR that they needed to approve.
Lambda does offer tenant isolation and its primary use case is multi-tenant SaaS. I don’t know if the OP’s HIPAA application is multi-tenant, however. The benefit of VPC is that you can then configure PrivateLink from your application to AWS services like DynamoDB and that makes it easier to convince your auditor that you’re keeping PHI off the public internet**
** in practice even if you don’t use PrivateLink, traffic between Lambda functions (or EC2 instance etc.) and AWS service endpoints stays on the AWS private network regardless, even if they’re logically routed via NAT and IGW.
> I understand that only Lambda would be placed within the VPC
Configuring a VPC for a Lambda function doesn’t “place” the function in your VPC. Lambda functions always execute in Amazon managed accounts. What configuring a VPC for a function does is cause the creation of a Hyperplane ENI which acts as a bridge between the Amazon account and the VPC in your account. And as for the belief I’ve seen expressed in comments that using a VPC and VPC Service Endpoints keeps your AWS API traffic from going over the public internet unlike when using public endpoints, I’m pretty sure when using public endpoints while running in Amazon your AWS API traffic never leaves their network.