T1021.008 IBM QRadar · QRadar

Detect Direct Cloud VM Connections in IBM QRadar

Adversaries may leverage Valid Accounts to log directly into cloud-hosted virtual infrastructure using cloud-native connection methods. Cloud providers offer interactive console access to VMs that bypasses traditional network controls: Azure Serial Console, AWS EC2 Instance Connect, AWS Systems Manager Session Manager (SSM), and GCP OS Login. These methods authenticate via the cloud IAM layer rather than network credentials, can bypass firewall rules and security groups, and often provide SYSTEM or root-level access by default. Adversaries who compromise cloud IAM credentials can pivot to VM instances using these native APIs, even when SSH/RDP is blocked at the network level.

MITRE ATT&CK

Tactic
Lateral Movement
Technique
T1021 Remote Services
Sub-technique
T1021.008 Direct Cloud VM Connections
Canonical reference
https://attack.mitre.org/techniques/T1021/008/

QRadar Detection Query

IBM QRadar (QRadar)
sql
SELECT
  DATEFORMAT(starttime, 'YYYY-MM-dd HH:mm:ss') AS event_time,
  username AS caller_identity,
  sourceip AS source_ip,
  "EventName" AS action_performed,
  "EventSource" AS cloud_service,
  COALESCE("TargetInstanceId", "RequestParameters_target") AS target_vm,
  "OperationName" AS azure_operation,
  LOGSOURCENAME(logsourceid) AS log_source_name,
  CATEGORYNAME(category) AS event_category
FROM events
WHERE (
  (
    "EventSource" IN (
      'ssm.amazonaws.com',
      'ec2-instance-connect.amazonaws.com'
    )
    AND "EventName" IN (
      'StartSession',
      'ResumeSession',
      'TerminateSession',
      'SendCommand',
      'StartAutomationExecution',
      'SendSSHPublicKey',
      'StartSSHSession'
    )
  )
  OR (
    "OperationName" ILIKE '%VIRTUALMACHINES/RUNCOMMAND/ACTION%'
    OR "OperationName" ILIKE '%SERIALCONSOLE/CONSOLESERVICES/ACCESS%'
    OR "OperationName" ILIKE '%VIRTUALMACHINES/EXTENSIONS/WRITE%'
  )
)
AND username IS NOT NULL
AND username <> ''
LAST 24 HOURS
ORDER BY starttime DESC
high severity high confidence

Detects direct cloud VM connection attempts via AWS SSM/EC2 Instance Connect and Azure Serial Console/Run Command. Relies on custom event properties (EventSource, EventName, TargetInstanceId, RequestParameters_target, OperationName) defined in QRadar's Custom Event Properties for the relevant AWS CloudTrail and Microsoft Azure Activity log source types. Ensure these custom properties are mapped in QRadar Admin > Custom Event Properties before deploying. The EventSource and EventName properties correspond to the cloudtrail eventSource and eventName JSON fields respectively. OperationName maps to the Azure Activity operationName.value field.

Data Sources

Amazon AWS CloudTrail (QRadar DSM)Microsoft Azure Platform Activity Logs (QRadar DSM)

Required Tables

events

False Positives & Tuning

  • Authorized cloud operations engineers performing routine maintenance via AWS SSM Session Manager, which is standard practice in environments that have eliminated direct SSH access to instances.
  • AWS Systems Manager Automation documents executing SendCommand or StartAutomationExecution during scheduled patch management windows or golden AMI bake pipelines.
  • Azure infrastructure automation (Terraform, Bicep, ARM) deploying or updating VM extensions such as the Azure Monitor Agent, Log Analytics Agent, or custom script extensions during provisioning workflows.
Download portable Sigma rule (.yml)

Other platforms for T1021.008


Testing Methodology

Validate this detection against 4 adversary techniques from Atomic Red Team. Each test below lists the behaviour to exercise and the telemetry you should expect to see. Executable commands and cleanup steps are available with Pro.

  1. Test 1AWS SSM Send Command to EC2 Instance

    Expected signal: AWS CloudTrail event: eventName=SendCommand, eventSource=ssm.amazonaws.com, with instanceId, documentName, and parameters. CloudWatch Log stream for the command output (if session logging enabled). Source IP address recorded in CloudTrail.

  2. Test 2AWS EC2 Instance Connect (Temporary SSH Key Injection)

    Expected signal: AWS CloudTrail: SendSSHPublicKey event from ec2-instance-connect.amazonaws.com with instanceId, osUser, and publicKey fingerprint. Subsequent SSH connection attempt to the instance.

  3. Test 3Azure Run Command on VM

    Expected signal: Azure Activity Log: MICROSOFT.COMPUTE/VIRTUALMACHINES/RUNCOMMAND/ACTION operation by the executing identity. The script content is visible in the Properties field. Source IP recorded in httpRequest.clientIpAddress.

  4. Test 4Start AWS SSM Session Manager Interactive Session

    Expected signal: AWS CloudTrail: StartSession event from ssm.amazonaws.com with target instanceId, sessionId, and caller identity. Session logs in CloudWatch if session logging enabled. Note: interactive session content is only captured if session logging is configured.

Unlock Pro Content

Get the full detection package for T1021.008 including response playbook, investigation guide, and atomic red team tests.

Response PlaybookInvestigation GuideHunting QueriesAtomic Red Team TestsTuning Guidance

Related Detections