An enterprise operates a financial transaction auditing application deployed on a fleet of Amazon EC2 instances. The application writes security-sensitive transaction logs to `/var/log/audit/transactions.log`. A local utility rotates these logs hourly by renaming the active log file to `transactions.log.YYYY-MM-DD-HH` and creating a new empty `transactions.log` file. The Unified CloudWatch Agent is installed on each EC2 instance and is configured to stream these logs to a central Amazon CloudWatch Logs log group in the application account.
A subscription filter on the CloudWatch log group forwards all incoming log events to an Amazon Kinesis Data Firehose delivery stream. This stream is responsible for delivering the logs to an Amazon S3 bucket located in a centralized Logging AWS account for long-term retention and compliance audits.
During a post-deployment verification phase, the solutions architect identifies two distinct operational issues:
1. Log ingestion from the EC2 instances halts within the first hour of log rotation and does not resume automatically.
2. The Kinesis Data Firehose delivery stream fails to write any records to the centralized S3 bucket in the Logging account.
Which combination of actions will resolve both issues while adhering to the principle of least privilege?
- AModify the Unified CloudWatch Agent configuration file on the EC2 instances to use the static path `/var/log/audit/transactions.log`, and configure a cron job to restart the agent service immediately after each hourly log rotation. In the Logging AWS account, modify the Amazon S3 bucket policy to grant `s3:PutObject` permissions to the IAM role assumed by the Kinesis Data Firehose delivery stream, without using a canned ACL.
- BUpdate the Unified CloudWatch Agent configuration file on the EC2 instances to set the `file_path` parameter to `/var/log/audit/transactions.log*`. In the Logging AWS account, modify the destination Amazon S3 bucket policy to grant `s3:PutObject` and `s3:PutObjectAcl` permissions to the root principal of the application account (`arn:aws:iam::Application-Account-ID:root`), allowing Kinesis Data Firehose to write to the bucket by inheriting these permissions.
- Update the Unified CloudWatch Agent configuration file on the EC2 instances to set the `file_path` parameter to `/var/log/audit/transactions.log*`. In the Logging AWS account, modify the destination Amazon S3 bucket policy to grant `s3:PutObject` and `s3:PutObjectAcl` permissions to the specific IAM role assumed by the Kinesis Data Firehose delivery stream, and configure the Kinesis Data Firehose stream to write objects using the `bucket-owner-full-control` canned ACL.Answer
- DModify the Unified CloudWatch Agent configuration file on the EC2 instances to use the static path `/var/log/audit/transactions.log`. In the Logging AWS account, configure the destination Amazon S3 bucket policy to grant the AWS service principal `firehose.amazonaws.com` permissions to perform `s3:PutObject` operations on the bucket without specifying any IAM role or account condition.