Bitzu

312-50 ยท Cloud computing security

Serverless (Function-as-a-Service) security

Function-as-a-service model, event injection, over-privileged roles, dependency risks, monitoring and secrets handling.

Key points

  • The provider runs servers; short-lived functions are triggered by events (HTTP, queues, storage).
  • Event-data injection: any event field can carry untrusted input, not only HTTP.
  • Also over-privileged execution roles, vulnerable dependencies, secrets in environment variables or code, weak logging.
  • Defenses: validate every event source, one least-privilege role per function, dependency scanning, a secrets manager, centralized logs and alerts.

Source: https://docs.aws.amazon.com/cli/latest/reference/lambda/get-function-configuration.html

Practice questions

Single choice

In a serverless function, who patches the underlying operating system and runtime host?

  1. The cloud provider
  2. The function's developer
  3. The end user calling the API
  4. The security team on weekends
Show answer

Answer: A. The cloud provider

The provider manages the host OS and infrastructure; the customer remains responsible for function code, its dependencies, configuration and permissions.

Select all that apply

Which are valid event sources that can carry untrusted input into a function?

  1. An API gateway HTTP request body
  2. A message from a queue
  3. The configured memory size
  4. The name of an uploaded storage object
  5. The deployment region label
Show answer

Answer: A. An API gateway HTTP request body, B. A message from a queue, D. The name of an uploaded storage object

Queue messages and storage object names are attacker-influenceable just like HTTP bodies. The function's memory setting and region are configuration values, not input channels.

True or false

True or false: because serverless has no servers to manage, input validation is no longer needed.

Show answer

Answer: False

False. Injection flaws live in your function code and can arrive through any event source; the provider does not sanitise your inputs.

Practice 8 questions on this topic in Bitzu

Short lessons, instant explanations and spaced review of what you get wrong. Free on iOS and Android.

Download on the App StoreGet it on Google Play

More 312-50 topics in this module