View a markdown version of this page

FND05-BP03 Configure audit logging of cloud operations - AWS Well-Architected Framework

FND05-BP03 Configure audit logging of cloud operations

Enable audit logging across your cloud environment and verify it produces a complete, accurate record of actions taken. Use these logs to investigate incidents, alert on specific operations or behavioral anomalies, and reconstruct the timeline and scope of an incident.

Desired outcome:

  • You have established full audit logging across your entire cloud environment to improve visibility into actions taken by users, roles, and services.

  • Your logs capture enough detail to support rapid incident response, so you can identify the timeline of actions, scope of an incident, and the path to recovery.

  • Your organization uses these logs to meet compliance requirements, enforce organization policies, and detect violations of those policies.

  • You have defined a centralized location for storing and querying logs across all accounts and Regions in your organization.

  • Your logs are protected from tampering or unauthorized modification through encryption, access controls, and immutability features.

Common anti-patterns:

  • Failing to enable logging for all relevant cloud services and environments, leading to blind spots in visibility and inability to detect incidents.

  • Keeping logs for insufficient time, limiting historical analysis of events and preventing retrospective security investigations.

  • Granting overly broad access to logs, potentially exposing sensitive information.

  • Failing to protect logs from tampering or unauthorized modification or deletion.

  • Storing logs only in the same account or Region where the resources exist, creating a single point of failure.

  • Enabling logging without establishing processes to analyze, alert on, or respond to the events captured.

Benefits of establishing this best practice:

  • Full audit logging supports rapid incident response by giving visibility into the timeline, scope, and effect of security events.

  • Anomalous behavior and potential security threats are detected faster through log analysis and alerting.

  • Compliance posture is strengthened through detailed, auditable records that support regulatory requirements and internal policies.

  • Centralized logging improves operational efficiency by providing a single source of truth for investigating issues.

  • Protected, tamper-proof logs improve forensic integrity and support security investigations and legal proceedings.

  • Long-term retention supports historical analysis, trend identification, and retrospective security assessments.

Level of risk exposed if this best practice is not established: High

Implementation guidance

Audit logging creates a permanent record of which identities took an action, when they did it, and the location of the action across your cloud environment. The absence of logging limits your ability to detect threats, investigate incidents, or answer auditor questions.

The architecture for audit logging must balance completeness, protection, cost, and queryability. Completeness means capturing all relevant events across all accounts and services. Protection means making sure that logs cannot be tampered with or deleted by an unauthorized user who gains access to your environment. Cost management means being selective about what you log and where you store it, particularly for high-volume data like network flow logs. Queryability means organizing logs so you can search them efficiently during an investigation.

Centralize audit logs by collecting them from all accounts into a dedicated log archive account with restricted access. This separation prevents an unauthorized user with broad access to a workload account from removing evidence of their activity. Enable multiple types of logging for overlapping visibility: AWS CloudTrail tracks API calls, AWS Config captures resource configuration state and tracks changes over time, network logs (VPC Flow Logs and Amazon Route 53 Resolver query logs) capture communication patterns between resources, and compute and workload logs from Amazon EC2, Amazon ECS, Amazon EKS, and AWS Lambda capture what happens inside the workloads themselves.

Deliver CloudTrail log files from every AWS account into a single Amazon S3 bucket in the Log Archive account for centralized storage and long-term retention. Query these logs directly from S3 with Amazon Athena, or centralize them alongside other operational, security, and compliance telemetry in Amazon CloudWatch Unified Data Store with cross-account cross-Region log centralization for OCSF-aware analytics across logs, metrics, and traces. For real-time investigation and alerting, stream CloudTrail to Amazon CloudWatch Logs so you can run CloudWatch Logs Insights queries and set metric filters that trigger alarms.

Encrypt logs in transit and at rest. Restrict access so only security and compliance teams can query the log archive account. Where possible, use Amazon S3 Object Lock to prevent even authorized users from deleting or modifying historical logs during the retention period. Validate regularly that logging remains active, so failures do not leave gaps in the audit trail.

Retention depends on compliance requirements and operational needs. Many frameworks require 90 days to one year of accessible logs, with longer periods in cold storage for legal or forensic purposes. Some organizations retain API logs for seven years or more. Because network flow logs are high volume, retain them for shorter periods or sample them to manage cost while keeping enough visibility for most investigations.

Important

Full logging alone is not enough. Assign humans or automated systems to analyze and act on the events captured.

Implementation steps

  1. Design your logging architecture: Consider using AWS SRA Logging Architecture guidance to design and deploy your logging account and services. Plan a multi-account architecture where logs from all member accounts are delivered to a dedicated log archive account with restricted access.

  2. Set up CloudTrail logs: Configure AWS CloudTrail to capture API activity across your AWS environment. The default CloudTrail event history retains 90 days of management events with no action required. For longer retention and data events, create a CloudTrail trail associated with an S3 bucket in the Log Archive account. If you use AWS Organizations, create an organization trail that logs events for every account, and enable CloudTrail Insights on the trail to surface unusual API call patterns. Query the stored logs with Amazon Athena for one-time investigation, and stream the trail to Amazon CloudWatch Logs for real-time alerting through CloudWatch Logs Insights and metric filters.

  3. Enable VPC Flow Logs and DNS query logging: Configure VPC Flow Logs to capture network traffic information and Amazon Route 53 Resolver query logs to record DNS queries. Stream these logs to either an Amazon S3 bucket or an Amazon CloudWatch log group. Be selective about where you enable flow logs to balance visibility needs with cost.

  4. Capture compute and workload logs: Configure logging for the compute services that run your workloads alongside service-level logs, so the audit trail reaches into the workloads themselves. Send Amazon EC2 operating-system and application logs through the CloudWatch agent, ship Amazon ECS and Amazon EKS container and control-plane logs to CloudWatch Logs, and rely on AWS Lambda's built-in CloudWatch Logs integration for function logs. Apply the same retention and access standards to these logs as to service-level audit logs so investigators can correlate API activity with what happened inside the workload.

  5. Centralize logs for unified analytics: Bring CloudTrail events, VPC Flow Logs, Route 53 Resolver query logs, and application logs into a single, analytics-ready location. Use Amazon CloudWatch Unified Data Store as the destination for operational, security, and compliance telemetry, and cross-account cross-Region log centralization to copy log data from your organization into a central account and Region. CloudWatch Unified Data Store supports Open Cybersecurity Schema Framework (OCSF) and OpenTelemetry formats, so you can query the same data from CloudWatch Logs Insights, Amazon Athena, Amazon OpenSearch Service, and third-party Iceberg-compatible tools without duplicating data.

  6. Enable AWS Config across accounts and Regions: Enable AWS Config in each Region where you have resources deployed (for configuration details, see Setting Up AWS Config). Centralize AWS Config across accounts by setting up an aggregator. If using AWS Control Tower, enable the AWS Config integration. In recent AWS Control Tower deployments, AWS Config is an optional service integration that must be explicitly enabled. For details, see Govern Resource Configurations with AWS Config.

  7. Implement log protection and access controls: Enable S3 Object Lock on log buckets to prevent deletion during the retention period. Use S3 bucket policies and IAM policies to restrict access to the log archive account. Enable S3 server-side encryption with AWS KMS customer managed keys for key management control.

  8. Monitor logging health: Create Amazon EventBridge rules or AWS Config rules that alert when logging is stopped, modified, or deleted. Use AWS Config managed rules such as cloudtrail-enabled and vpc-flow-logs-enabled to verify logging is active.

  9. Define log lifecycle and retention policies: Configure S3 lifecycle policies to automatically transition older logs to lower-cost storage tiers (such as S3 Glacier Deep Archive) and delete logs that exceed your retention period. Document the retention policy with business and compliance justifications.

Resources

Related best practices:

Related documents: