Serverless is a cloud execution model where the provider runs and scales the infrastructure and customers deploy only code or functions, triggered by events. Security shifts to function identity and permissions, event input validation, secrets handling and dependencies. Over-privileged execution roles let a single compromised function reach other cloud resources.
What Serverless Means Operationally
Serverless is not “no servers”, it is a delivery model where the cloud provider absorbs infrastructure operation, scaling and much of the runtime management while teams deploy discrete functions or code paths. That shifts the security centre of gravity away from host hardening and toward what the function can do, what it can reach, and what inputs it will accept.
Because the provider manages the underlying compute layer, the practical security question becomes whether each function is tightly scoped to its job. In serverless systems, a small logic flaw, a weak permission boundary or a poor dependency choice can be enough to expose data, trigger unwanted actions, or allow a function to act far beyond its intended purpose.
Why Serverless Changes the Attack Surface
Serverless changes the attack surface by making event sources, API triggers, configuration and permissions more important than traditional server administration. The runtime is ephemeral, but the identities and permissions attached to functions are durable enough to create real exposure if they are too broad.
This is why serverless security often turns on least privilege, event trust and dependency hygiene. A function that is over-authorised may be used as a stepping stone into storage, messaging, databases or management APIs, especially if an attacker can influence the event payload or execute code through a vulnerable dependency.
It is also why serverless teams must treat secret handling carefully. Functions commonly rely on API keys, tokens and other secret material at runtime, and leaking that material can defeat the abstraction that serverless is supposed to provide. OWASP Non-Human Identity Top 10 is useful here because it frames the risk of overprivileged runtime identities, long-lived secrets and reuse patterns that are easy to miss in event-driven architectures.
Common Failure Modes in Serverless Systems
The most common failure modes are not infrastructure outages, but control failures around code, inputs and permissions. In practice, these include excessive execution roles, insecure event handling, unsafe deserialisation, dependency compromise and accidental exposure of secrets through environment variables, logs or configuration stores.
Serverless also creates failure modes around observability and blast radius. A function may be tiny, but it can still produce broad impact if it is triggered at scale, chained into multiple services, or allowed to invoke other privileged cloud functions. That is why the cloud control plane and identity layer matter more than they might in a conventional application deployment.
For governance and hardening, the Cloud Penetration Testing Guide is the right internal reference for understanding how authorised testing should follow cloud identity paths, test credentials and event-driven attack paths without breaking cloud-provider rules of engagement.
How to Secure Serverless Deployments
Secure serverless design starts with narrow permissions, explicit event validation and careful secret distribution. Functions should receive only the access they need, only for the resources they need, and only for the period they need it. Input from queues, APIs and webhooks should be validated as untrusted, even when it comes from an internal system.
Good serverless security also depends on dependency control and logging that can reconstruct what the function actually did. Because functions are short-lived, defenders often need stronger telemetry at the platform, API and data layers to compensate for limited host-level visibility. That makes configuration discipline and runtime monitoring part of the design, not an afterthought.
External guidance that directly supports these controls includes NIST SP 800-53 Rev 5 Security and Privacy Controls, OWASP API Security Top 10 and NIST Cybersecurity Framework 2.0, which together map well to access control, API exposure and security governance in event-driven cloud systems.
Risk and Threat Considerations
Serverless risk concentrates around mis-scoped permissions, exposed triggers and compromised dependencies. The danger is not the absence of servers, it is that a single compromised function can become a high-trust pivot if it can read secrets, call internal services or act on sensitive events.
Failure mechanism: Attackers or faulty code exploit broad execution roles, weak input handling or vulnerable libraries to make a function perform actions outside its intended trust boundary.
Impact: The result can be data exposure, unauthorised cloud resource access, secret theft, lateral movement across managed services, or abuse of the function as a repeatable execution point.
Standards & Framework Alignment
This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.
OWASP API Security Top 10 addresses the attack and risk surface, while NIST SP 800-53 Rev 5, NIST CSF 2.0 and CIS Controls v8 set the governance and control requirements practitioners need to meet.
| Framework | Control / Reference | Relevance |
|---|---|---|
| NIST SP 800-53 Rev 5 | AC-6 — Least Privilege | Serverless functions need tightly scoped permissions to limit cloud resource exposure. |
| Recommendation — Restrict function permissions to the minimum actions each event handler requires. | ||
| OWASP API Security Top 10 | API5 — Broken Function Level Authorization | Serverless often exposes function actions through APIs and event handlers with authorization boundaries. |
| Recommendation — Verify each function action is authorized independently of the caller's ability to reach the endpoint. | ||
| NIST CSF 2.0 | PR.AA-05 — Identity Management, Authentication, and Access Control | Serverless security depends on controlling function access, identity and permissions across cloud services. |
| PR.DS-02 — Data-in-Transit Is Protected | Serverless event flows and API-triggered data need protected transport between services. | |
| Recommendation — Apply access control so functions can only invoke the resources and operations they are permitted to use. Protect event and API traffic between functions and downstream services in transit. | ||
| CIS Controls v8 | CIS-6 — Access Control Management | Serverless platforms require disciplined access governance for function permissions and cloud resources. |
| Recommendation — Manage and review function permissions, service access and privilege assignment continuously. | ||
Practitioner Guidance
What to watch for: Treat every new function as an access decision, not just a deployment event. The practical test is whether its permissions, triggers, secrets and dependencies are all constrained enough that compromise of one function does not become compromise of the wider cloud estate.
Practitioner takeaway: In serverless environments, security quality is mostly determined before runtime, by the boundaries you design around identity, input and dependency trust.
Related resources from NHI Mgmt Group
Deepen Your Knowledge
Free weekly newsletter
Subscribe to the NHI & AI Identity Journal
The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.
Bonus 33% off our NHI Course when you subscribe.
Reviewed and updated by the NHIMG editorial team on November 26, 2026.
NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org