Behavioral Clustering Model Maps Cloud Identity Roles from Audit Logs

Unit 42 Develops Model to Map Cloud Identities via Behavioral Clustering

INFORMATIONAL
September 14, 2026
12m read
Cloud SecurityThreat IntelligenceSecurity Operations

Related Entities

Organizations

Products & Tech

AWS CloudTrailKubernetes SQLIAMUMAPHDBSCAN

Full Report

Executive Summary

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.


Research Methodology

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:

  1. Data Collection: Analyzing AWS CloudTrail audit logs from 125 different cloud environments, encompassing over 40,000 unique identities over a two-month period.
  2. Behavioral Mapping: Using unsupervised machine learning algorithms—specifically Uniform Manifold Approximation and Projection (UMAP) and Hierarchical Density-Based Spatial Clustering of Applications with Noise (HDBSCAN)—to process the data. These algorithms automatically group the vast collection of cloud identities into distinct clusters based on behavioral similarity.
  3. Role Identification: Decoding the functional role of each cluster by combining analytical methods, such as analyzing the most frequently invoked operations. For example, a cluster of administrative users was clearly identified by the prevalence of the 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.


Technical Analysis

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.

Impact Assessment

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.


IOCs — Directly from Articles

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.


Cyber Observables — Hunting Hints

Security teams can hunt for threats by looking for deviations from expected behavior. The following patterns, inspired by the research, could indicate malicious activity:

Type
Log Source
Value
AWS CloudTrail
Description
Primary data source for behavioral analysis of AWS identities.
Type
Log Source
Value
Azure Activity Logs / GCP Audit Logs
Description
Comparable data sources for applying the methodology in other clouds.
Type
API Call
Value
ConsoleLogin
Description
A key indicator for human administrator activity. Its presence from a service account would be highly anomalous.
Type
Behavioral Pattern
Value
Deviation from established cluster
Description
The core observable. An identity performing actions outside its normal, clustered behavior (e.g., a read-only service writing data).
Type
API Call Pattern
Value
iam:CreateUser, iam:AttachRolePolicy
Description
High-risk IAM operations. Highly suspicious if invoked by identities not in a designated 'IAM-Admin' or 'DevOps-Provisioning' cluster.
Type
API Call Pattern
Value
s3:GetObject from unexpected identity
Description
A service account for EC2 metrics suddenly accessing sensitive data in S3 buckets.

Detection & Response

Detection

Organizations can implement this methodology by following these steps:

  1. Ingest Data: Ensure comprehensive cloud audit logs (like AWS CloudTrail) are enabled for all regions and services and are ingested into a centralized security data lake or SIEM.
  2. Establish Baselines: Use machine learning tools or simplified, manual analysis to cluster identities based on the API calls they make. This creates a behavioral baseline for different functional roles (e.g., 'Database Admins', 'CI/CD Pipelines', 'Security Scanners').
  3. Implement Heuristics: Convert the baseline patterns into detection rules. For example, create a rule that alerts when an identity from the 'Backup Service' cluster invokes any API call other than s3:* or ec2:CreateSnapshot.
  4. Monitor for Deviations: Continuously monitor for identities whose behavior deviates significantly from their cluster's norm. This is a strong signal for investigation.

This approach aligns with the D3FEND technique User Behavior Analysis, specifically Job Function Access Pattern Analysis and Resource Access Pattern Analysis.

Response

An alert generated by this system should trigger an incident response playbook focused on account compromise. Key steps include:

  1. Triage: Immediately assess the privilege level of the identity and the sensitivity of the resources it is accessing.
  2. Investigate: Review the full activity log for the identity to understand the scope of the anomalous behavior. The behavioral context provided by the model is crucial here.
  3. Contain: If compromise is confirmed, disable the identity's credentials, rotate keys, and terminate any active sessions.
  4. Eradicate: Identify the root cause of the compromise (e.g., leaked credentials, vulnerable application) and remediate it.

Mitigation

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.

  1. IAM Policy Hardening: Use the behavioral clusters to refine IAM policies. If the model shows a service identity only ever uses three specific API calls, its IAM role should be restricted to only those three calls. This reduces the potential impact of a compromise.
  2. Regular Policy Review: Periodically re-run the clustering analysis and compare the results to existing IAM policies. This can highlight permissions that are granted but never used, which should be removed.
  3. Adopt Behavioral Analytics: Strategically, organizations should move beyond static configuration checks and incorporate behavioral analytics into their cloud security monitoring strategy.
  4. Comprehensive Logging: Ensure that audit logging is enabled and immutable. Without the raw data from AWS CloudTrail or similar services, this type of analysis is impossible.

These actions align with the D3FEND countermeasures of Application Configuration Hardening and User Account Permissions.

Timeline of Events

1
September 14, 2026
This article was published

MITRE ATT&CK Mitigations

Audit

M1047enterprise

The entire methodology relies on comprehensive auditing of cloud API calls via services like AWS CloudTrail.

Mapped D3FEND Techniques:

The research provides a scalable method for implementing behavior-based prevention rules in a cloud context.

Mapped D3FEND Techniques:

Insights from behavioral clustering should be used to enforce least privilege and harden user account permissions in IAM.

Mapped D3FEND Techniques:

D3FEND Defensive Countermeasures

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.

Sources & References

Unmasking Cloud Identities: From Behavioral Clustering to Automated Detection
Unit 42 (unit42.paloaltonetworks.com) September 14, 2026

Article Author

Jason Gomes

Jason Gomes

• Cybersecurity Practitioner

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.

Threat Intelligence & AnalysisSecurity Orchestration (SOAR/XSOAR)Incident Response & Digital ForensicsSecurity Operations Center (SOC)SIEM & Security AnalyticsCyber Fusion & Threat SharingSecurity Automation & IntegrationManaged Detection & Response (MDR)

Editorial Standards & Analyst Review

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.

Tags

Cloud SecurityThreat DetectionMachine LearningBehavioral AnalyticsAWSIAMCloudTrailThreat Hunting

📢 Share This Article

Help others stay informed about cybersecurity threats

🎯 MITRE ATT&CK Mapped

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.

🧠 Enriched & Analyzed

Observables and indicators of compromise (IOCs) have been extracted and cataloged. Risk has been assessed and correlated with known threat actors and historical campaigns.

🛡️ Actionable Guidance

Detection rules, incident response steps, and D3FEND-aligned mitigation strategies are included so your team can act on this intelligence immediately.

🔗 STIX Visualizer

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 Generator

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.