EC2 Instance Connect
| eventName | Description | Sample | Rule |
|---|---|---|---|
| any | Catch-all entry for EC2 Instance Connect rules that match the service but not a specific eventName. | N | N |
| Send | Pushes an SSH public key to the specified EC2 instance to allow SSH access over the instance's serial console port. | N | Y |
| Send | Pushes an SSH public key to the specified EC2 instance so it is available for a short period for SSH authentication. | Y | Y |
any: EC2 Instance Connect (catch-all)
#Description
Catch-all entry for EC2 Instance Connect rules that match the service but not a specific eventName.
SendSerialConsoleSSHPublicKey
#Description
Pushes an SSH public key to the specified EC2 instance to allow SSH access over the instance's serial console port.
Detection Rules #
Full rule details for this event, including ATT&CK technique mappings and native queries →Elastic #
T1021, T1021.004, T1098, T1098.004↳ also matches SendSSHPublicKey
SendSSHPublicKey
#Description
Pushes an SSH public key to the specified EC2 instance so it is available for a short period for SSH authentication.
Example CloudTrail Event #
{
"eventVersion": "1.11",
"userIdentity": {
"type": "Root",
"principalId": "123456789012",
"arn": "arn:aws:iam::123456789012:root",
"accountId": "123456789012",
"accessKeyId": "AKIAIOSFODNN7EXAMPLE"
},
"eventTime": "2026-07-28T20:58:12Z",
"eventSource": "ec2-instance-connect.amazonaws.com",
"eventName": "SendSSHPublicKey",
"awsRegion": "us-west-1",
"sourceIPAddress": "203.0.113.5",
"userAgent": "aws-cli/2.34.28 md/awscrt#0.31.2 ua/2.1 os/linux#6.1.0-51-amd64 md/arch#x86_64 lang/python#3.14.3 md/pyimpl#CPython m/Z,E,n,b cfg/retry-mode#standard md/installer#exe md/distrib#debian.12 md/prompt#off md/command#ec2-instance-connect.send-ssh-public-key",
"errorCode": "EC2InstanceNotFoundException",
"errorMessage": "Instance not found.",
"requestParameters": {
"instanceId": "i-00000000000000000",
"instanceOSUser": "dw-harn-eb7866",
"sSHPublicKey": "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKXvZpvPoHPZlDzK0V8U6Bf0BAM4SsPX8iUu5V5y1g4t dw-harn-eb7866",
"availabilityZone": "us-west-1a"
},
"responseElements": null,
"requestID": "6aba5ce2-0fca-484c-8041-11170707134c",
"eventID": "14fb32e9-9f7c-4b2f-b544-adc9cb0cb1a1",
"readOnly": false,
"eventType": "AwsApiCall",
"managementEvent": true,
"recipientAccountId": "123456789012",
"eventCategory": "Management",
"tlsDetails": {
"tlsVersion": "TLSv1.3",
"cipherSuite": "TLS_AES_128_GCM_SHA256",
"clientProvidedHostHeader": "ec2-instance-connect.us-west-1.amazonaws.com"
}
}
Detection Rules #
Full rule details for this event, including ATT&CK technique mappings and native queries →Elastic #
T1021, T1021.004, T1098, T1098.004↳ also matches SendSerialConsoleSSHPublicKey Panther #
T1021.005