Palo Alto Networks' Unit 42 has developed a novel methodology for enhancing cloud threat detection by mapping cloud identities to their functional roles through behavioral analysis. The research introduces a model that uses unsupervised machine learning on cloud audit logs, specifically AWS CloudTrail, to cluster identities based on their activity patterns. This approach provides critical context for distinguishing between normal operational behavior and potential threats, such as an attacker masquerading as a legitimate service.
The key innovation is the ability to distill the findings from the complex clustering model into simple, lightweight heuristic logic that can be implemented using standard SQL. This enables organizations to achieve continuous, scalable visibility and automated threat detection within their cloud environments without the significant resource cost associated with running a persistent machine learning pipeline. The methodology is designed to be adaptable to other cloud providers and environments like Kubernetes.
The primary challenge addressed by this research is the difficulty of understanding the true function of an identity in a large, complex cloud environment. With thousands of human, machine, and autonomous identities, relying solely on assigned IAM policies or naming conventions is insufficient. Attackers exploit this ambiguity by using masquerading techniques to blend in with normal activity, making their actions difficult to detect.
To overcome this, Unit 42 designed a behavioral clustering model. The process involved:
ConsoleLogin event, which was rare in other clusters.This approach moves security from a static, capability-based model (what an identity can do) to a dynamic, behavior-based model (what an identity actually does), providing richer context for threat detection.
The core of the technical solution is a two-stage machine learning process. First, UMAP is used for dimensionality reduction, projecting the high-dimensional space of all possible cloud API calls into a lower-dimensional, manageable map. In this map, each identity is a point, and the distance between points reflects behavioral similarity.
Second, HDBSCAN is applied to this map to identify dense regions of points, which represent behavioral clusters. This method is effective because it does not require the number of clusters to be predefined and can handle noise (identities that do not fit neatly into any group).
An in-depth analysis of the largest cluster, representing approximately 5,000 administrative users, showed that 94% of its members invoked the ConsoleLogin operation. This starkly contrasted with other clusters, where less than 1% of identities performed this action, confirming the cluster's role as human administrators accessing the AWS Management Console.
This model is effective at detecting threats that involve behavioral deviation, which maps to several MITRE ATT&CK techniques:
T1078.004 - Valid Accounts: Cloud Accounts: The entire model is based on analyzing the behavior of valid accounts to spot misuse.T1037 - Masquerading: By establishing a behavioral baseline, the model can identify when an identity's actions are inconsistent with its established role, a key indicator of masquerading.T1538 - Cloud Service Discovery: The paper gives an example of an identity enumerating all resources. The model provides the context to determine if this is a benign security scanner or a compromised service account performing reconnaissance.The primary impact of this research is a significant improvement in the signal-to-noise ratio for cloud threat detection. In environments with thousands of identities, security teams are often overwhelmed with low-context alerts. By baselining normal behavior, this model allows for the creation of high-fidelity alerts that are tied to meaningful deviations from an identity's established role.
For example, an alert indicating that a backup service identity is attempting to create a new user account is far more actionable than a generic "unusual activity" alert. This allows security operations centers (SOCs) to prioritize investigations and respond more quickly to genuine threats.
The ability to translate the model's findings into simple SQL queries is a major benefit. It democratizes this advanced detection capability, allowing organizations without dedicated data science teams to implement sophisticated behavioral analytics using their existing SIEM or security data lake infrastructure.
No specific Indicators of Compromise (IOCs) were provided in the source article, as it is a research paper describing a defensive methodology rather than an analysis of a specific attack.
Security teams can hunt for threats by looking for deviations from expected behavior. The following patterns, inspired by the research, could indicate malicious activity:
AWS CloudTrailAzure Activity Logs / GCP Audit LogsConsoleLoginiam:CreateUser, iam:AttachRolePolicys3:GetObject from unexpected identityOrganizations can implement this methodology by following these steps:
s3:* or ec2:CreateSnapshot.This approach aligns with the D3FEND technique User Behavior Analysis, specifically Job Function Access Pattern Analysis and Resource Access Pattern Analysis.
An alert generated by this system should trigger an incident response playbook focused on account compromise. Key steps include:
While the model is primarily a detection mechanism, its insights can drive mitigation and hardening efforts. The core mitigation is to enforce the principle of least privilege, informed by actual usage data.
These actions align with the D3FEND countermeasures of Application Configuration Hardening and User Account Permissions.
The entire methodology relies on comprehensive auditing of cloud API calls via services like AWS CloudTrail.
The research provides a scalable method for implementing behavior-based prevention rules in a cloud context.
Insights from behavioral clustering should be used to enforce least privilege and harden user account permissions in IAM.
Implement Job Function Access Pattern Analysis by leveraging the behavioral clustering model described in the Unit 42 research. Start by ingesting all AWS CloudTrail management events into a security data lake. Apply the UMAP and HDBSCAN algorithms to automatically group identities into clusters representing their job functions (e.g., 'Console Admins', 'CI/CD Deployers', 'Backup Services'). For each cluster, profile the top 20 most common API calls to define its 'normal' behavior. Translate these profiles into SIEM detection rules that alert when an identity performs an action significantly outside its cluster's profile. For example, if an identity in the 'Backup Services' cluster (which normally only performs s3:PutObject and ec2:CreateSnapshot) suddenly invokes iam:CreateUser, trigger a critical alert. This provides a data-driven method for detecting compromised accounts or insider threats based on deviations from their established job function.
Enhance threat detection by analyzing resource access patterns, a key component of the Unit 42 model. Beyond just what API calls an identity makes, track which resources it interacts with. For example, a CI/CD service account should only interact with specific ECR repositories and ECS clusters. A database administrator should only access a known set of RDS instances. Configure monitoring to baseline these identity-to-resource interactions. An alert should be generated if the CI/CD account attempts to access a production RDS database, or if a developer's identity, which normally only interacts with dev/test environments, suddenly queries a production S3 bucket containing customer data. This can be implemented by enriching CloudTrail logs with resource tags and building analytics that track the unique set of resource ARNs or tags accessed by each identity over time, alerting on any new or unusual additions to that set.
Use the outputs of the behavioral clustering analysis to actively harden IAM configurations. The analysis reveals the principle of actual privilege, as opposed to granted privilege. After running the model, generate a report for each IAM role that compares its attached policies (granted permissions) with its observed behavior (used permissions). For any permissions that are granted but never used over a significant period (e.g., 90 days), create a change management ticket to have them removed from the policy. This operationalizes the principle of least privilege in a continuous, data-driven manner. For example, if the analysis shows that a service role with ec2:* permissions has only ever used ec2:DescribeInstances and ec2:StartInstances, the policy should be tightened to only allow those two actions. This drastically reduces the blast radius if the credentials for that role are ever compromised.

Cybersecurity professional with over 10 years of specialized experience in security operations, threat intelligence, incident response, and security automation. Expertise spans SOAR/XSOAR orchestration, threat intelligence platforms, SIEM/UEBA analytics, and building cyber fusion centers. Background includes technical enablement, solution architecture for enterprise and government clients, and implementing security automation workflows across IR, TIP, and SOC use cases.
CyberNetSec.io uses automation to assist source monitoring, deduplication, observable extraction, and structured intelligence generation. Published analysis follows human-defined editorial standards and adds defensive context including MITRE ATT&CK, D3FEND, STIX, and Sigma where applicable. Read our editorial policy.
Help others stay informed about cybersecurity threats
Every tactic, technique, and sub-technique used in this threat has been identified and mapped to the MITRE ATT&CK framework for consistent, actionable threat language.
Observables and indicators of compromise (IOCs) have been extracted and cataloged. Risk has been assessed and correlated with known threat actors and historical campaigns.
Detection rules, incident response steps, and D3FEND-aligned mitigation strategies are included so your team can act on this intelligence immediately.
Structured threat data is packaged as a STIX 2.1 bundle and can be visualized as an interactive graph — relationships between actors, malware, techniques, and indicators.
Sigma detection rules are derived from the threat techniques in this article and can be converted for deployment across any major SIEM or EDR platform.