Detecting and Responding to Unexpected Cloud Activity
Most cloud compromises are found by a billing alert rather than a security tool. This guide covers the signals worth watching, usable thresholds, and what to do in the first hour.
Cloud compromises are rarely discovered by the security tooling teams spend money on. They are discovered by a billing alert, a service that stopped working, or a message from the provider. By then the activity has usually been running for days.
The gap between the first unauthorised action and the moment someone notices is the number that determines how bad an incident becomes. Everything in this guide is aimed at shortening it, and then at handling the hour after it closes without making the situation worse.
What unexpected activity looks like in practice
Forget the dramatic version. Real cloud incidents have a recognisable and rather boring shape.
The most common is resource abuse. A credential leaks, and within hours the account is running compute in regions you have never used, usually for cryptocurrency mining. The attacker does not care about your data at all; they want your capacity, and the only symptom is the bill.
The second is data access. Someone with a valid credential reads storage they should not, often through an over-permissive policy rather than any clever technique. This produces no performance change and no error, which is why data plane logging exists.
The third is persistence. A new identity is created with administrative rights, or a new access key is attached to an existing one, so that revoking the original credential changes nothing. This is the step teams miss most often.
The fourth is destructive, where resources are deleted or encrypted. It is the least common and by far the most visible.
Signals worth watching
You cannot watch everything, so pick signals with a high ratio of meaning to volume. These earn their place.
- Spend rate change. The single most reliable detector of resource abuse. Alert on an hourly or daily rate that departs from your normal pattern, not on a monthly total, because a monthly threshold triggers after the damage.
- Activity in unused regions. If you operate in two regions, any API call creating a resource in a third is worth waking someone for. False positives are near zero.
- Identity and permission changes. New users, new access keys, policy attachments granting administrative rights, and any change to the account’s organisation-level controls.
- Root or owner identity use. That login should be used once or twice a year. Any use is either planned or serious.
- Authentication anomalies. Repeated failures against one identity, a successful sign-in from an unfamiliar country, or a sign-in without the expected second factor.
- Logging configuration changes. Disabling a trail or deleting a log destination is almost never legitimate maintenance.
- Storage becoming public. One of the few misconfigurations that is both common and immediately exploitable.
- Egress volume spikes. A sustained jump in outbound transfer from a system that normally sends little is how bulk data removal appears.
All of these depend on having the record in the first place, which is why the configuration in audit logging and activity monitoring from day one is a prerequisite rather than a companion piece.
Thresholds that do not train you to ignore them
An alert that fires every day stops being an alert. Within a fortnight it is a filter rule in someone’s mailbox, and the control has quietly been removed without anybody deciding to remove it.
Build a baseline before setting any threshold. Watch the metric for a few weeks and set the trigger above the observed normal variation, not at a number that sounds responsible. Separate the urgent from the informational and route them differently: a page for root identity use, a daily digest for a modest spend increase. Where a signal is noisy, alert on a sustained condition rather than a single sample, since most false positives are momentary.
Review firing history monthly. Any alert that has fired more than a handful of times without producing an action is either mistuned or pointing at something you should fix at the source. Any alert that has never fired should be tested, because an alert that cannot fire is indistinguishable from one that has nothing to report.
The first fifteen minutes
When something looks wrong, the instinct is to start deleting. Resist it for a quarter of an hour and work through this instead.
- Confirm it is real. Check whether a colleague is running something. A surprising number of incidents are a teammate testing in an unfamiliar region.
- Preserve the record before you change anything. Export or snapshot the relevant logs to somewhere outside the affected account. Deleting a compromised instance destroys its memory and local disk, which may be the only evidence of what ran.
- Establish scope. Which identity performed the actions, from which addresses, over what period, and what else did that identity touch.
- Identify the entry point. A leaked key, a stolen session, a public resource, or a vulnerable application. The response differs for each.
- Start a timeline document. Timestamps, actions taken, who is doing what. Memory is unreliable during an incident and you will need this afterwards.
If a long-lived credential is implicated, the handling in secrets management covering keys, tokens and rotation applies, and the first step there is revocation rather than investigation.
Containment without destroying what you need
Containment means stopping the activity while keeping your ability to understand it.
Revoke the credential that was used, and terminate active sessions for it, because revoking a key does not end a session already established. Then look for the second way in before you relax: new identities, new keys on old identities, modified policies, and any changed trust relationship that lets an external party assume a role in your account.
For a compromised instance, isolate rather than delete. Replace its security group with one that permits no traffic, which stops the activity while leaving the machine available for examination. Take a disk snapshot before anything else. If the workload matters, bring up a replacement from a known-good image rather than cleaning the affected one.
Where resources were created by the attacker, record their details before removing them. Instance types, regions, timestamps and any attached configuration tell you what the operation was for and sometimes how it got in.
Replacing credentials after the event
Partial credential replacement is why incidents recur. Once you accept that an identity was compromised, assume everything it could reach is also suspect.
Rotate every access key on the account rather than only the one you found. Force a password reset and re-enrol second factors for human identities, following the ordering in multi-factor authentication across cloud providers. Rotate application secrets, database passwords and any token the compromised identity could have read. Regenerate recovery codes. Review every policy for changes made during the exposure window, and compare against your infrastructure definitions rather than against memory.
Then verify the account inventory against what should exist: identities, keys, instances, storage containers, scheduled functions and network rules. Anything you cannot account for gets disabled rather than ignored.
Writing the incident down
The record is worth more than it feels like at the time. Capture how the activity started, how it was detected, how long it ran before detection, what it reached, what you did, and what you would change.
The most useful line is almost always the detection gap. If a compromise ran for six days before a billing alert caught it, the question is which signal would have caught it on day one and why it was not configured. That answer is worth more than any new tool.
Share the write-up internally without blame. If the entry point was a key committed to a repository, the fix is scanning at commit time, not a conversation with one engineer. Where a framework applies, this document is also the evidence that your response process exists and functions, as discussed in what GDPR, HIPAA and SOC 2 require of a cloud deployment.
Reducing the next blast radius
Detection improves the outcome. Structure limits it in advance, which is better.
Keep environments in separate accounts so a compromise in one cannot reach another. Use short-lived credentials so a leaked value expires on its own. Apply spending limits and service quotas, since a quota that caps instance count in unused regions turns an expensive incident into a cheap one. Keep backups in a separate account with immutability enabled, because an attacker who can delete your backups removes your main recovery option. Narrow permissions so that one identity does not reach everything.
Accounts you did not create yourself deserve extra attention here, since the history before your tenure is unknown. The checks in securing an inherited cloud account should come before you rely on any detection you configure.
How much of this the platform does for you varies. The larger providers ship managed threat detection services that analyse audit and network logs for known patterns and surface findings without you writing the rules. Smaller providers leave the analysis to you, which usually means forwarding logs to a tool of your own. The AWS vs Google Cloud comparison covers how the two approach that tooling, and listings such as Buy AWS Account and Buy Google Cloud Account are the usual starting points for teams that want native detection rather than a stack they assemble themselves.