<?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>EKS IAM Roles for Service Accounts — CraftedSignal Threat Feed</title><link>https://feed.craftedsignal.io/products/eks-iam-roles-for-service-accounts/</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>Wed, 03 Jan 2024 15:00:00 +0000</lastBuildDate><atom:link href="https://feed.craftedsignal.io/products/eks-iam-roles-for-service-accounts/feed.xml" rel="self" type="application/rss+xml"/><item><title>AWS Lateral Movement from Kubernetes Service Account via AssumeRoleWithWebIdentity</title><link>https://feed.craftedsignal.io/briefs/2024-01-aws-k8s-lateral-movement/</link><pubDate>Wed, 03 Jan 2024 15:00:00 +0000</pubDate><author>hello@craftedsignal.io</author><guid isPermaLink="true">https://feed.craftedsignal.io/briefs/2024-01-aws-k8s-lateral-movement/</guid><description>This rule detects lateral movement in AWS environments originating from Kubernetes service accounts by identifying instances where credentials obtained for a service account are used for multiple distinct AWS control-plane actions, potentially indicating unauthorized access.</description><content:encoded><![CDATA[<p>This detection rule identifies lateral movement in AWS environments stemming from Kubernetes service accounts utilizing <code>AssumeRoleWithWebIdentity</code>. It focuses on detecting instances where credentials obtained via this method are subsequently used to perform several distinct AWS control-plane actions within a single session. This behavior deviates from typical pod traffic and could signify unauthorized access or privilege escalation. The rule prioritizes the detection of sensitive API usage, including reconnaissance activities, access to secrets, IAM modifications, and compute creation events, while strategically excluding high-volume S3 data-plane operations to minimize false positives. The targeted environments are those leveraging EKS IAM Roles for Service Accounts.</p>
<h2 id="attack-chain">Attack Chain</h2>
<ol>
<li>A Kubernetes service account projects a token.</li>
<li>The service account uses <code>AssumeRoleWithWebIdentity</code> to exchange the token for short-lived IAM credentials.</li>
<li>The attacker leverages the assumed role to perform reconnaissance activities such as <code>ListUsers</code>, <code>ListRoles</code>, and <code>DescribeInstances</code>.</li>
<li>The attacker attempts to access secrets using actions like <code>GetSecretValue</code> and <code>ListSecrets</code>.</li>
<li>The attacker escalates privileges by modifying IAM policies with actions like <code>AttachRolePolicy</code> and <code>PutRolePolicy</code>.</li>
<li>The attacker attempts to create new users or roles within the AWS environment using actions like <code>CreateUser</code> and <code>CreateRole</code>.</li>
<li>The attacker performs lateral movement using actions like <code>SendCommand</code> and <code>StartSession</code>.</li>
<li>The attacker attempts to evade detection by stopping logging with the <code>StopLogging</code> action.</li>
</ol>
<h2 id="impact">Impact</h2>
<p>Successful exploitation can lead to unauthorized access to sensitive data, privilege escalation, and the potential compromise of the entire AWS environment. Lateral movement within the AWS infrastructure allows attackers to gain access to critical systems and data, potentially leading to data breaches, service disruptions, or other malicious activities.</p>
<h2 id="recommendation">Recommendation</h2>
<ul>
<li>Deploy the provided Sigma rule to your SIEM to detect potentially malicious activity related to <code>AssumeRoleWithWebIdentity</code> and tune for your environment.</li>
<li>Review and harden IAM role trust policies associated with Kubernetes service accounts, specifically focusing on OIDC trust conditions, as referenced in the <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_create_oidc.html">IAM OIDC identity provider</a> documentation.</li>
<li>Implement strict least privilege principles for Kubernetes service accounts, limiting their access to only the necessary AWS resources, as covered in <a href="https://docs.aws.amazon.com/eks/latest/userguide/iam-roles-for-service-accounts.html">EKS IAM roles for service accounts</a>.</li>
<li>Monitor CloudTrail logs for <code>AssumeRoleWithWebIdentity</code> events followed by suspicious API calls, focusing on the actions listed in the Sigma rule detection patterns.</li>
</ul>
]]></content:encoded><category domain="severity">high</category><category domain="type">advisory</category><category>cloud</category><category>aws</category><category>kubernetes</category><category>lateral-movement</category><category>credential-access</category><category>discovery</category></item></channel></rss>