Serverless security is the set of controls used to protect functions that run without customer managed servers. Because these workloads are short lived and highly automated, teams need scanning, identity controls, event aware monitoring, and runtime detection that can keep pace with rapid deployment and execution changes.
Expanded Definition
Serverless security focuses on the controls that protect event-driven functions, their triggers, and the identities they use when no customer-managed server exists to harden. In practice, the security boundary shifts from host control to code, identity, permissions, dependencies, configuration, and the event sources that invoke execution. That makes it closely related to NHI governance because function execution often relies on service accounts, API keys, temporary tokens, or workload identities rather than human logins.
Definitions vary across vendors, but no single standard governs this yet: some teams treat serverless security as application security for functions, while others include cloud permission design, event validation, and runtime detection. NIST Cybersecurity Framework 2.0 is useful as a governance lens because it emphasises Identify, Protect, Detect, Respond, and Recover across changing environments, even when the infrastructure is abstracted away. In NHI terms, the issue is not the absence of servers, but the presence of highly privileged machine identities that can be misused if they are not tightly scoped and monitored.
The most common misapplication is assuming the cloud provider secures the entire serverless stack, which occurs when teams stop at platform availability and ignore function permissions, secrets, and event trust boundaries.
Examples and Use Cases
Implementing serverless security rigorously often introduces more deployment discipline, requiring organisations to weigh rapid delivery against stronger identity and event controls.
- A payment-processing function uses least-privilege permissions and short-lived credentials instead of broad access keys, reducing blast radius if the function is abused.
- An API gateway validates incoming events before invoking a function, preventing malformed or malicious payloads from triggering downstream actions.
- A CI/CD pipeline scans function code, dependencies, and environment variables for exposed secrets before deployment, then rotates credentials after release.
- A monitoring team correlates function invocations with identity signals and abnormal event patterns, using guidance from the NIST Cybersecurity Framework 2.0 to structure detection and response.
- Security teams use the Ultimate Guide to NHIs to assess where service identities, tokens, and rotation gaps increase risk in short-lived workloads.
In container-heavy and serverless estates, the same function may be redeployed many times per day, so event authenticity and identity scoping matter more than static host hardening. Where teams use managed identity federation or workload identity, the design should assume that every trigger is a potential abuse path unless explicitly trusted.
Why It Matters in NHI Security
Serverless environments magnify NHI risk because functions often depend on secrets, tokens, and service accounts that are easy to overprovision and hard to inventory. That matters when visibility is weak: NHI Mgmt Group research shows only 5.7% of organisations have full visibility into their service accounts, and 96% store secrets outside secrets managers in vulnerable locations including code, config files, and CI/CD tools. Those conditions are especially dangerous in serverless pipelines, where credentials can be copied into environment variables, function packages, or automation scripts and then propagated at machine speed.
The operational consequence is that one weak trigger, one leaked token, or one overbroad permission can turn a single function into a repeatable access path across data stores and internal APIs. This is why serverless security cannot be treated as an isolated application concern; it needs to be part of identity governance, secret rotation, and continuous detection, as described in the Ultimate Guide to NHIs. The same control model also aligns with the NIST Cybersecurity Framework 2.0, especially where automated response and recovery are needed after compromise.
Organisations typically encounter data exposure, privilege escalation, or unauthorized automation only after a function is abused in production, at which point serverless security becomes operationally unavoidable to address.
Standards & Framework Alignment
This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.
OWASP Non-Human Identity Top 10 and CSA MAESTRO address the attack and risk surface, while NIST CSF 2.0, NIST Zero Trust (SP 800-207) and NIST AI RMF set the governance and control requirements practitioners need to meet.
| Framework | Control / Reference | Relevance |
|---|---|---|
| OWASP Non-Human Identity Top 10 | NHI-02 | Serverless functions rely on non-human identities, secrets, and permissions that this control set targets. |
| NIST CSF 2.0 | PR.AC-4 | Serverless access control depends on managing permissions for automated workloads and event triggers. |
| NIST Zero Trust (SP 800-207) | SC-7 | Zero Trust emphasizes verifying each event and limiting implicit trust in serverless execution paths. |
| CSA MAESTRO | MAESTRO addresses identity, orchestration, and runtime safeguards for autonomous cloud workloads. | |
| NIST AI RMF | AI RMF is relevant where serverless functions host AI-enabled automation with changing risk conditions. |
Inventory function identities, eliminate long-lived secrets, and enforce least privilege for every invocation path.
Related resources from NHI Mgmt Group
- How should security teams govern serverless authorization services?
- What do security teams get wrong about externalized authorization in serverless?
- Why do containers and serverless functions create blind spots for endpoint security?
- How should security teams cover ephemeral containers and serverless workloads in multi-cloud environments?