Non-FictionAnnual CheckupServerless

Serverless Security Review eBook

Document function as a service misconfigurations a

by Mcrae Theodora

  • English
  • 143 pages
  • 2026
  • SamEnrico

Document function as a service misconfigurations and privilege escalations.

Formats

Free sample

Chapter 1: The $80 Million Permission--–- The notification arrived at 3:47 AM on a Tuesday. Sarah, the on-call security engineer for a fast-growing fintech startup, glanced at her phone expecting the usual false positive. Instead, she saw something she had never encountered in three years of cloud security: a Cloud Trail alert showing that a Lambda function named image-resize-prod had just called iam:Create Access Key. The same function that for eighteen months had done nothing but convert JPEGs to thumbnails was now creating new administrator credentials. By the time Sarah authenticated to the AWS console, the attacker had already launched fourteen cryptocurrency mining instances across three regions.

The company's cloud bill for that single hour: $47,000. The total cost after investigation, customer notification, legal fees, and lost valuation: over $80 million.This is not a hypothetical scenario. It is a composite drawn from three real serverless breaches that occurred between 2021 and 2024, anonymized to protect the companies involved. In each case, the root cause was not a zero-day vulnerability, not a sophisticated nation-state attack, and not a failure of the cloud provider's infrastructure. In each case, the root cause was a misconfiguration—an overly permissive IAM role attached to a function that should have only been able to read images from an S3 bucket.Welcome to serverless security in the modern era.

If you picked up this book, you already suspect that serverless architectures are fundamentally different from traditional servers. You may have heard that functions are "ephemeral," that the cloud provider handles "everything," or that serverless is "inherently more secure." Some of these statements contain grains of truth. Others are dangerous myths that have already cost organizations millions.This chapter dismantles the most pervasive of these myths: the idea that moving to serverless means moving away from security responsibility. It establishes the core foundation upon which the entire book is built—that in serverless, the security perimeter has shifted from the network and operating system to three things: function code, configuration, and IAM identity. By the end of this chapter, you will understand exactly why the $80 million permission was possible, why the industry's traditional security tools fail in serverless environments, and why the OWASP Serverless Top 10 exists as a warning to anyone deploying functions without a review process.The Shared Responsibility Lie (And the Truth)Every cloud provider publishes a "Shared Responsibility Model" diagram.

AWS has one. Azure has one. GCP has one. They typically look like a simple table with two columns: "Provider Responsibility" and "Customer Responsibility." At first glance, the message seems reassuring: the provider handles the hard stuff (physical hardware, hypervisors, network infrastructure), and the customer handles the easy stuff (code, data, access policies).This model is not a lie. It is technically accurate.

But it is dangerously incomplete.The problem is that the Shared Responsibility Model, as typically presented, omits the grey zones—those areas where provider and customer responsibilities overlap, creating gaps that attackers consistently exploit. In serverless architectures, the most critical grey zone is the metadata endpoint.Let us examine a concrete example. When you deploy an AWS Lambda function, it automatically receives an IAM role (temporary credentials) via a local metadata endpoint at 169.254.170.2. Azure Functions have a similar mechanism via the IDENTITY_ENDPOINT (typically 169.254.169.254). Google Cloud Functions use metadata.google.internal.

These endpoints are provider-managed infrastructure. The cloud provider is responsible for their availability, uptime, and basic security.However—and this is the crucial nuance that the Shared Responsibility Model fails to capture—the provider cannot prevent your function from making HTTP requests to these endpoints. The function itself has legitimate access to its own metadata endpoint. If an attacker can achieve Remote Code Execution (RCE) or Server-Side Request Forgery (SSRF) within your function, they can query that endpoint and exfiltrate the function's credentials.Who is responsible for preventing this? The provider cannot patch your code.

You cannot reconfigure the metadata endpoint to ignore requests from your own function. The answer is that both parties share responsibility in a way that neither standard model describes. The provider secures the endpoint's integrity. You secure the function's code against SSRF and RCE. The gap between these two responsibilities is where breaches happen.Throughout this book, we will refer to this as the Shared Responsibility Gap.

It is not a flaw in the cloud providers' security. It is a recognition that traditional security models were designed for static infrastructure, not ephemeral, event-driven functions. The first step toward securing serverless is accepting that you cannot delegate security entirely to your provider.The Function as a Bundle: A New Mental Model Before we can review serverless security, we need a shared language for what we are reviewing. Most security engineers think of a serverless function as code—a few hundred lines of Python or Node.js that runs when triggered. This mental model is incomplete and dangerous.A serverless function is not just code.

It is a bundle of three inseparable components:Runtime Code: The actual logic written in your chosen language (Python, Node.js, Go, Java, etc.). This includes your code and every third-party library you import.Configuration: The Infrastructure as Code (Ia C) definition that specifies triggers (S3 events, HTTP endpoints, Pub/Sub messages), memory allocation, timeout values, environment variables, and VPC settings. In practice, this is your serverless.yaml, template.yaml, or Terraform configuration.IAM Identity: The role attached to the function, which determines what cloud resources the function can read, write, or delete.You cannot secure a function by reviewing only one of these components. A perfectly written function with no vulnerabilities is still a liability if its IAM role has Action: "*" and Resource: "*" (full admin access). A perfectly locked-down IAM role is worthless if the function's code contains an SSRF vulnerability that allows an attacker to query the metadata endpoint.

A secure function and role are useless if the configuration exposes an HTTP trigger to the public internet without authentication.The Function as a Bundle means that every security review must examine all three components together. This book is organized around this principle. Part I (Chapters 1-2) establishes the foundation of the bundle. Part II (Chapters 3-5) examines each component's common misconfigurations. Part III (Chapters 6-7) shows how attackers chain vulnerabilities across components.

Part IV (Chapters 8-9) provides review methodologies. Part V (Chapters 10-11) covers detection and response.Why Traditional Security Tools Fail Serverless If you have worked in cloud security for more than a year, you have a toolkit. Perhaps you use vulnerability scanners like Nessus or Qualys. Maybe you rely on endpoint detection and response (EDR) agents like Crowd Strike or Carbon Black. You might have invested in a web application firewall (WAF) or a cloud security posture management (CSPM) tool.None of these tools work effectively for serverless functions.

Understanding why is essential to avoid wasting budget on false confidence.Vulnerability scanners assume persistent infrastructure. They need an IP address or a hostname to scan. A serverless function has neither—it spins up, executes, and terminates in milliseconds. By the time your scanner finds the function, it is already gone. Some scanners attempt to discover functions via cloud provider APIs, but they cannot scan the function's runtime behavior because there is no persistent runtime to…

This is the end of the free sample. Get the eBook to keep going. Buy now

About this book

Document function as a service misconfigurations and privilege escalations.

Details

Author
Mcrae Theodora
Publisher
SamEnrico
Language
English
Genre
Non-Fiction, Annual Checkup, Serverless
Released
2026-06-09
Pages (approx.)
143
Available as
eBook, Audiobook

Read better in the ZLOADR app

Your eBooks on your phone or tablet. Sign in with your SamEnrico account and start reading.

More by Mcrae Theodora

See all

You may also like

See all