Cloud Logging and Monitoring

Turn on and centralise control plane, data and network logs in the cloud, and alert on the events that matter.

Intermediate · about 6 hours · difficulty 3/5

Learn first: Cloud IAM, Log Sources and Telemetry

Cloud platforms record almost every administrative action, but only if you enable the right logs and keep them somewhere safe. Without them, investigations in the cloud are guesswork.

Log types

  • Control plane / audit logs: who called which API. AWS CloudTrail, Azure Activity Log and Entra sign-in logs, Google Cloud Audit Logs.
  • Data access logs: reads and writes to storage or databases (for example CloudTrail data events, S3 server access logs). Often off by default and can be costly, so enable them for sensitive data.
  • Network logs: VPC or VNet flow logs, load balancer and WAF logs, DNS query logs.
  • Workload logs: OS and application logs from VMs, containers and functions.

Setup essentials

  • Enable audit logging in every region and account, organisation-wide.
  • Send logs to a dedicated, locked-down logging account with restricted delete permissions and object lock or retention policies.
  • Forward to your SIEM.
  • Turn on native threat detection such as GuardDuty, Microsoft Defender for Cloud or Security Command Center.

High-value alerts

  • Root or global admin sign-in.
  • Logging disabled or trails deleted.
  • New access keys or role trust changes.
  • Security groups opened to 0.0.0.0/0 on admin ports.
  • Storage made public.

Pitfalls

  • Logging only in the primary region while resources appear elsewhere.
  • Logs stored in the same account an intruder controls.

Good enough to move on: you can enable an organisation trail or equivalent, query it for who changed a security group, and set an alert for logging being disabled.

Key concepts

  • Audit logs (CloudTrail, Activity Log)
  • Data access logs
  • Flow and DNS logs
  • Central log archive account
  • Native threat detection services
  • High-value cloud alerts

Mini project

In a free-tier account, enable CloudTrail (or the Azure/GCP equivalent) to a protected bucket, enable GuardDuty or Defender for Cloud, then create a security group change and find the exact event that recorded it.

Check yourself

Why should cloud audit logs be stored in a separate account with restricted delete permissions?

Free resources