Additional cloud credentials
| Class | Persistence, Secrets |
|---|---|
| MITRE ATT&CK | T1098.001 Account Manipulation: Additional Cloud Credentials |
| Tactics | Persistence, Privilege Escalation |
| Typical severity | Critical |
| Affects | AWS IAM users and the root user, Google Cloud service accounts, Microsoft Entra ID applications, service principals and user accounts |
Deactivating a leaked cloud key ends only the access that ran through that key. An attacker who used it for a few minutes may already have attached a second access key to the same user, a console password to a new user, or a secret to an application's service principal. These additional cloud credentials are controlled by the attacker and let them sign in again by a route the account owner never created.1
Each large provider has an API call that adds a credential, and any identity with the matching permission can make it. The new credential sits next to the legitimate ones on the same account. When the identity that receives the new credential holds more rights than the identity that added it, the same step raises the attacker's privileges as well.1
Kinds of credential
| Provider | Call or command | What it adds |
|---|---|---|
| AWS | CreateAccessKey | An access key on an IAM user. A user can hold two at once.2 |
| AWS | CreateLoginProfile | A password for the AWS Management Console.1 |
| AWS | CreateKeyPair, ImportKeyPair | An SSH key for EC2 virtual machines.1 |
| AWS | sts:GetFederationToken | Temporary credentials valid for up to 36 hours.3 |
| Google Cloud | gcloud iam service-accounts keys create | A key for a service account. An account can hold ten, and by default they never expire.4 |
| Google Cloud | gcloud compute os-login ssh-keys add | An SSH key for virtual machines.1 |
| Microsoft Entra ID | Azure Portal, Azure CLI, PowerShell | A password or an x509 certificate on an application or service principal.1 |
| Microsoft Entra ID | App password on a user | A password for older clients that cannot do multi-factor sign-in.1 |
An SSH key registered at the cloud level opens a shell on the virtual machines directly, so after that the attacker no longer needs the cloud account they first broke into.1 The same move made on a single server, an extra line in its key file, is described in SSH authorized key persistence.
Credentials that outlive the fix
On AWS, sts:GetFederationToken exchanges a long-term access key for temporary credentials. They carry the permissions of the user who asked, narrowed to a session policy passed in the call; without one, the session can do nothing. A session lasts between 15 minutes and 36 hours, with 12 hours as the default.3 Deactivating the original access key does not end it.1 Temporary credentials stay valid until they expire, so stopping them means changing the permissions of the user behind them, a change that can take a few minutes to apply.5 Credentials of this kind requested with the root user's key are limited to one hour, and their permissions cannot be changed at all.35
Microsoft Entra ID has app passwords for legacy devices that cannot complete two-factor authentication sign-in. An app password added by an attacker gets around the account's MFA requirement and may keep working after the user's main password is reset.1
The privilege gain comes from adding a credential to someone else's identity. In Entra ID, the Application Administrator role can add credentials to an application's service principal; the new secret then signs in with the service principal's roles, which may differ from the administrator's own.1 During the SolarWinds compromise, APT29 added credentials to OAuth applications and service principals.1
Case: a leaked key in a management account
In May 2025, Datadog Security Labs described an intrusion that started from a leaked long-term AWS access key belonging to an IAM user in an organization's management account. Five IP addresses tried to use the key within 150 minutes.6 The attacker created several IAM users, among them adminslabs and git-lab555, gave them administrator rights directly or through a group, and on some tried to create a login profile for the console. They also turned the long-term key into temporary credentials from AWS's Security Token Service (STS), which can sign in to the console.6
Two steps went further. A Lambda function (code that AWS runs on request) named buckets555, triggered through an HTTP API Gateway, created new IAM users on request, which let the attacker make accounts from outside even after the leaked key was revoked. In IAM Identity Center the attacker added a user called Secret to a new group with its own permission set, changed the instance's settings to allow sign-in without MFA, and later signed in as Secret with a password alone.6
Finding them
On AWS, the events to watch in the audit log are CreateAccessKey, CreateLoginProfile and ImportKeyPair, above all when they come from an unusual identity or IP range, or from outside the console.1 The 2025 case adds two more signals: IAM users created from Lambda, whose user agent contains exec-env/AWS_Lambda, and GetFederationToken calls that pass a highly privileged policy.6 For a single AWS key, aws iam get-access-key-last-used shows when it was last used.7
In Entra ID, a new secret or certificate on an application appears in the audit log as Update Application-Certificates and secrets management. Credentials added outside working hours, outside the normal workflow, or of a type the tenant does not use deserve an alert.8
After a leaked key has been replaced, the account still needs a search for what the attacker added: extra access keys, login profiles and new users, SSH key pairs, service account keys, application secrets and, on AWS, live federated sessions. The response steps are in Responding to a leaked API key; related footholds are added administrator accounts and rogue two-factor devices.
Limiting who can add them
The permission to add access keys belongs only with the few identities that manage keys, and on AWS sts:GetFederationToken can be denied to every user that has no use for it.1 IAM policy conditions can require MFA for the EC2 key pair calls. In Entra ID, the app password feature can be switched off where no legacy client needs it.1
On Google Cloud, creating a service account key needs the Service Account Key Admin role (roles/iam.serviceAccountKeyAdmin). Enforcing the organization policy constraint iam.disableServiceAccountKeyCreation blocks key creation in every project it covers.9 An expiry time can also be set for all new keys in a project, folder or organization.4
AWS treats roles and temporary credentials as the better choice over access keys,2 Google's short-lived service account tokens expire after one hour by default,4 and Microsoft prefers certificates or managed identities to client secrets, with short lifetimes for any secret that remains.8 Short-lived credentials and OIDC federation covers how CI jobs and servers run without stored keys, and Principle of least privilege the wider principle.
See also
- Stolen cloud credentials
- Orphaned access tokens and OAuth grants
- Service accounts
- Over-privileged access token
- Category: Persistence
References
- a b c d e f g h i j k l m n o MITRE (version 2.8, 4 November 2026). "Account Manipulation: Additional Cloud Credentials, T1098.001". MITRE ATT&CK.
- a b Amazon Web Services (n.d.). "Manage access keys for IAM users". AWS Identity and Access Management User Guide.
- a b c Amazon Web Services (n.d.). "GetFederationToken". AWS Security Token Service API Reference.
- a b c Google Cloud (n.d.). "Service account credentials". Google Cloud IAM documentation.
- a b Amazon Web Services (n.d.). "Disabling permissions for temporary security credentials". AWS Identity and Access Management User Guide.
- a b c d McCloskey, Martin (13 May 2025). "Tales from the cloud trenches: The Attacker doth persist too much, methinks". Datadog Security Labs.
- back Amazon Web Services (n.d.). "Update access keys". AWS Identity and Access Management User Guide.
- a b Microsoft (n.d.). "Microsoft Entra security operations for applications". Microsoft Learn.
- back Google Cloud (n.d.). "Create and delete service account keys". Google Cloud IAM documentation.
External links
- Disabling permissions for temporary security credentials, AWS IAM User Guide