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
In a serverless function, who patches the underlying operating system and runtime host?
- The cloud provider
- The function's developer
- The end user calling the API
- 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.
Which are valid event sources that can carry untrusted input into a function?
- An API gateway HTTP request body
- A message from a queue
- The configured memory size
- The name of an uploaded storage object
- 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: 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.
