How can I prevent a Python script running in an AWS Lambda from accessing the filesystem?

  Kiến thức lập trình

I’m developing a Lambda function on AWS that processes data, but I want to ensure that the Python code cannot access the filesystem for security purposes. Is there any configuration or recommended practice to restrict filesystem access within an AWS Lambda?

I’ve attempted to use containers and chroot to restrict the Lambda’s filesystem access, however, the AWS Lambda environment limits access to these tools, I’ve read about seccomp and SELinux, but i believe there will be no sucess due to restrictions. Is there any way I can prevent this script from acessing other files?

New contributor

Nicolas Avansi is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.