How do Lambdas work? • Security and risk assessment • Case 1: Abusing environment secrets • Case 2: Abusing request forgery + demo • Case 3: Avoiding fork bombs • Questions and feedback Agenda 3
in response to events and automatically manages the compute resources, making it the fastest way to turn an idea into a modern, production, serverless applications. What are AWS Lambdas? 4
ops. No need to provision additional resources, k8s- clusters, schedulers • Speed. Lambda functions provide cached runtime • Scalability. Let your CSP handle the scaling Why go serverless? 12
= logging.getLogger() logger.setLevel(logging.INFO) def lambda_handler(event, context): # main code goes here… Init section Function-handler of the event Your_code.zip context includes: • function ARN • CloudWatch log group name • Lambda request ID event holds the data of request
Server Side Request Forgery Rami McCarthy on Lamda risks 1. backdoor Lambda 👉 leak subsequent events via RCE* 2. retrieve the source via RCE* 3. retrieve environment variables, given a fi le read vulnerability or SSRF** 4. given permission to invoke the function, view its logs 5. generate a fork bomb 19
any other direct executions • AWS_SESSION_TOKEN, AWS_SECRET_ACCESS_KEY, AWS_ACCESS_KEY_ID should be kept in secret!! Abusing environment secrets Lessons learned 23
Con fi gure logging inside Lambda • Create a billing alarm per service • Limit concurrent executions (if possible) Avoiding fork bombs Lessons learned 30