# Audit Logging

Audit logging records attributable events about actions on systems and data so that activity can be investigated, verified, and reviewed.

Cloud concept. Updated 2026-10-29. Page: https://blowstack.com/tools/cloud-concepts-hub/audit-logging

> Audit logging creates an evidence trail showing who or what performed an action, when it occurred, which resource was affected, and what the outcome was. In cloud environments, effective auditing requires selecting complementary log sources and protecting their delivery, retention, and accessibility across accounts, Regions, and workloads.

Practice exams covering Audit Logging: [ANS-C01 AWS Certified Advanced Networking - Specialty](https://blowstack.com/practice-exams/aws-certified-advanced-networking-specialty), [AIB-C01 (beta) AWS Certified AI Business Strategist](https://blowstack.com/practice-exams/aws-certified-ai-business-strategist), [AIF-C01 AWS Certified AI Practitioner](https://blowstack.com/practice-exams/aws-certified-ai-practitioner), [SOA-C03 AWS Certified CloudOps Engineer - Associate](https://blowstack.com/practice-exams/aws-certified-cloudops-engineer-associate), [DEA-C01 AWS Certified Data Engineer - Associate](https://blowstack.com/practice-exams/aws-certified-data-engineer-associate), [DOP-C02 AWS Certified DevOps Engineer - Professional](https://blowstack.com/practice-exams/aws-certified-devops-engineer-professional), [AIP-C01 AWS Certified Generative AI Developer - Professional](https://blowstack.com/practice-exams/aws-certified-generative-ai-developer-professional), [MLA-C02 (beta) AWS Certified Machine Learning Engineer - Associate](https://blowstack.com/practice-exams/aws-certified-machine-learning-engineer-associate), [SCS-C03 AWS Certified Security - Specialty](https://blowstack.com/practice-exams/aws-certified-security-specialty), [SAP-C03 AWS Certified Solutions Architect - Professional](https://blowstack.com/practice-exams/aws-certified-solutions-architect-professional).

## 6 key aspects of Audit Logging

Effective audit logging combines appropriate sources, attributable events, verified collection, protected retention, and usable investigation workflows.

1. **Requirement-driven source selection**: Map each investigation question to the sources that can answer it. Combine control-plane activity, data access, application actions, and supporting network or host evidence rather than expecting one log to provide complete visibility.
2. **Attribution and event context**: Capture identity, session information, action, resource, timestamp, source context, and outcome where available. Preserve correlation identifiers so investigators can connect events across identity providers, applications, and infrastructure.
3. **Complete and verifiable collection**: Define coverage across accounts, Regions, resources, and event categories, including categories that require explicit enablement. Generate test events and monitor delivery failures and logging configuration changes.
4. **Protected evidence**: Separate permissions for generating, administering, reading, and deleting audit records. Combine encryption, restrictive access, integrity checks, and immutable retention when required; each addresses a different risk.
5. **Retention and retrieval design**: Choose storage according to retention periods, search frequency, and acceptable retrieval delays. Balance searchable storage against archival cost, and ensure lifecycle transitions do not undermine investigation requirements.
6. **Operational use and privacy**: Connect audit records to alerting, investigation workflows, and periodic review. Minimize sensitive content and restrict access without removing the evidence needed for accountability.

## Cloud services for Audit Logging

AWS CloudTrail supplies supported API activity, while application, operating-system, and other service logs add context that API records cannot provide. Amazon S3 can hold a centralized, access-controlled archive with lifecycle and retention protections. Amazon CloudWatch Logs supports operational searches and alerting for delivered events, while Amazon Athena supports SQL investigations over archived records. AWS Config adds resource configuration history to help explain the effects of recorded actions. Together, these services separate event generation, collection, evidence storage, and analysis; engineers must still verify coverage, delivery permissions, retention settings, and investigation access.

- **[AWS CloudTrail](https://blowstack.com/tools/cloud-services-hub/aws-cloudtrail)**: Records supported AWS account activity, including management events and explicitly selected data events. Configure trails for ongoing delivery to Amazon S3, use organization and multi-Region coverage where appropriate, and enable log file integrity validation when evidence verification is required.
- **[Amazon S3](https://blowstack.com/tools/cloud-services-hub/amazon-s3)**: Provides durable storage for centralized audit archives, with access policies, encryption, and lifecycle management. S3 Object Lock can enforce write-once-read-many retention for protected object versions when configured appropriately.
- **[AWS Config](https://blowstack.com/tools/cloud-services-hub/aws-config)**: Records configuration history for supported resource types that are enabled for recording. It complements activity logs by showing resource state and changes, but it does not replace API audit records or data-access logging.
- **[Amazon Athena](https://blowstack.com/tools/cloud-services-hub/amazon-athena)**: Queries audit records stored in Amazon S3 using SQL without requiring a continuously running query cluster. Appropriate schemas, partitioning, and supported compressed formats help control scan costs and investigation time.

## Audit Logging exam questions

Real practice exam questions on Audit Logging, with the correct answer and its explanation.

### Question 1 (AIB-C01 (beta))

**Question:**

A research company operates a production AI application that reads confidential documents from Amazon S3 through dedicated workload roles. After a concern about unauthorized document use, investigators find records of bucket-policy changes but cannot establish which documents the application actually read. The company already retains AWS CloudTrail management events for one year. Leadership requires evidence identifying the workload role, document object, and time of each successful read for the same period, without retaining document contents in the evidence records. Which additional control should the AI business strategist require?

**Correct answer:** Enable CloudTrail S3 object-level read data events for the relevant buckets and retain the records for one year in access-controlled storage alongside the existing management-event evidence.

**Explanation:** S3 object-level data events provide evidence of object access, including the requesting identity, object, and event time, without recording the document contents. Retaining these records complements the existing management events, which establish changes to permissions and configuration.

### Question 2 (MLA-C02 (beta))

**Question:**

A company records management API activity for its Amazon SageMaker AI workloads by using a trail that delivers logs to Amazon S3. For an upcoming audit period, security reviewers must be able to cryptographically verify whether any delivered log files were modified or deleted after delivery. The reviewers can store verification metadata in a location that workload administrators cannot modify. Which configuration meets this requirement?

**Correct answer:** Enable CloudTrail log file integrity validation, preserve the signed digest files in the protected location, and run CloudTrail log validation for the audit period.

**Explanation:** CloudTrail integrity validation produces signed digest files containing hashes of delivered log files. Validating the logs against protected digests provides cryptographic evidence of modification or deletion. Validation must be enabled before the period being audited; enabling it does not validate earlier deliveries retroactively.

### Question 3 (SAP-C03)

**Question:**

A company uses AWS Organizations to manage 50 application accounts across two AWS Regions. Applications make in-Region Amazon Bedrock InvokeModel and InvokeModelWithResponseStream requests with text inputs and outputs. An existing multi-Region organization trail delivers API activity records to a log archive account.

After an investigation, the security team discovers that the centralized records identify model API calls but do not contain the prompts or generated responses. The company must capture those contents for future invocations and maintain copies in an S3 bucket in the log archive account. Investigators must be able to correlate the contents with invocation metadata. Applications must continue calling Amazon Bedrock directly without code changes or an inference proxy.

An existing account-enrollment pipeline can deploy account-specific resources and settings in both Regions. Which solution meets these requirements?

**Correct answer:** Use the enrollment pipeline to enable Amazon Bedrock model invocation logging with text delivery in each application account and Region. Deliver logs to same-account, same-Region S3 buckets, and configure S3 replication with the required permissions to copy them to the log archive bucket. Retain invocation request IDs for correlation.

**Explanation:** Amazon Bedrock model invocation logging captures supported text inputs, outputs, and invocation metadata without application changes. It must be configured in each account and Region, and its S3 destination must be in that same account and Region. Replication provides centrally controlled copies in the log archive account, while request IDs support correlation with API activity records.

### Question 4 (AIF-C01)

**Question:**

A company uses Amazon Bedrock Guardrails to apply safety policies to its AI assistant. The security team must retain evidence for 1 year showing which IAM identity changed a guardrail configuration, when the change occurred, and the source IP address. The evidence must cover all AWS Regions where the company operates. Which solution best meets these requirements?

**Correct answer:** Create a multi-Region AWS CloudTrail trail that records write management events and delivers them to Amazon S3. Configure retention so the logs remain available for at least 1 year.

**Explanation:** CloudTrail management events record configuration-changing API activity, including guardrail changes, with caller identity, event time, and source IP information. A multi-Region trail provides regional coverage, and retaining its S3 logs for at least 1 year satisfies the evidence requirement.

### Question 5 (SOA-C03)

**Question:**

A company uses an AWS CloudTrail trail to deliver management events to an Amazon S3 bucket. Security investigators use these records to determine who changed IAM policies before access incidents. An auditor requires a repeatable check that detects whether delivered log files have been modified or deleted. The check must use cryptographically verifiable evidence for logs delivered after the control is enabled, rather than relying only on the bucket's current access settings.

Which solution should a CloudOps engineer implement?

**Correct answer:** Enable CloudTrail log file integrity validation for the trail and periodically run the AWS CLI cloudtrail validate-logs command for the required audit intervals.

**Explanation:** Log file integrity validation delivers digitally signed digest files that contain hashes of the delivered log files and link to previous digests. The validate-logs command uses this evidence to verify integrity and identify modified or missing log files. Enabling the feature does not itself perform validation, so the periodic validation step is necessary.

### Question 6 (AIP-C01)

**Question:**

A company runs a generative AI document-ingestion pipeline in workload accounts. The pipeline accesses source documents in Amazon S3 through a VPC endpoint owned by a central network account. Source buckets reside in a separate data account. A security test confirms that the endpoint policy blocks requests for unapproved source repositories, but the existing audit archive contains no evidence of those rejected requests.

For future endpoint-policy denials, auditors must be able to identify the requesting AWS principal, requested API operation, endpoint, time, and denial outcome. The evidence must cover requests rejected at the endpoint before they reach Amazon S3 and must be delivered to the company's central audit archive.

Which change meets these requirements?

**Correct answer:** Configure a CloudTrail trail in the endpoint-owning network account to collect network activity events for the S3 endpoint, selecting s3.amazonaws.com events with the VpceAccessDenied error code, and deliver the logs to the central audit archive.

**Explanation:** CloudTrail network activity events capture supported AWS API requests denied by VPC endpoint policies. Collection must be explicitly enabled in the endpoint owner's account. Selecting the S3 event source, relevant endpoint, and VpceAccessDenied outcome captures the required identity, operation, endpoint, timestamp, and denial evidence.

### Question 7 (DEA-C01)

**Question:**

A company uses an AWS CloudTrail trail to record management events and all Amazon S3 object-level read and write events in its account. The trail delivers its logs to a dedicated S3 bucket named central-audit-logs. A data engineer discovers that writes of CloudTrail log files to this bucket are themselves being recorded as additional S3 data events, increasing logging charges.

The company must continue recording management events and all object-level reads and writes for every other S3 bucket, including buckets created in the future. Which change will eliminate data-event charges for activity in the log destination bucket while meeting these requirements?

**Correct answer:** Configure advanced event selectors to retain management events and record S3 object data events only when resources.ARN does not start with arn:aws:s3:::central-audit-logs/.

**Explanation:** An advanced data-event selector can select AWS::S3::Object resources and use NotStartsWith on resources.ARN to exclude objects in the log destination bucket. Leaving other bucket ARNs unrestricted covers both existing and future buckets. A separate management-event selector preserves management-event logging.

### Question 8 (SCS-C03)

**Question:**

A company uses an Amazon DynamoDB global table with replicas in us-east-1 and eu-west-1. Applications use assumed IAM roles to call each replica's Regional endpoint directly. An existing multi-Region AWS CloudTrail trail uses advanced event selectors to record management events and delivers logs to a central Amazon S3 archive.

Auditors require ongoing records of successful UpdateItem and DeleteItem API calls made by applications against either replica. Each record must identify the calling role session, API operation, event time, and outcome. Item images are not required. To limit logging costs, no other DynamoDB data operations should be collected. The existing management-event coverage and archive destination must remain unchanged.

Which change meets these requirements?

**Correct answer:** Preserve the existing management-event selectors and add a data-event selector for AWS::DynamoDB::Table resources. Match both replica table ARNs and restrict eventName to UpdateItem and DeleteItem. Continue using the trail's existing S3 destination.

**Explanation:** CloudTrail DynamoDB data events provide caller identity, operation, timestamp, and outcome information for these item-level API calls. Selecting both Regional table ARNs covers applications calling either replica directly. Restricting eventName to the two required operations avoids collecting unrelated DynamoDB data operations, while preserving the existing selectors maintains management-event coverage.

### Question 9 (DOP-C02)

**Question:**

A company uses a multi-Region AWS CloudTrail trail to deliver management events to a central audit account. An application stores sensitive documents under s3://company-records/regulated/ and other documents under different prefixes in the same bucket.

Auditors need records identifying the caller, action, resource, time, and outcome for all supported object-level write API activity throughout company-records and all supported object-level read API activity under regulated/. To control logging costs, the trail must not collect object-level read events outside regulated/ or data events for other buckets. Existing management-event collection must continue.

A DevOps engineer will retain the existing management-event selector and add advanced event selectors to the trail. Which configuration meets these requirements?

**Correct answer:** Add two selectors, both with eventCategory equal to Data and resources.type equal to AWS::S3::Object. Configure the write selector with readOnly equal to false and resources.ARN starting with arn:aws:s3:::company-records/. Configure the read selector with readOnly equal to true and resources.ARN starting with arn:aws:s3:::company-records/regulated/.

**Explanation:** CloudTrail object-level activity requires data-event collection. Events matching either advanced selector are collected. These selectors capture writes across the entire bucket and reads only under regulated/, without collecting other buckets' data events. Retaining the existing management-event selector preserves control-plane auditing.

### Question 10 (ANS-C01)

**Question:**

A company operates application VPCs in several AWS accounts in us-east-2. Each account has its own Route 53 Resolver query logging configuration associated with its application VPCs. All configurations specify an existing central logging account's S3 bucket as their destination. The bucket uses SSE-S3 encryption, and no service control policies or explicit deny statements affect log delivery.

The configurations report ACCESS_DENIED, and no query logs arrive. The bucket policy currently grants route53resolver.amazonaws.com permission to call s3:GetBucketAcl on the bucket and s3:PutObject on the appropriate AWSLogs/<source-account-id>/* prefixes.

Which bucket policy revision will enable direct delivery while restricting access to the approved source accounts?

**Correct answer:** Grant delivery.logs.amazonaws.com s3:GetBucketAcl on the bucket and s3:PutObject on each approved account's AWSLogs/<source-account-id>/* prefix. Require bucket-owner-full-control for object writes, and restrict access with aws:SourceAccount and matching arn:aws:logs:us-east-2:<source-account-id>:* source ARNs.

**Explanation:** Resolver query logs delivered directly to S3 use the delivery.logs.amazonaws.com service principal. The bucket policy must authorize the bucket ACL check and object delivery to the appropriate account prefixes. The bucket-owner-full-control condition and source-account and CloudWatch Logs source-ARN conditions constrain delivery appropriately.

## Practice Audit Logging in a full exam

Questions on Audit Logging in each practice exam, with every answer option and an explanation for each:

- [AIF-C01](https://blowstack.com/practice-exams/aws-certified-ai-practitioner): 22 questions
- [AIP-C01](https://blowstack.com/practice-exams/aws-certified-generative-ai-developer-professional): 16 questions
- [DEA-C01](https://blowstack.com/practice-exams/aws-certified-data-engineer-associate): 11 questions
- [SAP-C03](https://blowstack.com/practice-exams/aws-certified-solutions-architect-professional): 10 questions
- [SOA-C03](https://blowstack.com/practice-exams/aws-certified-cloudops-engineer-associate): 10 questions
- [ANS-C01](https://blowstack.com/practice-exams/aws-certified-advanced-networking-specialty): 10 questions
- [DOP-C02](https://blowstack.com/practice-exams/aws-certified-devops-engineer-professional): 8 questions
- [SCS-C03](https://blowstack.com/practice-exams/aws-certified-security-specialty): 6 questions
- [AIB-C01 (beta)](https://blowstack.com/practice-exams/aws-certified-ai-business-strategist): 3 questions
- [MLA-C02 (beta)](https://blowstack.com/practice-exams/aws-certified-machine-learning-engineer-associate): 3 questions

## What is Audit Logging

Audit logging supports accountability by recording security-relevant activity rather than only system health or application performance. Useful events identify the actor, action, target resource, timestamp, source context, and outcome. For cloud workloads, the actor might be a person, an assumed role, an application identity, or a managed service. Preserving role-session and identity-provider context helps investigators connect temporary credentials to the originating identity, although attribution depends on the information captured by each source.

Choose sources by starting with the questions an investigation or compliance review must answer. Control-plane API logs establish who changed permissions, created resources, or modified security settings. Data-plane audit events establish who accessed or changed supported data resources, such as objects in storage. Application audit logs capture business actions, such as approving a payment, that infrastructure logs cannot explain. Operating-system authentication logs, database audit logs, network flow logs, DNS query logs, and load balancer access logs provide complementary evidence. Network flow records describe connections, not the user actions or packet contents behind them.

For example, investigating a suspected object-storage disclosure requires more than the event that changed a bucket policy. Investigators may also need object-access events, identity activity, application records, and relevant network evidence. In AWS, CloudTrail management events and data events serve different purposes. Data events generally require explicit configuration and incur additional charges. CloudTrail Event history provides the previous 90 days of management events in each Region; it is not a complete, long-term archive of all activity.

Collection should cover the required accounts, Regions, resource types, and event categories. Organization-wide configuration and centralized storage reduce gaps caused by individually managed accounts. However, centralization alone does not guarantee completeness: selectors, unsupported event types, delivery permissions, encryption-key policies, service quotas, and configuration drift can all affect coverage. Test delivery using known actions, monitor delivery failures, and alert on attempts to disable logging or change its destinations. Do not assume logs arrive immediately or in chronological order.

Storage design follows investigation and retention requirements. Frequently searched records may belong in a searchable log platform, while an object-storage archive can provide economical long-term retention. Lifecycle policies can move older records to lower-cost storage, but retrieval delays and query compatibility must match recovery expectations. Restrict deletion and configuration changes, separate workload administration from archive administration, and use immutable retention where required. Encryption protects confidentiality, while integrity validation helps detect modification; neither substitutes for access control or deletion protection.

Audit records themselves can contain personal information, identifiers, and sensitive request details. Avoid recording credentials or unnecessary payloads, restrict analyst access, and define retention according to legal and operational requirements. More logging is not automatically better: high-volume data events increase ingestion, storage, and analysis costs. Select coverage deliberately, preserve original records alongside normalized copies, and maintain reliable timestamps for correlation. Finally, logging is not detection by itself. Queries, alerts, investigation procedures, and regular coverage tests turn retained records into useful security evidence.

## Learn Audit Logging in lessons

13 short lessons on Audit Logging in 9 certification courses.

- AIB-C01 (beta): Audit Logging: accountability for production AI (Premium), https://app.blowstack.com/lessons/audit-logging-accountability-for-production-ai-aib-c01
- MLA-C02 (beta): Audit Logging: trustworthy audit trails for ML workloads (Premium), https://app.blowstack.com/lessons/audit-logging-trustworthy-audit-trails-for-ml-workloads-mla-c02
- SAP-C03: Audit Logging: collection completeness (Premium), https://app.blowstack.com/lessons/audit-logging-collection-completeness-sap-c03
- AIF-C01: Audit Logging: the audit record lifecycle (Premium), https://app.blowstack.com/lessons/audit-logging-the-audit-record-lifecycle-aif-c01
- SOA-C03: Audit Logging: control-plane and data-plane event coverage (Premium), https://app.blowstack.com/lessons/audit-logging-control-plane-and-data-plane-event-coverage-soa-c03
- AIP-C01: Audit Logging: AI interaction evidence (Premium), https://app.blowstack.com/lessons/audit-logging-ai-interaction-evidence-aip-c01
