<?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>Kubernetes — CraftedSignal Threat Feed</title><link>https://feed.craftedsignal.io/products/kubernetes/</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, 07 Nov 2024 14:23:50 +0000</lastBuildDate><atom:link href="https://feed.craftedsignal.io/products/kubernetes/feed.xml" rel="self" type="application/rss+xml"/><item><title>Suspicious Pod Creation in Kubernetes System Namespace</title><link>https://feed.craftedsignal.io/briefs/2024-11-kubernetes-pod-creation/</link><pubDate>Thu, 07 Nov 2024 14:23:50 +0000</pubDate><author>hello@craftedsignal.io</author><guid isPermaLink="true">https://feed.craftedsignal.io/briefs/2024-11-kubernetes-pod-creation/</guid><description>An attacker may deploy a pod within the kube-system namespace in Kubernetes to mimic legitimate system pods and evade detection.</description><content:encoded><![CDATA[<p>Attackers can exploit the trust associated with the kube-system namespace in Kubernetes to deploy malicious pods. By naming these pods similarly to legitimate system pods (e.g., kube-proxy-bv61v), they attempt to blend in and avoid detection. This technique leverages the fact that system pods created by controllers like Deployments or DaemonSets have random suffixes in their names, making it difficult to distinguish malicious pods from legitimate ones based on naming conventions alone. The deployment of a backdoor container in the kube-system namespace alongside other administrative containers poses a significant risk.</p>
<h2 id="attack-chain">Attack Chain</h2>
<ol>
<li>Compromise a Kubernetes cluster with sufficient privileges to deploy pods.</li>
<li>Identify existing pods in the kube-system namespace, noting naming conventions and suffixes.</li>
<li>Craft a pod manifest for a malicious container, naming it to resemble a legitimate system pod (e.g., kube-proxy-xxxx).</li>
<li>Deploy the malicious pod to the kube-system namespace using kubectl apply -f &lt;pod_manifest.yaml&gt;.</li>
<li>The malicious pod executes its intended function, such as establishing a reverse shell or providing unauthorized access.</li>
<li>The attacker maintains persistence by ensuring the malicious pod is recreated if deleted, possibly via a custom controller.</li>
<li>The attacker performs lateral movement to other resources within the cluster from the compromised pod.</li>
<li>The attacker achieves their objective, such as data exfiltration or denial of service, using the compromised pod as a base of operations.</li>
</ol>
<h2 id="impact">Impact</h2>
<p>Successful deployment of malicious pods in the kube-system namespace can lead to a range of impacts, including unauthorized access to sensitive resources, data exfiltration, and denial of service. This can compromise the entire Kubernetes cluster and any applications it hosts. The number of affected systems depends on the scope of the compromised cluster, but it could potentially impact all applications and data within the environment.</p>
<h2 id="recommendation">Recommendation</h2>
<ul>
<li>Deploy the Sigma rule <code>Creation Of Pod In System Namespace</code> to your SIEM to detect suspicious pod creations in the kube-system namespace.</li>
<li>Investigate any alerts generated by the <code>Creation Of Pod In System Namespace</code> Sigma rule to determine if the pod creation is legitimate or malicious.</li>
<li>Implement strong RBAC policies to limit the ability of users and service accounts to create pods in the kube-system namespace.</li>
<li>Regularly audit pod deployments in the kube-system namespace to identify any unauthorized or suspicious activity.</li>
</ul>
]]></content:encoded><category domain="severity">medium</category><category domain="type">advisory</category><category>kubernetes</category><category>pod</category><category>kube-system</category><category>container</category></item><item><title>Kubernetes Event Deletion for Defense Evasion</title><link>https://feed.craftedsignal.io/briefs/2024-05-kubernetes-events-deleted/</link><pubDate>Thu, 02 May 2024 12:00:00 +0000</pubDate><author>hello@craftedsignal.io</author><guid isPermaLink="true">https://feed.craftedsignal.io/briefs/2024-05-kubernetes-events-deleted/</guid><description>An adversary may delete Kubernetes events to evade detection and hide malicious activity within a Kubernetes environment by removing audit logs.</description><content:encoded><![CDATA[<p>Attackers targeting Kubernetes environments may attempt to delete Kubernetes events as a means of covering their tracks. This technique, often employed after successful exploitation or lateral movement, aims to eliminate audit logs and other traces of malicious activity. By removing these logs, attackers can significantly hinder incident response efforts and prolong the duration of their access. While the specifics of initial access will vary, this action will typically be performed using kubectl or similar tools with sufficient privileges within the Kubernetes cluster. Defenders need to monitor for unexpected deletion of event logs to identify potentially compromised systems.</p>
<h2 id="attack-chain">Attack Chain</h2>
<ol>
<li>Initial compromise of a container or node within the Kubernetes cluster using an exploit (e.g., exploiting a vulnerability in a containerized application).</li>
<li>Establish persistence by creating a malicious pod or modifying existing deployments to include backdoors.</li>
<li>Escalate privileges within the cluster, potentially by exploiting misconfigured RBAC policies or vulnerable service accounts.</li>
<li>Identify Kubernetes event logs that contain evidence of the attacker&rsquo;s activities, such as pod deployments, privilege escalation attempts, or network connections.</li>
<li>Use <code>kubectl delete events</code> command with appropriate privileges to remove targeted event logs from the Kubernetes audit logs.</li>
<li>Verify that the targeted event logs have been successfully removed from the cluster&rsquo;s audit trail.</li>
<li>Continue lateral movement and data exfiltration, now with reduced risk of detection due to the deleted event logs.</li>
</ol>
<h2 id="impact">Impact</h2>
<p>Successful deletion of Kubernetes events allows attackers to operate within the cluster undetected for extended periods. This can lead to significant data breaches, system compromise, and disruption of services. The absence of event logs makes forensic investigation and incident response extremely challenging, potentially leading to inaccurate assessments of the scope and impact of the attack. While the exact number of victims is unknown, this technique, if successful, significantly amplifies the damage caused by any initial intrusion.</p>
<h2 id="recommendation">Recommendation</h2>
<ul>
<li>Deploy the Sigma rule &ldquo;Kubernetes Events Deleted&rdquo; to your SIEM to detect event deletion attempts in your Kubernetes environment (logsource: application, product: kubernetes, service: audit).</li>
<li>Review and harden RBAC policies to minimize the risk of unauthorized event deletion.</li>
<li>Implement strong audit logging practices and ensure that audit logs are securely stored and protected from tampering.</li>
</ul>
]]></content:encoded><category domain="severity">medium</category><category domain="type">advisory</category><category>stealth</category><category>defense-evasion</category><category>kubernetes</category></item><item><title>Kubernetes Sensitive Role Creation or Modification</title><link>https://feed.craftedsignal.io/briefs/2024-01-kubernetes-sensitive-role-creation/</link><pubDate>Thu, 04 Jan 2024 12:00:00 +0000</pubDate><author>hello@craftedsignal.io</author><guid isPermaLink="true">https://feed.craftedsignal.io/briefs/2024-01-kubernetes-sensitive-role-creation/</guid><description>Detects the creation or modification of Kubernetes Roles or ClusterRoles that grant high-risk permissions, such as wildcard access or RBAC escalation verbs, potentially leading to privilege escalation or unauthorized access within the cluster.</description><content:encoded><![CDATA[<p>This detection rule focuses on identifying suspicious activities related to Kubernetes Role-Based Access Control (RBAC). It specifically targets the creation, update, or patching of Kubernetes Roles or ClusterRoles that introduce high-risk permissions. These include wildcard access, where a single rule grants access to all resources, and escalation verbs like &lsquo;bind&rsquo;, &rsquo;escalate&rsquo;, or &lsquo;impersonate&rsquo;, which can be used to elevate privileges. The rule is designed to alert security teams to potential privilege escalation or unauthorized access attempts within Kubernetes environments. The Elastic detection rule was last updated on April 27, 2026, and aims to detect malicious actors attempting to gain cluster-admin-equivalent access by creating new ClusterRoles with <code>*</code> verbs/resources and binding them to their accounts or service accounts.</p>
<h2 id="attack-chain">Attack Chain</h2>
<ol>
<li>An attacker gains initial access to the Kubernetes cluster, potentially through compromised credentials or a vulnerable application.</li>
<li>The attacker attempts to create or modify a Role or ClusterRole.</li>
<li>The attacker adds high-risk permissions to the Role or ClusterRole, such as wildcard verbs/resources (<code>*</code>) or escalation verbs (bind, escalate, impersonate).</li>
<li>The Kubernetes API server authorizes the request, potentially due to misconfigured RBAC policies.</li>
<li>The attacker creates or modifies a RoleBinding or ClusterRoleBinding to associate the modified Role or ClusterRole with a target user, group, or service account.</li>
<li>The target user, group, or service account now possesses the elevated privileges granted by the modified Role or ClusterRole.</li>
<li>The attacker leverages the elevated privileges to perform unauthorized actions within the cluster, such as accessing sensitive data or deploying malicious workloads.</li>
<li>The attacker achieves persistence by maintaining the modified Role or ClusterRole and its associated bindings, allowing continued access to elevated privileges.</li>
</ol>
<h2 id="impact">Impact</h2>
<p>Successful exploitation can lead to significant security breaches within a Kubernetes environment. Attackers can gain unauthorized access to sensitive data, deploy malicious workloads, disrupt services, and potentially compromise the entire cluster. This can result in data breaches, financial losses, and reputational damage. The rule aims to prevent attackers from silently expanding privileges, enabling persistence, or facilitating lateral movement across the cluster.</p>
<h2 id="recommendation">Recommendation</h2>
<ul>
<li>Deploy the Sigma rule <code>Kubernetes Creation of Sensitive Role</code> to your SIEM to detect the creation or modification of Kubernetes Roles or ClusterRoles that grant high-risk permissions.</li>
<li>Enable Kubernetes audit logging to capture the necessary events for the Sigma rules to function effectively (reference: Kubernetes audit logs in <code>logsource</code>).</li>
<li>Implement RBAC guardrails using tools like OPA Gatekeeper or Kyverno to prevent the creation of Roles/ClusterRoles with wildcard or escalation verbs (reference: harden recommendation in the content).</li>
<li>Regularly review and audit RBAC configurations to identify and remediate overly permissive roles and bindings.</li>
</ul>
]]></content:encoded><category domain="severity">medium</category><category domain="type">advisory</category><category>kubernetes</category><category>rbac</category><category>privilege-escalation</category><category>persistence</category></item><item><title>Kubernetes RBAC Wildcard Elevation on Existing Role</title><link>https://feed.craftedsignal.io/briefs/2024-01-kubernetes-rbac-elevation/</link><pubDate>Wed, 03 Jan 2024 18:23:00 +0000</pubDate><author>hello@craftedsignal.io</author><guid isPermaLink="true">https://feed.craftedsignal.io/briefs/2024-01-kubernetes-rbac-elevation/</guid><description>The rule detects when a Kubernetes Role or ClusterRole is patched or updated to grant wildcard verbs and resources, effectively granting cluster-admin-like privileges, which is often a deliberate privilege expansion and could indicate malicious activity.</description><content:encoded><![CDATA[<p>This detection rule identifies modifications to Kubernetes Roles or ClusterRoles that result in the granting of wildcard permissions for both verbs and resources. This effectively elevates the privileges associated with the role to be similar to that of a cluster-admin, granting near-complete control over the Kubernetes environment. This type of privilege escalation is often intentional and may indicate malicious activity, such as an attacker attempting to gain broader access within the cluster. The rule requires Kubernetes audit logs with RequestResponse level and the response body to inspect the final merged role. It excludes loopback source IPs to avoid false positives from local system processes.</p>
<h2 id="attack-chain">Attack Chain</h2>
<ol>
<li>An attacker gains initial access to a Kubernetes cluster, possibly through compromised credentials or a vulnerable application.</li>
<li>The attacker identifies a Role or ClusterRole that, if modified, would grant them broader privileges.</li>
<li>The attacker uses <code>kubectl patch</code> or <code>kubectl update</code> to modify the existing Role or ClusterRole.</li>
<li>The modification introduces wildcard permissions (<code>verbs: [&quot;*&quot;]</code> and <code>resources: [&quot;*&quot;]</code>) to the role&rsquo;s rules.</li>
<li>The Kubernetes API server processes the patch or update request, granting the modified permissions.</li>
<li>The attacker leverages the newly acquired privileges to perform actions they were previously unauthorized to do, such as accessing sensitive data, deploying malicious workloads, or further escalating privileges.</li>
<li>The attacker attempts to access other resources or namespaces within the Kubernetes cluster, taking advantage of the elevated permissions.</li>
</ol>
<h2 id="impact">Impact</h2>
<p>A successful privilege escalation can allow an attacker to gain complete control over a Kubernetes cluster. This can lead to data breaches, denial of service, deployment of malicious containers, and other security incidents. The severity of the impact depends on the scope of the compromised cluster and the sensitivity of the data and applications it hosts. A single compromised role can lead to a full cluster compromise if not detected and remediated quickly.</p>
<h2 id="recommendation">Recommendation</h2>
<ul>
<li>Deploy the Sigma rule &ldquo;Kubernetes RBAC Wildcard Elevation on Existing Role&rdquo; to your SIEM and tune for your environment to detect wildcard privilege escalations in Kubernetes audit logs.</li>
<li>Investigate any alerts generated by the Sigma rule, focusing on the actor (user, group, impersonation) and their source IP.</li>
<li>Diff the Role or ClusterRole YAML before and after the change to understand the scope of the permission change.</li>
<li>Review RoleBindings and ClusterRoleBindings that reference the modified role to identify which subjects gained the widened access.</li>
<li>Implement policy-as-code to prevent unauthorized modifications to RBAC configurations.</li>
<li>Monitor Kubernetes audit logs for suspicious activity related to account manipulation (T1098) and privilege escalation (TA0004).</li>
</ul>
]]></content:encoded><category domain="severity">high</category><category domain="type">advisory</category><category>kubernetes</category><category>rbac</category><category>privilege-escalation</category></item><item><title>Kubernetes Secret Access by Node or Pod Service Account</title><link>https://feed.craftedsignal.io/briefs/2024-01-kubernetes-secret-access/</link><pubDate>Wed, 03 Jan 2024 18:22:00 +0000</pubDate><author>hello@craftedsignal.io</author><guid isPermaLink="true">https://feed.craftedsignal.io/briefs/2024-01-kubernetes-secret-access/</guid><description>This rule detects Kubernetes audit events where a node or pod service account attempts to read secrets directly, which is often a sign of credential access.</description><content:encoded><![CDATA[<p>This detection rule identifies suspicious Kubernetes API access patterns indicative of credential access. Specifically, it focuses on <code>get</code> or <code>list</code> operations targeting the <code>secrets</code> resource performed by node identities (<code>system:node:*</code>) or pod service accounts (<code>system:serviceaccount:*</code>). Attackers who have compromised a pod service account or node credentials might attempt to enumerate secrets to discover sensitive information such as tokens, registry credentials, TLS keys, or application configurations. While legitimate controllers may read secrets, direct access from node or pod service accounts warrants investigation, especially when cross-namespace or involving high-value secrets. The rule is intended to be triaged based on namespace scope, user agent, RBAC, and relevance of the identity to the accessed secret.</p>
<h2 id="attack-chain">Attack Chain</h2>
<ol>
<li>Attacker gains initial access to a Kubernetes cluster, possibly through compromising a pod or node.</li>
<li>Attacker obtains credentials for a service account associated with the compromised pod or accesses node credentials.</li>
<li>Attacker uses the stolen credentials to authenticate against the Kubernetes API.</li>
<li>The attacker attempts to enumerate secrets within the cluster using <code>kubectl get secrets --all-namespaces</code> or similar API calls.</li>
<li>The Kubernetes API server receives the request and generates an audit log entry.</li>
<li>This audit log entry contains details such as the user (<code>system:node:*</code> or <code>system:serviceaccount:*</code>), the action (<code>get</code> or <code>list</code>), and the resource (<code>secrets</code>).</li>
<li>The attacker identifies valuable secrets containing sensitive information such as API keys or database passwords.</li>
<li>Attacker exfiltrates the secrets, gaining unauthorized access to other systems or data.</li>
</ol>
<h2 id="impact">Impact</h2>
<p>Compromised Kubernetes secrets can lead to a wide range of security breaches, including unauthorized access to sensitive data, lateral movement within the cluster, and compromised external services that rely on the exposed credentials. If successful, attackers could gain complete control over the cluster and its applications, leading to data breaches, service disruption, and reputational damage. The risk is elevated in environments where secrets are not properly managed or where RBAC is overly permissive.</p>
<h2 id="recommendation">Recommendation</h2>
<ul>
<li>Deploy the provided Sigma rule to your SIEM to detect unauthorized secret access attempts by node or pod service accounts in Kubernetes audit logs.</li>
<li>Review RBAC configurations to ensure least privilege for service accounts and nodes, limiting their access to only necessary secrets.</li>
<li>Investigate any alerts generated by the Sigma rule, focusing on cross-namespace access, high-value secret names, and unusual user agents.</li>
<li>Implement a process for regularly rotating secrets and auditing access to sensitive resources within the Kubernetes cluster.</li>
<li>Baseline normal secret access patterns for in-cluster operators, CSI drivers, and GitOps agents, and create allowlists to reduce false positives.</li>
</ul>
]]></content:encoded><category domain="severity">medium</category><category domain="type">advisory</category><category>kubernetes</category><category>credential-access</category><category>cloud</category></item><item><title>Kubernetes Pod Exec with Curl or Wget to HTTPS</title><link>https://feed.craftedsignal.io/briefs/2024-01-kubernetes-pod-exec/</link><pubDate>Wed, 03 Jan 2024 14:27:00 +0000</pubDate><author>hello@craftedsignal.io</author><guid isPermaLink="true">https://feed.craftedsignal.io/briefs/2024-01-kubernetes-pod-exec/</guid><description>This rule detects Kubernetes pod exec API calls using curl or wget to fetch HTTPS URLs, potentially indicating malicious activity such as staging tools or exfiltrating data.</description><content:encoded><![CDATA[<p>This detection rule identifies suspicious activity within Kubernetes environments where attackers leverage <code>kubectl exec</code> or similar API calls to execute commands within pods. Specifically, it focuses on instances where these commands involve using <code>curl</code> or <code>wget</code> to retrieve content over HTTPS. Attackers may use this technique to download malicious scripts, tools, or exfiltrate sensitive data from compromised pods. This activity is flagged based on decoded request URIs from Kubernetes audit logs, reconstructed command strings, and filtering of benign traffic related to cluster health checks and OIDC/JWKS endpoints. The rule aims to detect anomalous behavior that deviates from typical pod execution patterns, helping defenders identify potential intrusions or misuse of pod execution privileges. The rule was created on 2026/04/23 and last updated on 2026/04/23 according to the source.</p>
<h2 id="attack-chain">Attack Chain</h2>
<ol>
<li>An attacker gains unauthorized access to the Kubernetes cluster, possibly through compromised credentials or a vulnerability.</li>
<li>The attacker identifies a target pod within the cluster to execute commands within.</li>
<li>The attacker uses <code>kubectl exec</code> or a similar API call to initiate a shell session within the target pod.</li>
<li>The attacker crafts a command using <code>curl</code> or <code>wget</code> to download a malicious script, tool, or exfiltrate data over HTTPS. The URL is often encoded in the requestURI.</li>
<li>The Kubernetes API server records the exec call and its parameters in the audit logs.</li>
<li>The detection rule decodes the requestURI, extracts the command string, and identifies the use of <code>curl</code> or <code>wget</code> with an HTTPS URL.</li>
<li>The rule filters out known benign URLs associated with cluster health checks or OIDC/JWKS endpoints.</li>
<li>If the command is identified as malicious, an alert is triggered, indicating a potential compromise.</li>
</ol>
<h2 id="impact">Impact</h2>
<p>Successful exploitation can lead to the deployment of malicious tools within the Kubernetes environment, potentially enabling lateral movement, data theft, or denial-of-service attacks.  Compromised pods could expose sensitive data or be used as a launchpad for further attacks on the cluster or other systems. The scope of impact depends on the permissions granted to the compromised pod and the attacker&rsquo;s objectives.</p>
<h2 id="recommendation">Recommendation</h2>
<ul>
<li>Deploy the Sigma rule &ldquo;Kubernetes Pod Exec with Curl or Wget to HTTPS&rdquo; to your SIEM and tune for your environment.</li>
<li>Review Kubernetes RoleBindings for <code>pods/exec</code> to ensure only required principals retain access on sensitive namespaces.</li>
<li>Investigate any alerts generated by the Sigma rule by reviewing the decoded URI and reconstructed command in the alert details.</li>
<li>Implement network policies to restrict egress traffic from pods, limiting the potential for data exfiltration via HTTPS.</li>
<li>Regularly audit Kubernetes audit logs for suspicious activity related to pod execution and API calls.</li>
</ul>
]]></content:encoded><category domain="severity">high</category><category domain="type">advisory</category><category>kubernetes</category><category>execution</category><category>command and control</category><category>threat detection</category></item><item><title>Kubernetes Secret Access with Suspicious User Agent</title><link>https://feed.craftedsignal.io/briefs/2024-01-03-kubernetes-secret-access/</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-kubernetes-secret-access/</guid><description>Detects read access to Kubernetes Secrets (`get`/`list`) with a user agent matching a curated set of non-standard or attacker-leaning clients, indicating potential credential access.</description><content:encoded><![CDATA[<p>This rule identifies suspicious access patterns to Kubernetes Secrets. Attackers may attempt to retrieve secrets containing sensitive information such as credentials, API keys, and other confidential data. This detection focuses on identifying access attempts originating from clients with non-standard user agents, such as scripting runtimes (Python, Perl, PHP), basic HTTP tools (curl, wget), or those associated with penetration testing distributions (Kali Linux). Legitimate access typically involves stable, purpose-built user agents. This detection helps uncover potential credential access attempts that bypass standard access controls. The rule specifically triggers on <code>get</code> and <code>list</code> actions against Kubernetes secrets, coupled with a suspicious <code>user_agent.original</code> and a populated <code>source.ip</code>.</p>
<h2 id="attack-chain">Attack Chain</h2>
<ol>
<li>Attacker gains initial access to a compromised host or pod within the Kubernetes cluster or an external system with network access to the Kubernetes API server.</li>
<li>The attacker crafts HTTP requests to the Kubernetes API server to enumerate available secrets.</li>
<li>The attacker uses tooling such as <code>curl</code>, <code>wget</code>, or custom scripts with user agents like <code>python-requests</code> or <code>Go-http-client</code> to interact with the API.</li>
<li>The attacker sends a <code>GET</code> or <code>LIST</code> request to the <code>/api/v1/namespaces/{namespace}/secrets/{name}</code> endpoint to retrieve specific secrets or list all secrets in a namespace.</li>
<li>The Kubernetes API server authenticates and authorizes the request based on the attacker&rsquo;s assigned RBAC roles, potentially using impersonation.</li>
<li>If authorized, the API server returns the secret data in the response.</li>
<li>The attacker extracts sensitive information like passwords, tokens, or API keys from the retrieved secrets.</li>
<li>The attacker uses the compromised credentials to escalate privileges, move laterally within the cluster, or access external resources.</li>
</ol>
<h2 id="impact">Impact</h2>
<p>Successful exploitation allows attackers to steal sensitive information stored in Kubernetes secrets, leading to privilege escalation, lateral movement, and unauthorized access to critical systems and data. Compromised credentials can be used to access external cloud resources or internal services. The impact depends on the sensitivity of the secrets, but can include data breaches, service disruptions, and significant financial loss.</p>
<h2 id="recommendation">Recommendation</h2>
<ul>
<li>Deploy the Sigma rule <code>Kubernetes Secret get or list with Suspicious User Agent</code> to your SIEM to detect suspicious access to Kubernetes secrets.</li>
<li>Investigate any alerts triggered by the Sigma rule, focusing on the user identity (<code>user.name</code>), targeted namespace (<code>kubernetes.audit.objectRef.namespace</code>), and source IP (<code>source.ip</code>).</li>
<li>Baseline expected user agents for legitimate automation and add exceptions to the detection rule for known good traffic.</li>
<li>Rotate affected secrets and credentials, revoke tokens, and tighten RBAC if unauthorized access is detected.</li>
<li>Block or isolate the source host at the network edge to the API server where appropriate, based on <code>source.ip</code>.</li>
<li>Monitor <code>kubernetes.audit.annotations.authorization_k8s_io/decision</code> to identify unauthorized attempts to access secrets.</li>
</ul>
]]></content:encoded><category domain="severity">high</category><category domain="type">advisory</category><category>kubernetes</category><category>credential-access</category><category>cloud</category></item><item><title>Kubernetes Rapid Secret GET Activity Against Multiple Objects</title><link>https://feed.craftedsignal.io/briefs/2024-01-kubernetes-secret-retrieval-burst/</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-kubernetes-secret-retrieval-burst/</guid><description>Detects an unusual volume of Kubernetes API get requests against multiple distinct Secret objects from the same client fingerprint, potentially indicating credential access or in-cluster reconnaissance.</description><content:encoded><![CDATA[<p>This detection rule identifies suspicious activity within Kubernetes environments where a single client fingerprint (defined by user, source IP, and user agent) rapidly retrieves multiple distinct Secret objects via the Kubernetes API. The rule focuses on detecting potential credential access or in-cluster reconnaissance attempts. The activity may involve successful and failed GET requests, where failed requests may reveal information about RBAC boundaries or confirm the existence of targeted secrets. This activity can indicate that an attacker is attempting to enumerate and retrieve sensitive data such as service account tokens, registry credentials, TLS material, or application configuration. The rule excludes common sources such as the kube-controller-manager and kube-scheduler.</p>
<h2 id="attack-chain">Attack Chain</h2>
<ol>
<li>An attacker gains initial access to a Kubernetes cluster, potentially by exploiting a vulnerability or compromising a service account.</li>
<li>The attacker uses the compromised credentials to authenticate to the Kubernetes API.</li>
<li>The attacker sends a series of GET requests to the Kubernetes API, targeting Secret objects.</li>
<li>The API server authenticates and authorizes the requests based on the attacker&rsquo;s permissions and RBAC configurations.</li>
<li>Successful GET requests return the contents of the Secret objects.</li>
<li>Failed GET requests may reveal RBAC restrictions, namespace details, or secret existence.</li>
<li>The attacker analyzes the retrieved Secrets or error messages to gather sensitive information like credentials or configuration details.</li>
<li>The attacker uses the gathered information to further compromise the cluster or exfiltrate data.</li>
</ol>
<h2 id="impact">Impact</h2>
<p>A successful attack can lead to the compromise of sensitive data stored within Kubernetes Secrets, such as service account tokens, registry credentials, TLS keys, and application configuration. This can result in privilege escalation, lateral movement, and data exfiltration. The rule aims to detect unauthorized access to these resources, preventing attackers from gaining access to critical infrastructure and data. If successful, the attackers could also potentially gain access to connected cloud resources via exposed credentials.</p>
<h2 id="recommendation">Recommendation</h2>
<ul>
<li>Deploy the Sigma rule <code>Kubernetes Rapid Secret GET Activity</code> to your SIEM and tune for your environment.</li>
<li>Investigate any alerts generated by the <code>Kubernetes Rapid Secret GET Activity</code> Sigma rule, focusing on the <code>Esql.outcome</code> field to determine the success or failure of the requests.</li>
<li>Review RBAC configurations for the identified user accounts and source IPs to identify overly permissive access controls using <code>user.name</code>, <code>source.ip</code>, and <code>Esql.namespaces</code>.</li>
<li>Monitor Kubernetes audit logs for unusual API activity, specifically targeting GET requests to Secret objects using <code>kubernetes.audit.objectRef.resource == &quot;secrets&quot;</code> as a filter.</li>
<li>Implement network segmentation to limit the blast radius of compromised accounts, using <code>source.ip</code> to track connections.</li>
</ul>
]]></content:encoded><category domain="severity">high</category><category domain="type">advisory</category><category>kubernetes</category><category>credential-access</category><category>threat-detection</category></item><item><title>Kubernetes Pod Exec Potential Reverse Shell Activity Detected</title><link>https://feed.craftedsignal.io/briefs/2024-01-kubernetes-pod-exec-reverse-shell/</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-kubernetes-pod-exec-reverse-shell/</guid><description>This rule flags potential reverse shell activity via kubectl exec commands in Kubernetes pods by detecting specific shell and socket idioms within URL-decoded command payloads in Kubernetes audit logs, indicating post-exploitation interactive access and command-and-control.</description><content:encoded><![CDATA[<p>This detection identifies attempts to establish reverse shells or bind shells within Kubernetes pods. The rule analyzes Kubernetes audit logs, specifically targeting <code>kubectl exec</code> commands where a user is attempting to execute commands inside a container. By decoding the URL-encoded command parameters and searching for known reverse shell patterns (e.g., usage of <code>/dev/tcp</code>, <code>nc -e</code>, <code>socat</code>), the rule aims to detect unauthorized interactive access and command-and-control activity originating from compromised pods. This activity is often indicative of post-exploitation behavior, where an attacker seeks to gain persistent access to the Kubernetes cluster. The rule is based on the Elastic detection rule released on 2026-04-23. It is critical to investigate these alerts promptly, as successful reverse shell establishment can lead to data exfiltration, lateral movement within the cluster, and further compromise of sensitive resources.</p>
<h2 id="attack-chain">Attack Chain</h2>
<ol>
<li>An attacker gains initial access to a Kubernetes cluster, potentially through a vulnerability in an application running within a pod, or by compromising a user&rsquo;s credentials.</li>
<li>The attacker uses <code>kubectl exec</code> to execute a command within a target pod. The command is embedded within the <code>requestURI</code> parameter, URL-encoded to evade basic detection.</li>
<li>The <code>requestURI</code> includes the <code>command=</code> parameter, followed by a string containing shell commands designed to initiate a reverse or bind shell.</li>
<li>The malicious command utilizes utilities such as <code>nc</code>, <code>socat</code>, or <code>bash</code> with redirection to <code>/dev/tcp</code> to establish a network connection back to the attacker&rsquo;s controlled machine.</li>
<li>The reverse shell connects back to the attacker, providing interactive command execution within the compromised pod.</li>
<li>The attacker uses the reverse shell to perform reconnaissance, discover sensitive information, and potentially escalate privileges within the pod.</li>
<li>The attacker might attempt to move laterally to other pods or nodes within the cluster, leveraging stolen credentials or exploiting further vulnerabilities.</li>
<li>The attacker achieves their objective, which may include data exfiltration, deployment of malicious containers, or disruption of services.</li>
</ol>
<h2 id="impact">Impact</h2>
<p>A successful reverse shell attack within a Kubernetes cluster can have severe consequences. Attackers can gain unauthorized access to sensitive data, compromise critical applications, and disrupt services. Lateral movement within the cluster can lead to widespread compromise, potentially affecting numerous pods and nodes. The lack of proper monitoring and alerting for <code>kubectl exec</code> commands can allow attackers to operate undetected for extended periods, increasing the potential for significant damage. The financial impact can range from tens of thousands to millions of dollars, depending on the severity of the breach and the value of the compromised data.</p>
<h2 id="recommendation">Recommendation</h2>
<ul>
<li>Deploy the &ldquo;Kubernetes Pod Exec Potential Reverse Shell&rdquo; Sigma rule to your SIEM and tune for your environment to detect malicious <code>kubectl exec</code> commands.</li>
<li>Enable Kubernetes audit logging to capture <code>kubectl exec</code> events and ensure that the audit logs are ingested into your SIEM.</li>
<li>Implement network policies to restrict outbound connections from pods, limiting the ability of attackers to establish reverse shells.</li>
<li>Monitor Kubernetes audit logs for suspicious user activity, such as unusual API calls or access to sensitive resources.</li>
<li>Regularly review and update RBAC (Role-Based Access Control) policies to minimize the privileges assigned to users and service accounts, reducing the attack surface.</li>
<li>Implement the provided regex pattern in the Sigma rule within your existing detection logic, ensuring adequate coverage of reverse shell attempts.</li>
</ul>
]]></content:encoded><category domain="severity">high</category><category domain="type">advisory</category><category>kubernetes</category><category>reverse_shell</category><category>execution</category><category>command_and_control</category></item><item><title>Kubernetes Secrets Enumeration from Non-Loopback Client</title><link>https://feed.craftedsignal.io/briefs/2024-01-kubernetes-secrets-enumeration/</link><pubDate>Tue, 02 Jan 2024 12:00:00 +0000</pubDate><author>hello@craftedsignal.io</author><guid isPermaLink="true">https://feed.craftedsignal.io/briefs/2024-01-kubernetes-secrets-enumeration/</guid><description>Detection of Kubernetes Secrets listing from non-loopback clients targeting cluster-wide secrets or sensitive namespaces, potentially indicating unauthorized credential access or discovery.</description><content:encoded><![CDATA[<p>This detection identifies Kubernetes Secrets listing events originating from non-loopback clients. Attackers may attempt to enumerate Kubernetes Secrets to gain access to sensitive information such as credentials, API keys, and other confidential data stored within the cluster. The rule specifically focuses on requests targeting cluster-wide secrets or list operations under the <code>kube-system</code> or <code>default</code> namespaces, which are often targeted due to their high concentration of sensitive information. This activity is indicative of potential credential access or discovery attempts within the Kubernetes environment. This rule helps defenders identify and respond to potential reconnaissance or lateral movement activities within their Kubernetes clusters.</p>
<h2 id="attack-chain">Attack Chain</h2>
<ol>
<li>An attacker gains initial access to a node within the Kubernetes cluster or a system with access to the Kubernetes API.</li>
<li>The attacker authenticates to the Kubernetes API server using compromised credentials or by exploiting a vulnerability.</li>
<li>The attacker crafts a <code>list</code> request targeting the <code>/api/v1/secrets</code> endpoint to enumerate all secrets in the cluster.</li>
<li>Alternatively, the attacker targets secrets within the <code>kube-system</code> namespace using <code>/api/v1/namespaces/kube-system/secrets</code> or <code>default</code> namespace using <code>/api/v1/namespaces/default/secrets</code>.</li>
<li>The API server responds with a list of secrets, potentially including sensitive information.</li>
<li>The attacker analyzes the retrieved secrets to identify valuable credentials or configuration data.</li>
<li>The attacker uses the acquired credentials to escalate privileges, move laterally within the cluster, or access external resources.</li>
</ol>
<h2 id="impact">Impact</h2>
<p>Successful enumeration of Kubernetes secrets can lead to the compromise of sensitive credentials, allowing attackers to gain unauthorized access to critical systems and data. This can result in data breaches, service disruptions, and significant financial losses. The targeting of <code>kube-system</code> and <code>default</code> namespaces poses a particularly high risk due to the presence of core system components and sensitive configurations.</p>
<h2 id="recommendation">Recommendation</h2>
<ul>
<li>Deploy the Sigma rule <code>Kubernetes Secrets List in Sensitive Namespaces</code> to your SIEM to detect suspicious secret enumeration activities based on <code>kubernetes.audit.requestURI</code>.</li>
<li>Monitor Kubernetes audit logs (<code>logs-kubernetes.audit_logs-*</code>) for <code>list</code> operations on the <code>secrets</code> resource, specifically targeting <code>/api/v1/secrets</code> and sensitive namespaces.</li>
<li>Implement network policies to restrict access to the Kubernetes API server from untrusted networks.</li>
<li>Review and harden the security configuration of the <code>kube-system</code> and <code>default</code> namespaces.</li>
<li>Enforce the principle of least privilege for service accounts and user access to minimize the impact of credential compromise.</li>
<li>Investigate any alerts generated by the Sigma rule and correlate with other security events to identify potential attacks.</li>
</ul>
]]></content:encoded><category domain="severity">high</category><category domain="type">advisory</category><category>kubernetes</category><category>credential-access</category><category>discovery</category><category>cloud</category></item></channel></rss>