
SAML Attacks Explained: Risks and Defenses
September 28, 2026Your security team just completed its annual access review. Every human user account is audited, every privilege escalation is documented, and every orphaned credential is revoked. The CISO signs off, satisfied. What the report didn’t capture: the 47,000 service accounts, API keys, OAuth tokens, and machine credentials quietly operating across your cloud environments — most of them over-privileged, many of them never rotated, and a significant fraction belonging to systems that were decommissioned six months ago. This is non-human identity sprawl, and it is currently the most underestimated attack surface in enterprise security.
According to CyberArk’s 2026 Identity Security Threat Landscape Report, non-human identities (NHIs) now outnumber human identities in enterprise environments by a ratio of 45-to-1. Yet the average organization applies less than 20% of its identity governance controls to machine identities. The gap between the scale of NHI deployment and the maturity of NHI governance is not an inconvenience — it’s a systemic vulnerability that sophisticated threat actors are actively and systematically exploiting.
What Non-Human Identity Sprawl Actually Means
Non-human identities are any credential, token, certificate, or secret used by a software system — rather than a person — to authenticate and authorize actions. This includes service accounts, API keys, SSH keys, OAuth 2.0 tokens, JSON Web Tokens (JWTs), cloud IAM roles, Kubernetes service accounts, CI/CD pipeline credentials, and RPA bot accounts. The term “sprawl” refers to the uncontrolled proliferation of these identities without corresponding lifecycle management, least-privilege enforcement, or audit capability.
The problem is structural. Modern application architectures are microservices-driven, cloud-native, and heavily automated. Every microservice needs to authenticate to other services. Every CI/CD pipeline needs credentials to push code and deploy infrastructure. Every third-party SaaS integration requires an API key or OAuth scope. Each of these creates a new non-human identity — often provisioned by a developer under deadline pressure, with permissions scoped too broadly “to make it work,” and then forgotten the moment the feature ships.
The Lifecycle Management Failure
Human identity lifecycle management is relatively mature. HR systems trigger provisioning and deprovisioning. Role-based access control (RBAC) frameworks enforce least privilege. Privileged access management (PAM) tools vault and rotate credentials. None of these controls reliably extend to NHIs. A service account created for a proof-of-concept deployment may retain production-level database access for years after the POC was abandoned. An API key embedded in a Lambda function may never be rotated because no one documented who owns it.
The 2025 Verizon Data Breach Investigations Report identified credential abuse as the top initial access vector, with machine credentials featured prominently in cloud-targeted attacks. When a threat actor compromises a GitHub repository and finds a hardcoded AWS access key with S3 full-access permissions, the ROI on that discovery is extraordinary — it requires no phishing, no social engineering, and no zero-day exploitation.
Sprawl as an Organizational Behavior Problem
Sprawl isn’t just a tooling deficit — it reflects cultural and process failures. Development teams optimize for velocity. Platform engineering teams optimize for availability. Security teams are often consulted too late in the delivery cycle to enforce NHI governance from the start. The result is that secrets management, token rotation, and access scoping become afterthoughts rather than embedded practices. Without automated discovery and policy enforcement, sprawl compounds with every sprint cycle.
Attack Patterns Targeting Non-Human Identities
Understanding how adversaries operationalize NHI sprawl requires examining concrete attack patterns that have moved from theoretical to routine in the threat landscape.
Secret Scanning and Repository Mining
Automated tooling for scanning public and private repositories for hardcoded secrets is freely available and widely used by both legitimate security researchers and threat actors. GitGuardian’s 2026 State of Secrets Sprawl report found that one in ten active repositories contains at least one hardcoded secret, with generic high-entropy strings and cloud provider credentials being the most common findings. The 2022 Toyota breach — where a subcontractor’s GitHub repository exposed a credential providing access to 296,000 customer records — remains a textbook case, but similar incidents have continued to emerge across verticals in subsequent years.
The attack surface extends well beyond public repositories. Private repository access through compromised developer accounts, build artifact storage, container image layers, and configuration management databases all represent secondary vectors for secret extraction. Attackers who establish initial access through a developer endpoint will systematically enumerate every secrets store reachable from that position.
Token Hijacking and OAuth Abuse
OAuth tokens and service account JWTs present a distinct exploitation path. Unlike symmetric API keys, OAuth tokens often carry rich permission scopes determined at authorization time, may be long-lived or improperly refreshed, and can be extracted from memory, browser storage, or token caching layers. The 2023 Microsoft Storm-0558 incident, in which threat actors forged authentication tokens to access cloud email accounts, demonstrated that the security properties of token-based authentication are only as strong as the key material and validation logic underlying them.
In Kubernetes environments, improperly configured service account token automounting creates a particularly dangerous condition. By default (prior to Kubernetes 1.24), tokens were automatically mounted into every pod — meaning a container escape in one workload could yield a service account token with cluster-wide permissions, depending on how RBAC was configured.
Inventory and Discovery: You Cannot Govern What You Cannot See
The foundational challenge in addressing NHI sprawl is achieving accurate, continuous inventory. Unlike human identities — which are anchored to HR records, directory services, and ticketing workflows — non-human identities are created across dozens of planes: cloud provider IAM consoles, secrets managers, CI/CD platforms, API gateways, Kubernetes clusters, SaaS platforms with developer APIs, and code repositories. No single authoritative source of truth exists by default.
Discovery Tooling and Integration Points
Effective NHI discovery requires integration across several data sources simultaneously. Cloud Security Posture Management (CSPM) tools can enumerate IAM roles, service principals, and access keys across AWS, Azure, and GCP. Secrets management platforms like HashiCorp Vault, AWS Secrets Manager, and Azure Key Vault provide visibility into centrally stored credentials — but only for secrets that have been migrated into those stores, which is rarely all of them. Static analysis and SAST tooling integrated into CI/CD pipelines can detect hardcoded secrets before they reach version control. Network-level analysis can surface unexpected authentication patterns that indicate orphaned or unknown service credentials in active use.
The 2026 Gartner Identity Security Report projects that by 2027, organizations that implement automated NHI discovery integrated with their CMDB and cloud management planes will reduce mean time to detect NHI-related incidents by 60% compared to those relying on manual audit processes. The investment case for automation is clear — manual discovery at the scale of tens of thousands of machine identities is operationally infeasible.
Classification and Risk Scoring
Raw inventory without context produces noise rather than actionable intelligence. Effective NHI governance requires classification along several dimensions: sensitivity of the systems the identity can access, age and rotation status of the credential, whether the identity is actively used (and by what), the breadth of permissions granted versus required, and whether a human owner can be attributed to the identity. Organizations that implement risk scoring frameworks for NHIs — analogous to the vulnerability scoring frameworks applied to CVEs — report significantly improved prioritization and faster remediation of high-risk identities.
Governance Frameworks and Least-Privilege Enforcement
Controlling NHI sprawl requires embedding governance into the identity lifecycle rather than applying it retrospectively through periodic audits. Several frameworks and architectural principles are directly applicable.
Zero Standing Privilege for Machine Identities
Just-in-time (JIT) access provisioning, long established as a best practice for privileged human accounts, is increasingly being applied to machine identities. Under a zero standing privilege model, a service account or automation workflow receives elevated permissions only for the duration of a specific task and only after satisfying contextual authorization conditions. Cloud providers have made this model increasingly accessible: AWS IAM roles with session policies, Azure Managed Identities with conditional access, and GCP Workload Identity Federation all support more granular, time-bound permission structures than traditional static API keys.
Netflix’s engineering blog has documented their implementation of SPIFFE (Secure Production Identity Framework for Everyone) and SPIRE for workload identity, enabling cryptographic attestation of workload identity rather than reliance on static secrets. This architecture eliminates entire classes of credential theft risk by ensuring credentials are short-lived and bound to verified workload context.
Secrets Rotation and Vault-First Architecture
Mandatory rotation policies, enforced programmatically rather than by policy document alone, are a prerequisite for reducing exposure from compromised credentials. Organizations should target rotation intervals appropriate to the sensitivity of the system accessed — critical infrastructure credentials rotated every 24–72 hours, lower-sensitivity API integrations rotated quarterly at minimum. Vault-first architecture — wherein all application secrets are retrieved at runtime from a centralized secrets manager rather than embedded in configuration files or environment variables — is the architectural enabler of automated rotation.
The operational friction of vault-first architecture is real but manageable. Sidecar injection patterns in Kubernetes, environment variable injection through secrets manager plugins, and native integrations between CI/CD platforms and secrets managers significantly reduce developer friction while maintaining security properties.
Detection, Response, and the NHI Threat Model
Even with strong preventive controls, detection capability for NHI abuse is essential. Machine identities exhibit behavioral patterns that differ from human users: predictable access times, consistent source IPs or workloads, narrow permission utilization, and routine API call sequences. Anomalies against these baselines — a service account suddenly querying resources outside its normal scope, an API key authenticating from a novel geolocation, an OAuth token used at an unusual time — are high-fidelity signals of credential compromise.
UEBA and NHI-Specific Detection Rules
User and Entity Behavior Analytics (UEBA) platforms have historically focused on human user behavior but increasingly incorporate machine identity baselines. Security teams should define detection rules specifically tailored to NHI abuse scenarios: first-time access to sensitive resource types, credential use from cloud metadata APIs (a common privilege escalation path in AWS environments), anomalous token issuance rates, and API key use following a period of dormancy. SIEM correlation rules that join cloud audit logs (CloudTrail, Azure Monitor, GCP Cloud Audit Logs) with secrets manager access logs provide the telemetry foundation for these detections.
Incident response playbooks for NHI compromise should be developed and tested independently from human identity compromise playbooks. The remediation actions differ: credential revocation is typically faster and more straightforward than disabling a human account, but blast radius assessment — determining what systems the compromised identity had access to and what actions it may have taken — requires distinct forensic workflows and tooling.
Key Takeaways
- Scale demands automation: Non-human identities outnumber human identities by orders of magnitude in modern enterprises. Manual governance is not viable — automated discovery, classification, and lifecycle management are operational necessities, not optional enhancements.
- Hardcoded secrets remain the highest-frequency, lowest-sophistication attack vector against NHIs. Shifting secrets management left into CI/CD pipelines with SAST tooling and enforcing vault-first architecture eliminates this vector structurally.
- Least privilege is harder and more important for machine identities than for humans. Service accounts and API keys routinely accumulate permissions far beyond operational requirements. Regular entitlement reviews and JIT access provisioning are essential controls.
- Behavioral baselines for machine identities are powerful detection instruments. The predictability of legitimate machine behavior means anomalies are highly significant — organizations that instrument cloud audit logs with NHI-specific detection rules gain measurable advantages in mean time to detect credential compromise.
- NHI governance must be embedded in developer workflows, not bolted on by security teams after the fact. Platform engineering teams that provide secure-by-default identity patterns — managed identities, SPIFFE/SPIRE-based workload identity, automated secret injection — remove the friction that drives insecure practices in the first place.
Conclusion: From Inventory to Architecture
Non-human identity sprawl is not a problem that yields to periodic audits or compliance checkbox exercises. It is an architectural challenge that grows in proportion to your application delivery velocity. Organizations running cloud-native, microservices-based systems at scale are generating new machine identities faster than traditional governance processes can track them.
The path forward is not simply deploying a secrets manager or running a CSPM scan. It requires reframing NHI governance as a first-class security domain with dedicated tooling, ownership, and engineering investment. It requires security and platform engineering teams to co-design identity patterns that make secure behavior the path of least resistance for developers. And it requires detection and response capabilities specifically calibrated to machine identity abuse — because the adversaries targeting your NHI attack surface are already operating at scale.
Your specific action this week: Commission a cross-functional NHI inventory exercise spanning your three largest cloud accounts. Pull all IAM roles, service accounts, and API keys. For each identity, answer four questions: Who owns it? When was the credential last rotated? Is it actively used? Does its permission scope match its documented purpose? The gaps this exercise reveals will define your NHI security roadmap — and almost certainly surface at least one critical exposure that your last human identity audit completely missed.
💡 Enjoyed this article?
Subscribe for more expert insights delivered to your inbox.
Follow us or subscribe below xe2x80x94 free, no spam.





