CI/CD controls reduce pre-launch risk, but they do not stop attacks that emerge only when a function is running. Runtime threats such as code injection, serialization abuse, and misuse of the function as a pivot into other cloud resources occur after deployment. That makes live enforcement necessary for short-lived functions where persistence is limited but attacker action can still happen fast.
Why runtime protection matters after CI/CD has passed
CI/CD checks mainly reduce pre-deployment risk: they test code, scan dependencies, and enforce policy before release. runtime protection covers a different problem. Once a serverless function is invoked, attackers can target the live execution path, manipulate inputs, abuse deserialization, or turn the function into a stepping stone to other cloud services.
That distinction matters because serverless workloads are ephemeral and highly automated. A function can be deployed cleanly and still be compromised through behavior that only appears under live traffic, chained requests, or maliciously crafted event payloads. The control gap is between “approved to ship” and “safe while executing.”
For that reason, runtime controls are best treated as a live enforcement layer, not a duplicate of pipeline security. They need to detect suspicious execution patterns, constrain what the function can reach, and limit the blast radius if the function is abused after launch.
What runtime threats look like in short-lived functions
Serverless functions are attractive because they often inherit broad cloud permissions, consume secrets or tokens during execution, and connect to storage, queues, databases, or internal APIs. If an attacker gets code execution, or even just control over the inputs that the function trusts, they may pivot into those adjacent resources faster than a human can respond.
Common failure points include unsafe deserialization, command injection, SSRF-like outbound abuse, dependency poisoning that only matters at runtime, and overbroad permissions that turn a small function flaw into a larger cloud compromise. The short lifespan of the function does not remove the risk, it compresses the attack window.
Runtime protection therefore needs to watch what the function actually does, not only what the source code looked like during review. That includes access to secrets, unexpected network calls, unusual child process behavior, and deviations from the function’s normal request-to-action pattern.
How to think about CI/CD and runtime as separate control layers
CI/CD controls answer whether the artifact was built and approved correctly. Runtime protection answers whether the approved artifact is behaving safely in production. Those are related, but not interchangeable. A clean pipeline can still deliver a function that is later exploited through a live dependency, a malicious event payload, or a newly discovered abuse path.
In practice, the strongest model is defense in depth: build-time checks reduce the likelihood of introducing defects, while runtime enforcement limits what any defect can do after deployment. In serverless environments, that second layer is especially important because there is little manual intervention between invocation and impact.
NIST SP 800-190 Container Security is useful here because it reinforces the broader principle that application risk does not end at deployment and that runtime controls remain necessary even when build-stage checks are strong.
Risk and Threat Considerations
Serverless functions can expose cloud resources, credentials, and internal services the moment they are invoked, so a single runtime exploit can have outsized impact. The main risk is not just code compromise, but rapid post-deployment abuse that bypasses CI/CD entirely and uses the function’s own permissions against the environment.
Failure mechanism: An attacker exploits a live execution path, for example injection, unsafe deserialization, or overly permissive egress, then uses the function’s runtime context to reach secrets, data stores, or downstream services.
Impact: The function may become a pivot point for data access, lateral movement, or cloud resource abuse before the next deployment cycle or pipeline scan ever detects a problem.
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 and NIST CSF 2.0 set the governance and control requirements practitioners need to meet.
| Framework | Control / Reference | Relevance |
|---|---|---|
| NIST SP 800-53 Rev 5 | SI-4 — System Monitoring | Runtime protection needs live detection of suspicious function behavior and abuse. |
| AC-6 — Least Privilege | Serverless runtime risk grows when functions can reach more cloud resources than needed. | |
| SI-10 — Information Input Validation | Injection and malformed event payloads are core runtime threats for functions. | |
| Recommendation — Monitor function execution for anomalous calls, payloads, and privilege use. Constrain each function to the minimum permissions required at execution time. Validate and constrain all event inputs before they influence execution paths. | ||
| NIST CSF 2.0 | PR.AA-05 — Least Privilege | Runtime containment depends on limiting what a deployed function can access. |
| DE.CM-01 — Continuous Monitoring | Live function abuse requires monitoring beyond pre-release checks. | |
| Recommendation — Apply least-privilege access to every function identity and dependency. Continuously monitor runtime activity for abnormal execution and access patterns. | ||
| OWASP API Security Top 10 | API2 — Broken Authentication | Functions that expose or consume APIs can be abused at runtime through weak auth paths. |
| Recommendation — Harden authentication on function-facing APIs and internal service calls. | ||
Practitioner Guidance
What to prioritise: Treat runtime visibility and permission boundaries as mandatory for any function that can touch secrets, internal APIs, or privileged cloud services. If the function can reach something sensitive at runtime, assume CI/CD alone is insufficient.
What to verify: Confirm that live invocations are constrained by least privilege, that unexpected outbound calls are observable, and that the function cannot silently expand its reach through inherited roles or overly broad network access.
Practitioner takeaway: CI/CD reduces what you ship, runtime protection limits what a deployed function can do if it is ever turned against you.
Related resources from NHI Mgmt Group
- How should security teams implement runtime protection in CI/CD pipelines without slowing delivery workflows?
- Why do CI/CD pipelines need runtime monitoring instead of relying only on static checks and repository review?
- Why do Kubernetes workloads need runtime controls even after cluster configuration and image admission are already in place?
- What is the difference between code scanning and runtime identity monitoring?