T1648 Serverless Execution
Adversaries may abuse serverless computing, integration, and automation services to execute arbitrary code in cloud environments. Many cloud providers offer a variety of serverless resources, including compute engines, application integration services, and web servers.
Adversaries may abuse these resources in various ways as a means of executing arbitrary commands. For example, adversaries may use serverless functions to execute malicious code, such as crypto-mining malware (i.e. Resource Hijacking).4 Adversaries may also create functions that enable further compromise of the cloud environment. For example, an adversary may use the IAM:PassRole
permission in AWS or the iam.serviceAccounts.actAs
permission in Google Cloud to add Additional Cloud Roles to a serverless cloud function, which may then be able to perform actions the original user cannot.56
Serverless functions can also be invoked in response to cloud events (i.e. Event Triggered Execution), potentially enabling persistent execution over time. For example, in AWS environments, an adversary may create a Lambda function that automatically adds Additional Cloud Credentials to a user and a corresponding CloudWatch events rule that invokes that function whenever a new user is created.2 Similarly, an adversary may create a Power Automate workflow in Office 365 environments that forwards all emails a user receives or creates anonymous sharing links whenever a user is granted access to a document in SharePoint.31
Item | Value |
---|---|
ID | T1648 |
Sub-techniques | |
Tactics | TA0002 |
Platforms | IaaS, Office 365, SaaS |
Version | 1.0 |
Created | 27 May 2022 |
Last Modified | 24 October 2022 |
Mitigations
ID | Mitigation | Description |
---|---|---|
M1018 | User Account Management | Remove permissions to create, modify, or run serverless resources from users that do not explicitly require them. |
Detection
ID | Data Source | Data Component |
---|---|---|
DS0015 | Application Log | Application Log Content |
DS0025 | Cloud Service | Cloud Service Modification |
References
-
Berk Veral. (2020, March 9). Real-life cybercrime stories from DART, the Microsoft Detection and Response Team. Retrieved May 27, 2022. ↩
-
Daniel Grzelak. (2016, July 9). Backdooring an AWS account. Retrieved May 27, 2022. ↩
-
Eric Saraga. (2022, February 2). Using Power Automate for Covert Data Exfiltration in Microsoft 365. Retrieved May 27, 2022. ↩
-
Matt Muir. (2022, April 6). Cado Discovers Denonia: The First Malware Specifically Targeting Lambda. Retrieved May 27, 2022. ↩
-
Rhino Security Labs. (n.d.). AWS IAM Privilege Escalation – Methods and Mitigation. Retrieved May 27, 2022. ↩
-
Spencer Gietzen. (n.d.). Privilege Escalation in Google Cloud Platform – Part 1 (IAM). Retrieved May 27, 2022. ↩
-
Microsoft. (2022, February 15). Email exfiltration controls for connectors. Retrieved May 27, 2022. ↩