Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AWS Lambda: Is it secure to store data on AWS Lambda local Disk?

I have following basic security related questions regarding AWS Lambda service:

  1. Where does AWS Lambda store data if for example I try to store data on local disk?
  2. Is is possible to encrypt the data on Lambda?

Thanks

like image 767
obaid Avatar asked Feb 03 '16 16:02

obaid


People also ask

Is Lambda storage encrypted?

Lambda always encrypts files that you upload to Lambda, including deployment packages and layer archives. Amazon CloudWatch Logs and AWS X-Ray also encrypt data by default, and can be configured to use a customer managed key.

Can we store data in AWS Lambda?

Today, we are announcing that AWS Lambda now allows you to configure ephemeral storage ( /tmp ) between 512 MB and 10,240 MB. You can now control the amount of ephemeral storage a function gets for reading or writing data, allowing you to use AWS Lambda for ETL jobs, ML inference, or other data-intensive workloads.

What is the best way to store the data used across multiple Lambda functions?

Amazon EFS for Lambda Amazon EFS is a fully managed, elastic, shared file system that integrates with other AWS services. It is durable storage option that offers high availability. You can now mount EFS volumes in Lambda functions, which makes it simpler to share data across invocations.


2 Answers

One important sidenote to the /tmp of Lambda functions is that the Lambda function containers are re-used and scratch space is not always erased. If an invocation uses a container that was spun up because of a previous invocation (this happens if you execute a few Lambda function in quick succession), the scratch space is shared.

This screwed up a functionality for me once.

like image 56
Luc Hendriks Avatar answered Oct 16 '22 07:10

Luc Hendriks


I store temporary data in my lambda function, never had any issue.

  • Store your data in /tmp, you may not have access to other dirs
  • The temporary data - as the name indicates - is available only for that invocation of lambda
  • If the data is sensitive, encrypt it (if the encryption libraries are not provided by default for that language, make sure you package the library)
like image 20
helloV Avatar answered Oct 16 '22 07:10

helloV