Orphaned credentials are logins, keys, tokens, accounts or roles that still work after the person, project or system they were created for is gone. The owner left the company, the contractor finished the job, the pilot ended, the application was retired, but the access was never removed. Nobody uses it, and in many cases nobody remembers it exists. It still opens the door.
They are also called stale credentials, dormant accounts, zombie access or ghost accounts, depending on the tool and the context. The details differ, and the core problem is the same: access without an owner. An access path that no one is watching is exactly what an attacker wants, because no one will notice it being used.
This page explains how credentials become orphaned, why they are so dangerous, a recent real-world case, how to find them across cloud accounts and SaaS tools, and how to stop creating new ones.
How credentials become orphaned
- People change roles or leave. Offboarding removes the main account and misses the access keys, shared accounts, SaaS logins and personal tokens the person created.
- Projects end. A contractor or vendor is given a key for a project. The project ends and the key stays. Nobody owns the cleanup.
- Applications are retired. The service is decommissioned, and its service account, database user and secrets remain.
- Temporary access becomes permanent. Access is granted “for a quick fix” and never expires. See zero standing privilege.
- Mergers and migrations. Accounts from acquired companies and old systems come across with no review.
- Credentials are copied. A key is pasted into a script, a chat or a configuration file. Even if the original is revoked, copies elsewhere may still work, and if it is not revoked, the copies keep it alive.
- No single owner. The identity was created by a team that no longer exists, or by automation, with no record of why.
Why they are dangerous
- They are valid. An orphaned key is not a vulnerability. It is a working credential. Nothing needs to be exploited.
- Nobody is watching. A live account is monitored by its owner, who notices strange activity. An orphaned one has no owner to notice.
- They often carry broad access. They were created for a purpose that needed access, and rarely re-scoped after.
- They are easy to steal. Old keys sit in repositories, laptop backups, wikis and former vendors’ systems.
- They look normal. Use of an old but valid key may not trigger alerts tuned to detect new, unusual accounts.
- They are quickly found by automation. AI-assisted tools scan public repositories for secrets and try what they find. See AI agents scanning GitHub for secrets.
A recent case: the key that was never retired
On November 16, 2026, Barracuda described how an attacker got into its cloud environment. The company said it had given a cloud access key to an outside AI vendor for a past project, and that it did not retire the key when the vendor finished. Barracuda believes the attacker stole the key from a configuration file in the vendor’s GitHub repository in October, then used it between November 1 and 2 to access about ten of the company’s cloud accounts over 44 hours.
The key had no active purpose. It belonged to a finished project. It was nonetheless a valid way into production. We analyze the incident in Barracuda’s cloud breach and the vendor key nobody retired.
Types of orphaned credentials
| Type | Example | Typical risk |
|---|---|---|
| Departed-user accounts | A former employee’s cloud, source control or SaaS login | Account takeover, or use by the former user |
| Unused access keys | An IAM access key unused for months | Theft from old repositories or backups |
| Vendor and contractor access | A third party’s login or key after the engagement ended | Compromise of the vendor extends to you. See third-party risk. |
| Service accounts and service principals | An account for a retired application. See service principals. | Over-broad machine access that nobody reviews |
| Cross-account trust | A role that still trusts an account you no longer work with | Outsider can assume a role |
| Shared and default credentials | A shared admin password nobody can attribute | No accountability |
| Tokens and secrets in code | An API key in a repository or CI variable | Found by scanners. See secrets sprawl. |
| Long-lived AI and automation credentials | An agent or pipeline key that outlived its use | A growing category. See non-human identities. |
How to find them
Cloud access keys and users (AWS)
# Credential report: every user, key, age and last use
aws iam generate-credential-report
aws iam get-credential-report --query Content --output text | base64 -d \
| cut -d, -f1,4,5,9,10,11,14,15,16
# When was a specific key last used?
aws iam get-access-key-last-used --access-key-id AKIAEXAMPLEKEYID
# Roles that have not been used recently
aws iam list-roles --query 'Roles[].RoleName' --output text | tr '\t' '\n' | while read r; do
echo "$r $(aws iam get-role --role-name "$r" --query 'Role.RoleLastUsed.LastUsedDate' --output text)"
done
Look for keys older than 90 days, keys with no recent use, users that have not signed in for months, and roles with no last-used date. AWS documents the lifecycle in its guidance on access keys.
Google Cloud
gcloud iam service-accounts list --format="value(email)" | while read sa; do
echo "== $sa"
gcloud iam service-accounts keys list --iam-account="$sa" --managed-by=user
done
User-managed service account keys are the usual orphans.
Identity provider and SaaS
Export users, last sign-in dates, group memberships and application assignments from your identity provider. Compare against the HR system of record. Accounts with no matching active employee or sign-ins for months are candidates. For OAuth applications and integrations, list every third-party app with access and check who approved it.
Repositories and logs
Scan code and history for credentials with tools such as gitleaks or trufflehog, and scan logs and exports before sharing them. See how to stop secrets leaking in git.
Third parties
Keep a register of every vendor and contractor with access, with owner, scope and end date. Anything without an end date is a candidate.
How to clean up safely
- Assign an owner to every identity. If no one claims it, it is a candidate for removal.
- Disable before deleting. Deactivate the key or account, wait a defined period, watch for breakage, then delete. A deactivated key can be turned back on.
- Rotate what you cannot remove. If a credential is needed but its history is unknown, replace it. See secret rotation.
- Clean up trust relationships. Remove cross-account trust for accounts you no longer deal with.
- Check for copies. After revoking a key, search for where else it was used.
- Record the change. Note what was removed, when and why, for your audit trail.
# Deactivate first (reversible)
aws iam update-access-key --user-name USER --access-key-id AKIAEXAMPLEKEYID --status Inactive
# After a quiet period, delete
aws iam delete-access-key --user-name USER --access-key-id AKIAEXAMPLEKEYID
How to stop creating them
Cleanup without prevention is a treadmill.
- Give every access an end date at creation. Contracts, onboarding forms and tickets should carry it. Renewal needs a reason.
- Automate offboarding. Connect HR events to identity and access removal, including SaaS apps and cloud accounts.
- Prefer short-lived credentials. Roles and tokens that expire in hours cannot be orphaned for long. Prefer these to long-lived keys.
- Use just-in-time access for people and third parties. Access that is requested for a reason and expires by itself cannot sit unused. See just-in-time access.
- Review regularly, with data. Reviews should show last-used dates and let the reviewer remove access with one action.
- Alert on dormant identities waking up. An old key that is suddenly active is a strong signal. See cloud UEBA.
- Apply least privilege so any orphan that remains can do little.
How Cloudanix helps
Cloudanix finds orphaned access and stops new standing access from forming.
- Finding them. Non-human identity visibility and CIEM list service accounts, keys, roles and users across AWS, Azure and GCP, flag the stale and over-permissioned ones, and show what each could reach. Findings are ranked by exposure, environment, data and identity with contextual severity, so the forgotten production key ranks above the forgotten test one. See CIEM for multi-account AWS.
- Preventing them. Cloud JIT replaces standing human and third-party access to AWS, Azure and GCP with a request, approve, time-boxed grant, auto-revoke lifecycle. Database JIT, VM JIT and Kubernetes JIT do the same for databases, servers and clusters. Agentic JIT and Coding Agent JIT give pipelines and AI agents credentials that last for a task. Access ends by itself, so there is nothing to forget. See contractor access and third-party access with JIT.
- Showing the proof. Every request, approval, session and revocation is logged with the real person’s identity to storage you own.
- Catching repository leaks. Code Security scans pull requests and full git history for hardcoded credentials, and can fail a pull request that introduces one.
The limit: Cloudanix cannot see or revoke a key it was never connected to, and it cannot scan a vendor’s own repository. Long-lived credentials that already exist outside JIT need to be found, rotated and replaced.
Further reading
- AWS: Managing access keys for IAM users
- AWS: IAM security best practices
- OWASP Secrets Management Cheat Sheet
Frequently asked questions
What are orphaned credentials?
They are logins, keys, accounts or roles that still work after the person, project or system they were created for is gone, and which nobody owns or monitors.
What is the difference between orphaned and stale credentials?
The terms overlap. “Stale” usually means not used or not rotated for a long time. “Orphaned” means there is no owner. A credential can be one without being the other, and both are risks.
How do orphaned credentials lead to breaches?
They are valid and unmonitored, so an attacker who finds one can use it without exploiting anything and with little chance of being noticed. Barracuda’s reported incident began with a vendor key that was never retired.
How often should I review access for orphaned credentials?
Continuously where you can automate it, and at least quarterly for privileged and third-party access. Review with last-used data, not names alone.
How does just-in-time access help?
It gives access an end date by default. Access that is requested for a reason and revoked automatically cannot become orphaned.