<?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>Web-Identity — CraftedSignal Threat Feed</title><link>https://feed.craftedsignal.io/tags/web-identity/</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 12:00:00 +0000</lastBuildDate><atom:link href="https://feed.craftedsignal.io/tags/web-identity/feed.xml" rel="self" type="application/rss+xml"/><item><title>AWS AssumeRoleWithWebIdentity from Kubernetes SA and External ASN</title><link>https://feed.craftedsignal.io/briefs/2024-01-03-aws-assume-role-external-asn/</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-assume-role-external-asn/</guid><description>Detects successful AWS `AssumeRoleWithWebIdentity` calls where the caller identity is a Kubernetes service account and the source autonomous system organization is not `Amazon.com, Inc.`, which may indicate a stolen or misused projected service-account token being exchanged for IAM credentials off-cluster.</description><content:encoded><![CDATA[<p>This detection rule identifies instances of successful AWS <code>AssumeRoleWithWebIdentity</code> calls originating from a Kubernetes service account but not from an Amazon-managed Autonomous System Number (ASN). The primary concern is the potential compromise or misuse of projected service account tokens. Kubernetes service accounts can be mapped to IAM roles through OIDC using IRSA (IAM Roles for Service Accounts). Typically, these credential requests originate from within AWS-managed or associated networks. However, if a request with a Kubernetes service account identity originates from an external ASN (i.e., not <code>Amazon.com, Inc.</code>), it raises suspicion that the token might have been exfiltrated and is being used from an unauthorized location. This rule is designed to highlight such anomalies, prompting further investigation into possible token theft or misconfiguration.</p>
<h2 id="attack-chain">Attack Chain</h2>
<ol>
<li>Attacker gains unauthorized access to a Kubernetes service account token within a compromised pod or through other means.</li>
<li>Attacker exfiltrates the service account token from the Kubernetes cluster.</li>
<li>The attacker uses the exfiltrated token to call the AWS STS <code>AssumeRoleWithWebIdentity</code> API.</li>
<li>The <code>AssumeRoleWithWebIdentity</code> call is made from a network with an ASN organization name that is not <code>Amazon.com, Inc.</code>.</li>
<li>AWS CloudTrail logs the successful <code>AssumeRoleWithWebIdentity</code> event, including details about the user, source IP, and ASN organization.</li>
<li>The compromised IAM role is used to perform unauthorized actions within the AWS environment.</li>
<li>These actions could include data exfiltration, resource modification, or further lateral movement within the cloud infrastructure.</li>
</ol>
<h2 id="impact">Impact</h2>
<p>A successful attack of this nature can lead to significant security breaches within an AWS environment. An attacker leveraging stolen service account tokens can gain unauthorized access to sensitive resources, leading to data breaches, service disruption, or financial loss. This is especially concerning for organizations heavily reliant on Kubernetes and AWS, as it can undermine the security of their cloud-native applications and infrastructure. While the number of affected organizations is unknown, the potential impact on those targeted can be severe, leading to substantial remediation costs and reputational damage.</p>
<h2 id="recommendation">Recommendation</h2>
<ul>
<li>Deploy the Sigma rule <code>AWS AssumeRoleWithWebIdentity from Kubernetes SA and External ASN</code> to your SIEM and tune for your environment.</li>
<li>Investigate any alerts generated by the Sigma rule by following the investigation steps in the rule&rsquo;s <code>note</code> field.</li>
<li>Expand the <code>source.as.organization.name</code> exclusions in the Sigma rule for known and trusted egress paths if needed.</li>
<li>Enable geolocation/ASN enrichment for your AWS CloudTrail logs to accurately identify the source of <code>AssumeRoleWithWebIdentity</code> calls.</li>
<li>Regularly review and rotate IRSA trust relationships to minimize the impact of compromised service account tokens.</li>
<li>Revoke the role session, rotate IRSA trust where appropriate, investigate token exposure, and reduce service account and role permissions if unauthorized access is suspected.</li>
</ul>
]]></content:encoded><category domain="severity">high</category><category domain="type">advisory</category><category>aws</category><category>cloudtrail</category><category>iam</category><category>kubernetes</category><category>initial-access</category><category>web-identity</category></item></channel></rss>