<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Elastic Compute Cloud (EC2) — CraftedSignal Threat Feed</title><link>https://feed.craftedsignal.io/products/elastic-compute-cloud-ec2/</link><description>Trending threats, MITRE ATT&amp;CK coverage, and detection metadata — refreshed continuously.</description><generator>Hugo</generator><language>en</language><managingEditor>hello@craftedsignal.io</managingEditor><webMaster>hello@craftedsignal.io</webMaster><lastBuildDate>Thu, 19 Dec 2024 00:00:00 +0000</lastBuildDate><atom:link href="https://feed.craftedsignal.io/products/elastic-compute-cloud-ec2/feed.xml" rel="self" type="application/rss+xml"/><item><title>Suspicious AWS EC2 Key Pair Import Activity</title><link>https://feed.craftedsignal.io/briefs/2024-12-aws-key-pair-import/</link><pubDate>Thu, 19 Dec 2024 00:00:00 +0000</pubDate><author>hello@craftedsignal.io</author><guid isPermaLink="true">https://feed.craftedsignal.io/briefs/2024-12-aws-key-pair-import/</guid><description>The import of SSH key pairs into AWS EC2, as detected by CloudTrail logs, may indicate unauthorized access attempts, persistence establishment, or privilege escalation by an attacker.</description><content:encoded><![CDATA[<p>The unauthorized import of SSH key pairs into Amazon Elastic Compute Cloud (EC2) is a technique that malicious actors can leverage to gain unauthorized access to EC2 instances. By importing their own key pairs, attackers can bypass existing security measures and gain persistent access to compromised systems. This activity is often part of a broader attack campaign aimed at compromising sensitive data, disrupting services, or establishing a foothold within an organization&rsquo;s cloud infrastructure. The initial publication of the detection rule was in December 2024, highlighting the ongoing relevance of this technique in cloud security. Monitoring for this activity can help defenders identify and respond to potential security breaches in a timely manner.</p>
<h2 id="attack-chain">Attack Chain</h2>
<ol>
<li>An attacker gains initial access to an AWS account, potentially through compromised credentials or exploiting a misconfigured IAM role.</li>
<li>The attacker attempts to enumerate existing EC2 instances to identify potential targets.</li>
<li>The attacker generates or obtains an SSH key pair, which they intend to use for unauthorized access.</li>
<li>The attacker uses the <code>ImportKeyPair</code> API call within the EC2 service to import the generated or obtained SSH key pair.</li>
<li>The attacker modifies the EC2 instance&rsquo;s configuration to associate the newly imported key pair with the instance. This might involve stopping and restarting the instance.</li>
<li>The attacker uses the imported SSH key pair to gain SSH access to the EC2 instance.</li>
<li>Once inside the instance, the attacker attempts to escalate privileges and move laterally within the AWS environment.</li>
<li>The attacker exfiltrates sensitive data, deploys malware, or disrupts critical services.</li>
</ol>
<h2 id="impact">Impact</h2>
<p>A successful key pair import can lead to complete compromise of the affected EC2 instances, potentially impacting dozens of servers depending on the environment. Sensitive data stored on or accessible from these instances could be exfiltrated, leading to financial loss, reputational damage, and regulatory fines. Furthermore, compromised instances can be used as a launchpad for further attacks within the AWS environment, leading to a wider breach. The financial impact can range from tens of thousands to millions of dollars, depending on the scale of the breach and the sensitivity of the data compromised.</p>
<h2 id="recommendation">Recommendation</h2>
<ul>
<li>Deploy the provided Sigma rule to your SIEM to detect <code>ImportKeyPair</code> events in CloudTrail logs (logsource: aws, service: cloudtrail).</li>
<li>Review IAM policies to ensure that only authorized users and roles have the necessary permissions to import key pairs (eventSource: &rsquo;ec2.amazonaws.com&rsquo;, eventName: &lsquo;ImportKeyPair&rsquo;).</li>
<li>Investigate any detected <code>ImportKeyPair</code> events, validating the user identity, user agent, and source IP address to ensure they are expected (detection block).</li>
<li>Implement multi-factor authentication (MFA) for all AWS accounts to reduce the risk of credential compromise.</li>
</ul>
]]></content:encoded><category domain="severity">medium</category><category domain="type">advisory</category><category>aws</category><category>cloudtrail</category><category>ec2</category><category>keypair</category><category>initial-access</category><category>persistence</category><category>privilege-escalation</category></item><item><title>AWS VPC Flow Logs Deletion for Defense Evasion</title><link>https://feed.craftedsignal.io/briefs/2024-01-03-aws-vpc-flow-logs-deleted/</link><pubDate>Wed, 03 Jan 2024 12:00:00 +0000</pubDate><author>hello@craftedsignal.io</author><guid isPermaLink="true">https://feed.craftedsignal.io/briefs/2024-01-03-aws-vpc-flow-logs-deleted/</guid><description>An adversary may delete VPC Flow Logs in AWS EC2 by calling the DeleteFlowLogs API to evade detection and hinder forensic investigations.</description><content:encoded><![CDATA[<p>An adversary with sufficient privileges within an AWS environment may attempt to delete VPC Flow Logs. These logs are crucial for monitoring network traffic within a VPC, and their removal can significantly impede incident response and forensic investigations. The deletion is accomplished by making a <code>DeleteFlowLogs</code> API call. This action is often taken to remove evidence of malicious activity, such as lateral movement, command and control communication, or data exfiltration. The impact of this activity can be severe, potentially allowing attackers to operate undetected for extended periods.</p>
<h2 id="attack-chain">Attack Chain</h2>
<ol>
<li>The attacker gains initial access to the AWS environment through compromised credentials or an exploited vulnerability (not detailed in source).</li>
<li>The attacker escalates privileges within the AWS environment to gain the necessary permissions to delete VPC Flow Logs (not detailed in source).</li>
<li>The attacker uses the AWS CLI or AWS Management Console to execute the <code>DeleteFlowLogs</code> API call.</li>
<li>The attacker identifies the specific Flow Log IDs that need to be deleted.</li>
<li>The attacker authenticates to the AWS API using stolen or generated credentials.</li>
<li>The <code>DeleteFlowLogs</code> API call is made, specifying the Flow Log IDs to be deleted.</li>
<li>AWS processes the request and deletes the specified VPC Flow Logs.</li>
<li>The attacker verifies the deletion of the Flow Logs to ensure that their actions are no longer being logged.</li>
</ol>
<h2 id="impact">Impact</h2>
<p>Successful deletion of VPC Flow Logs prevents security teams from detecting malicious activity within the AWS environment. Without these logs, it becomes significantly more difficult to investigate security incidents, track attacker movements, and understand the scope of a compromise. This can lead to delayed incident response, increased dwell time for attackers, and greater overall damage. The absence of flow logs severely limits network visibility, hindering any attempt to reconstruct events or identify compromised assets.</p>
<h2 id="recommendation">Recommendation</h2>
<ul>
<li>Implement the Sigma rule &ldquo;AWS VPC Flow Logs Deleted&rdquo; to detect instances of <code>DeleteFlowLogs</code> API calls (reference: rules section).</li>
<li>Monitor CloudTrail logs for <code>DeleteFlowLogs</code> events and investigate any unexpected occurrences (reference: logsource).</li>
<li>Enforce the principle of least privilege to restrict IAM users and roles from having the <code>ec2:DeleteFlowLogs</code> permission unless absolutely necessary.</li>
<li>Implement multi-factor authentication (MFA) for all AWS accounts, especially those with administrative privileges.</li>
<li>Regularly review and audit IAM policies to ensure that permissions are appropriately scoped and not overly permissive.</li>
</ul>
]]></content:encoded><category domain="severity">high</category><category domain="type">advisory</category><category>cloud</category><category>aws</category><category>defense-evasion</category><category>vpc</category><category>flow-logs</category></item></channel></rss>