Research background

A serverless application can keep answering requests while its cloud bill climbs. A tenant pays for both the number of invocations and the compute resources those invocations consume. A Denial-of-Wallet attack (DoW) can therefore raise costs in two ways. It can increase the number of requests, or it can make each invocation more expensive while traffic volume stays close to its usual level. Both patterns are difficult to distinguish from ordinary changes in demand. A legitimate burst can raise the request rate, and a change in the mix of functions can increase memory use or execution time. Unified Logical Scoring (ULS) brings these observations together so an operator can see what changed and decide when to intervene.

Method

ULS mirrors traffic at the API gateway and monitors function execution without inspecting request payloads. As Figure 1 shows, a monitoring component extracts the time between requests, CPU and memory use, and the distribution of invocations across functions. The last signal captures a change that request counts alone can miss. A service may receive its usual number of requests while a growing share goes to one computationally expensive function. ULS architecture showing the path from mirrored gateway traffic through monitoring and scoring to alerts and throttling.

Figure 1. How ULS moves from passive observation to a traffic-control decision.
Figure 1. How ULS moves from passive observation to a traffic-control decision.

A lightweight sidecar computes an anomaly score for each observation. It compares that score with a boundary derived from the mean and standard deviation of recent scores. In the evaluated configuration, two consecutive scores above the boundary plus a margin can trigger an alert. ULS can also alert when CPU or memory crosses a guardrail. When a cumulative-sum statistic detects a sustained resource shift.

Main contributions

  1. Detection across functions and providers. ULS combines request timing, resource use, and invocation diversity using telemetry available on all four evaluated cloud platforms.
  2. A link between detection and spending. The cost model separates request charges from compute charges and distinguishes costs incurred before the first alert from costs that mitigation can still prevent.
  3. An evaluation across six workload patterns. The study tests a sustained increase in request rate, greater work per invocation, burstier arrivals, more concentrated function use, an external traffic flood, and slow drift.

Experimental results

ULS was implemented on AWS Lambda, Alibaba Cloud Function Compute, Google Cloud, and Microsoft Azure. Using four instances per platform with the same configuration, we compared 1 to 10 attack nodes per instance.

Detection accuracy

ULS achieved higher average detection accuracy with ten attack nodes per instance on all four platforms. Figure 2 shows the spread across instances. The largest difference between configurations was on Azure, where accuracy ranged from 95.28% to 97.07%, a gain of 1.79 percentage points.

Platform 1 attack node 10 attack nodes
AWS 96.16% 97.89%
Alibaba Cloud 95.82% 97.56%
GCP 96.25% 97.89%
Azure 95.28% 97.07%

(a), (b), (c), and (d) compare detection accuracy across four instances on each cloud platform for one and ten attack nodes per instance.

Figure 2. Detection accuracy across instances.
Figure 2. Detection accuracy across instances.

Time to the first alert

Across the four platforms, the median ULS detection delay ranged from 2.46 to 2.91 seconds, and the 95th percentile ranged from 5.21 to 6.03 seconds. ULS had the lowest delay at both percentiles on each platform among the six scenarios compared.

Figure 3. ULS responses to the six workload patterns.
Figure 3. ULS responses to the six workload patterns.

The workload pattern illustrated an external-flood episode (S4); ULS raised an alert after three seconds. In the slow-drift episode (S5), the score took longer to separate from its recent baseline, and the alert came after six seconds. The insets mark the interval between the known onset and the first alert in each panel.

About the authors

Sunit Mistry, Zinuo Cai, Ruhui Ma*, and Haibing Guan are affiliated with Shanghai Jiao Tong University, Shanghai, China; Frimpong Atta Junior Osei is with the University of Oregon, Eugene, Oregon, USA; Rajkumar Buyya is with the University of Melbourne, Melbourne, Victoria, Australia.