Every API call. Every console login. Every action someone or something takes. It’s all there in CloudTrail, an ocean of data waiting to tell you if you’re compliant or one step away from a reportable incident. For ISO 27001, that ocean needs a map — and that’s what CloudTrail query runbooks can give you.
Why ISO 27001 Needs CloudTrail Queries
ISO 27001 isn’t just about locking data away. It’s proof that you can track, detect, and investigate unusual activity. CloudTrail is perfect for this. It records every move in your AWS environment. But logs mean nothing without the ability to query them on demand and store those queries as repeatable runbooks.
A runbook turns compliance from a once-a-year panic into a daily practice. For ISO 27001 controls like A.12.4.1 (Event Logging) and A.16.1.5 (Response to Information Security Incidents), CloudTrail queries make your evidence exact, reproducible, and quick to produce during an audit.
Building Your ISO 27001 CloudTrail Query Runbooks
- Identify Scope
List all critical AWS services in use. Map them against your ISO 27001 controls that require monitoring. - Create Baseline Queries
Use AWS Athena or CloudWatch Logs Insights to build filters for admin privilege escalations, root account usage, changes to IAM policies, access from unknown IPs, and modifications to security groups. - Parameterize for Reuse
Store time ranges, usernames, and resource IDs as variables. This makes each query easily adjustable without rewriting SQL or filter syntax. - Document Purpose and Output
Every runbook should state what it checks, why it exists, and which controls it supports. This makes audits faster and incident investigations sharper. - Schedule and Automate
Run critical queries daily. Keep results in secure storage with retention aligned to your ISO 27001 evidence policy.
Example Core Queries for Compliance
- Root Account Usage: Filter
eventNamefor any actions byRootprincipal. - IAM Policy Changes: Search for
PutUserPolicy,PutRolePolicy,AttachRolePolicy, and related events. - Multi-Factor Authentication Changes: Detect
DeactivateMFADeviceorDeleteVirtualMFADevice. - Access from Anomalous Regions: Compare
awsRegionto your approved geography list. - Security Group Open to World: Match events where
cidrIpequals0.0.0.0/0.
These are the building blocks. Together, they form the audit trail that ISO 27001 demands.