Serverless Application Security
Serverless application security addresses the distinct threat surface created when applications run on cloud-provider-managed execution environments — such as AWS Lambda, Azure Functions, and Google Cloud Functions — where the underlying infrastructure is abstracted away from the deploying organization. The security model shifts from perimeter and host controls toward function-level permissions, event-source validation, and dependency chain integrity. This page covers the definition and scope of serverless security, how its controls operate, the scenarios in which it arises, and the boundaries that separate it from adjacent application security disciplines covered in the Application Security Providers.
Definition and scope
Serverless computing, as defined by the National Institute of Standards and Technology (NIST) under its cloud service model taxonomy (NIST SP 800-145), delegates infrastructure provisioning, OS patching, and runtime scaling entirely to the cloud provider. The application owner retains responsibility for function code, configuration, identity and access management (IAM) bindings, and the integrity of third-party packages bundled into the deployment artifact.
Serverless security is a subdomain of application security that focuses on four structural control areas:
- Function-level IAM — enforcing least-privilege execution roles so that a compromised function cannot pivot to unintended cloud resources.
- Event source validation — authenticating and sanitizing inputs arriving from triggers such as API gateways, message queues (e.g., Amazon SQS), object storage events, and streaming services (e.g., AWS Kinesis).
- Dependency and supply chain integrity — vetting open-source packages bundled into deployment artifacts, which the OWASP Top Ten classifies under A06:2021 – Vulnerable and Outdated Components.
- Secrets and environment variable management — preventing credential exposure in function configuration, deployment logs, or error outputs.
The scope does not include container orchestration security (e.g., Kubernetes hardening) or traditional web application firewall (WAF) configuration, both of which assume a persistent host layer that serverless architecture eliminates.
How it works
Serverless security controls operate at the intersection of cloud-provider IAM, runtime behavior monitoring, and CI/CD pipeline gates. The operational model proceeds through five discrete phases:
-
Design-time threat modeling — mapping each function's trigger sources, data flows, and downstream API calls to identify over-permissioned roles and injection vectors before code is written. NIST SP 800-53 Rev. 5 Control SA-11 (csrc.nist.gov) requires developer security testing for federal systems, and the same structured approach applies to serverless functions handling regulated data.
-
Static analysis of function code — applying Static Application Security Testing (SAST) tools to function source before deployment. Because serverless functions are typically compact — often under 500 lines of code — SAST coverage per function is high relative to monolithic codebases.
-
Dependency scanning — auditing third-party libraries using Software Composition Analysis (SCA). A single Lambda deployment package may bundle dozens of npm or PyPI packages, each representing a supply chain exposure point cataloged in the NIST National Vulnerability Database (NVD).
-
IAM policy enforcement — validating that execution roles follow least privilege. AWS IAM Access Analyzer, for example, can flag policies granting wildcard (
*) permissions on sensitive resource types. The Cloud Security Alliance (CSA) Cloud Controls Matrix (CCM) addresses this under the Identity and Access Management (IAM) control domain. -
Runtime monitoring and anomaly detection — capturing invocation logs, unusual data volumes, and unexpected outbound network calls through cloud-native observability tooling. Unlike containerized workloads, serverless functions produce ephemeral execution contexts, making log aggregation the primary forensic surface.
Common scenarios
Serverless security requirements emerge in three recurring operational scenarios, each carrying distinct control obligations:
Scenario 1 — Payment processing microservices. Functions that tokenize or transmit cardholder data fall under PCI DSS Requirement 6.2.4, which mandates that custom software be protected against known attack techniques. A single serverless function acting as a payment webhook must have its event-source authentication, input validation, and IAM scope independently assessed.
Scenario 2 — Healthcare data pipelines. HIPAA's Security Rule (45 CFR §164.312) requires access controls and audit controls for systems handling electronic protected health information (ePHI). Serverless data-processing pipelines that ingest, transform, or route ePHI must implement function-level logging and role isolation equivalent to what HIPAA-covered entities apply to traditional application tiers.
Scenario 3 — Federal cloud workloads under FedRAMP. FedRAMP authorization baselines, derived from NIST SP 800-53, apply to cloud services used by federal agencies. Serverless workloads operating within a FedRAMP boundary must satisfy the same control families — including SC-8 (Transmission Confidentiality), AC-6 (Least Privilege), and SI-10 (Information Input Validation) — as any other authorized system component.
The page describes how these regulatory categories map to the broader service landscape indexed on this platform.
Decision boundaries
Serverless security is frequently conflated with adjacent disciplines. Three boundaries define where it begins and ends:
Serverless vs. container security. Container security assumes a persistent OS layer, image scanning, and namespace isolation. Serverless execution environments discard the persistent OS abstraction; the provider manages runtime patches. Control responsibility shifts from image hardening to IAM and input validation — a meaningful architectural distinction documented in the CSA's Security Guidance for Critical Areas of Focus in Cloud Computing (CSA Security Guidance v4).
Serverless vs. API security. An API gateway fronting serverless functions requires its own authentication and rate-limiting controls, but API security addresses the gateway layer independently of function logic. A function can be correctly secured at the API boundary yet still be exploited through a second event trigger (e.g., an S3 upload event) that bypasses the gateway entirely.
Regulated vs. non-regulated deployments. Organizations outside PCI DSS, HIPAA, and FedRAMP perimeters face no statutory obligation to apply formal serverless security controls, but the OWASP Serverless Top 10 — an extension of OWASP's broader application security taxonomy — provides a non-regulatory baseline applicable to any serverless deployment regardless of compliance status.
Practitioners assessing serverless environments typically hold credentials such as the AWS Certified Security – Specialty or the GIAC Cloud Security Automation (GCSA) certification. The qualification landscape for these and adjacent roles is cataloged in the How to Use This Application Security Resource reference.
References
- FedRAMP Program – NIST SP 800-53 Baseline Controls
- HHS – HIPAA Security Rule, 45 CFR §164.312
- NIST National Vulnerability Database (NVD)
- NIST SP 800-145
- NIST SP 800-53 Rev. 5 – Security and Privacy Controls for Information Systems and Organizations
- CSA Security Guidance v4
- Cloud Controls Matrix (CCM)
- OWASP Serverless Top 10