TA0002Tactic 4 of 15

Executionin cloud and AI environments

How do attackers run code in AWS once they have access?

ATT&CK v20.1Updated Official tactic page
Execution technique map22 techniques in Execution, 11 of them apply to cloud platforms. Highlighted: T1059.009, T1651, T1648, T1610, T1698, T1699.T1059T1610T1648T1651T1698T1699TA000222 TECHNIQUES
Key for cloud (this guide)Applies to cloud platformsOther platforms
22
Techniques
44
Sub-techniques
11
Apply to cloud platforms
4
Defensive controls
3
Detection signals

What the tactic means

Execution covers techniques that result in adversary-controlled code or commands running on a local or remote system. It is usually paired with other tactics — running a tool to discover the environment, or running code that steals credentials — and is the point where intent turns into action.

The adversary is trying to run malicious code or instructions on a system.

Execution consists of techniques that result in adversary-controlled code running on a local or remote system. Techniques that run malicious code are often paired with techniques from all other tactics to achieve broader goals, like exploring a network or stealing data. For example, an adversary might use a remote access tool to run a PowerShell script that does Remote System Discovery.

MITRE ATT&CK TA0002 description

Why it matters: cloud, AWS and AI

Cloud environments

In cloud, "execution" frequently means calling management APIs, running commands through administration services, deploying functions or containers, rather than running malware on a laptop.

AWS specifics

Examples: issuing AWS CLI / SDK calls (Cloud API), ssm:SendCommand against instances, creating Lambda functions, running ECS tasks or EKS pods, or modifying EC2 user data.

AI & workloads

ATT&CK now includes Direct (T1699) and Indirect (T1698) Prompt Injection under Execution: adversary instructions executed by an AI system. For agents with tools, that execution can translate into real API calls.

AWS API calls to know
  • ssm:SendCommand / ssm:StartSessionRun commands on managed instances.
  • lambda:CreateFunction / UpdateFunctionCodeRun code with the function’s execution role.
  • ecs:RunTaskLaunch containers with a chosen task role.

What the attacker is trying to achieve

  1. 01Run commands on instances
  2. 02Execute code with a borrowed role
  3. 03Deploy attacker-controlled workloads
  4. 04Steer AI agents through injected instructions

Techniques that matter most in cloud

What it needs, and what breaks it

Attacker needs

  • Credentials or influence over a system that can execute

Defenders control

  • Restrict SSM command and session permissions by tag
  • Constrain iam:PassRole for compute services
  • Pod security and admission controls
  • Restrict AI agent tools after untrusted input; human approval for actions

Detection signals and telemetry

Signal
  • SendCommand / StartSession by unexpected principals

    CloudTrailSession Manager logs
  • Function creation or code changes outside pipelines

    CloudTrail
  • Agent tool calls with parameters from untrusted content

    Agent audit logs

For leadership

What this means for the business

In cloud, the ability to execute is granted by permissions. Every identity able to run commands on production systems or deploy code is part of the production attack surface.

Common misconceptions

Myth

“Without malware there is no execution.”

Reality

Cloud attacks often execute entirely through legitimate APIs and administrative services.

Practical security checklist

0 of 3 done

Saved only in this browser. Nothing is sent to Securitain.

Related attack scenarios

Where Securitain fits

  • Securitain can assess todayPrivilege-escalation risk analysis for supported combinations such as iam:PassRole with Lambda, EC2, ECS or CloudFormation. Learn more
  • Securitain can assess todayEffective-permission view that considers managed, inline, group, boundary and SCP policies together. Learn more
  • Outside Securitain’s current scopeSecuritain does not perform prompt-injection testing, agent execution tracing or AI-specific scanning. It can review the AWS IAM permissions an agent’s role holds, which bounds what a manipulated agent could do.

Official sources and references

MITRE ATT&CK® and ATT&CK® are registered trademarks of The MITRE Corporation. ATT&CK data © 2026 The MITRE Corporation. This work is reproduced and distributed with the permission of The MITRE Corporation (ATT&CK v20.1). Securitain is not affiliated with or endorsed by MITRE. Explanations, scenarios and control mappings on this page are Securitain’s own analysis. Sources and licensing

Stay in the loop

Cloud security insights, early access & compliance updates

Weekly InsightsEarly AccessExpert Content
No spam, everUnsubscribe anytimeWeekly updates
Chat with Securitain