Get the Zoom link

Logging & Telemetry

The log you do not have is the investigation you cannot finish. The log you collect everywhere is the bill that ends the program.

· · Vendor-neutral · View source on GitHub

The 30-second version: Turn on the control plane in every account, project, and subscription, and send it somewhere the workload cannot delete. Turn on identity logs from the IdP next. Turn on data-plane and full-fidelity network logs only for the systems you would page a human about. Everything else is a retention and cost decision, not a security decision. A detector product is not a log.

On this page

  1. Which plane the log lives on
  2. Control plane, first
  3. Identity, second
  4. Data plane and network, on purpose
  5. What not to collect
  6. Retention and what it costs
  7. The first events worth alerting on
  8. Where next

Which plane the log lives on

Cloud logging arguments go sideways because people use "the logs" for five different things. Name the plane before you name the product.

GuardDuty, Defender for Cloud, and Security Command Center are detectors. They read some of the logs above and emit findings. If you only keep the finding and drop the underlying event, you cannot answer "what else did this identity do in the hour before." Keep the source log. Treat the detector as a second opinion.

Control plane, first

If you do nothing else, do this. A trail, a diagnostic setting, or an audit-log sink that covers every account in the organization, lands in a logging account the application teams cannot administer, and cannot be stopped by someone who has compromised a single workload.

On AWS that is an organization CloudTrail, written to a bucket in a separate account, with the trail's own StopLogging and the bucket's DeleteObject outside the permissions of the accounts being watched. On Azure it is Activity Log diagnostic settings at the subscription, preferably collected by an Azure Policy initiative so a new subscription does not arrive silent. On GCP it is Admin Activity audit logs, which are on by default, exported from the organization to a sink the project owners do not control. Data Access audit logs are not on by default. That distinction matters, and it is the next section's problem, not this one's.

Two properties matter more than the brand of the log store. The log must exist before you need it, and the person who can change the resource must not be the person who can erase the record of that change. Object lock, a retention policy, or a bucket policy that denies delete from the source account is the control. A dashboard that "monitors whether logging is on" is a consolation prize for not having the control.

Identity, second

Control-plane logs tell you an access key was used. They do not tell you that the human behind the federated role had their session stolen at the IdP an hour earlier, or that someone consented an OAuth application with mail-read and then never signed into the cloud at all. IAM abuse that never touches the cloud API is invisible to CloudTrail.

Collect, at the IdP: interactive and non-interactive sign-ins, MFA challenges and their result, legacy-protocol authentication, new application consents, credential registration (a new FIDO key, a new authenticator), and role or group changes. Keep the cloud side too: AssumeRole, service-account key creation, managed-identity assignment, and any event that mints a long-lived credential. The pair is the story. Either half is a fragment.

Workload identity belongs in the same bucket of attention even though it is not a person. A new role trust that allows a GitHub repository, a Kubernetes service account, or an external OIDC issuer is a standing authentication decision. Log the change when the trust is created. You will not get a useful "sign-in" for it later, because the workload presents a token and the cloud says yes.

Data plane and network, on purpose

Data events answer "who read this object." You want that answer for the buckets, tables, and secrets that would hurt if they left. You do not want it for every build artifact, every temporary object, and every health-check GET. The failure mode is flipping data events on at the organization and discovering the bill, then flipping them off everywhere, including the one bucket that mattered.

Pick the crown jewels by name. Production data stores, the secrets manager, the logging bucket itself, and anything holding customer data or credentials. Sample or exclude the rest. Revisit the list when a new store is created, which is an argument for a tagging convention (data-class=restricted turns data events on) rather than a wiki page nobody updates.

Network logs are the same shape of decision. Flow logs are how you prove a path existed, or that it did not. Full-fidelity flow logs from every interface, ingested into a SIEM priced per gigabyte, are how a logging program gets cancelled. Keep flow logs for the sensitive subnets in the SIEM or in the detection pipeline. Keep the rest, sampled, in cheap object storage for the investigation you do not know you will have. DNS query logs are worth more per byte than flow logs for command-and-callback questions, and they are still not free. Turn them on where the workloads can make arbitrary outbound calls, not on a network that already denies egress.

What not to collect

A logging program fails as often by collecting the wrong thing as by collecting nothing.

Retention and what it costs

There are two clocks, and they should not share a price.

Hot is the window you detect in. Days to a few weeks, in whatever system runs the rules. You pay for ingest and for query speed. Put the control plane and the identity logs here in full. Put a filtered slice of data and network logs here.

Cold is the window you investigate and comply in. Many programs land on a year because a framework, a contract, or an insurer asked for a year. Object storage in the logging account is the cheap place for that copy. You do not need to ask a SIEM a question about February in order to still have February. When you do need it, you replay the slice into the hot store or query it in place.

The number that surprises people is not storage. Storage of compressed logs is close to free at the scale of a single organization trail. The number is ingest into a tool that charges per gigabyte analyzed. Data events and flow logs dominate that number. If a vendor quote assumes "all logs," ask which plane. A quote that does not separate control plane from data plane is not a quote you can compare.

Retention also has an integrity problem. An attacker who can delete the trail has deleted the evidence of deleting the trail, unless the trail's storage refuses the delete. Set the retention on the bucket or the sink, not as a hope inside the SIEM. And log the logging: an event that stops the trail, deletes a sink, or changes a diagnostic setting is itself a control-plane event, and it belongs in the first-alert list.

The first events worth alerting on

Start with events that are rare, high impact, and hard for an attacker to avoid if they want to stay. Do not start with a content pack of four hundred rules. The detection engineering page is the lifecycle after you have a source. These are the sources' first questions.

Each of these fails closed in a useful way: if the log is missing, the absence is the alert, because you already decided the control plane is non-optional. A detection that only fires when a particular field is present will sit quiet through the week someone turned the trail off.

What you do with the alert is a different page. A finding that says "this identity can read production" is not, by itself, an incident. Working a finding is the four questions to ask before you open the ticket.

Where next