The infrastructure definitions and the code for serverless applications are often only loosely connected. This yields a large error class: the referenced infrastructure components might not exist. It is also hard to keep the application and its permissions in sync. To address this problem we present an infrastructure from code solution where we provision cloud infrastructure from Wasm Interface Type (WIT) - the language defining the interface of WebAssembly components. We limit ourselves to the basic example of an AWS Lambda function accessing S3 buckets. We build two interpreters for the WIT language: one that derives the definition of S3 buckets as infrastructure as code and least-privilege IAM permissions, and a generic runtime that runs the component as a Lambda function and provides access to the S3 buckets as capabilities. We formulate consistency properties that ensure the existence of the S3 buckets and correct permissions of the Lambda, and provide evidence that our interpreters satisfy them. We show how selected failures for deployment of such cloud components can be prevented using our technique and how a baseline setup fails at this task. Together with the strict sandboxing of the WebAssembly runtime we achieve an instance of capability-based security for access to AWS infrastructure as a further result.
翻译:暂无翻译