A SysOps Administrator is using the AWS CLI to configure VPC Flow Logs to monitor rejected network traffic at the subnet level. The administrator wants to deliver the flow logs to an Amazon CloudWatch Logs log group. To comply with company security policies, the administrator must ensure that the role used to deliver the logs operates with least privilege. Additionally, to manage costs, the logs must be retained for only 90 days.
Which TWO actions must the administrator take to complete this configuration and meet these requirements?
- Create an IAM role with a trust policy that allows the vpc-flow-logs.amazonaws.com service principal to assume it, and attach a policy granting logs:CreateLogStream and logs:PutLogEvents permissions for the destination log group.Cevap
- Modify the retention settings of the destination CloudWatch Logs log group to expire log events after 90 days.Cevap
- CGrant the administrator's IAM user the sts:AssumeRole permission on the flow logs delivery role rather than the iam:PassRole permission when creating the flow log.
- DLeave the CloudWatch Logs log group retention period at its default setting, relying on the native flow log delivery configuration to manage object lifecycles.
- EConfigure an Amazon EventBridge rule that triggers an AWS Systems Manager Automation document to delete log streams older than 90 days from the log group.
Cevap
Create an IAM role with a trust policy that allows the vpc-flow-logs.amazonaws.com service principal to assume it, and attach a policy granting logs:CreateLogStream and logs:PutLogEvents permissions for the destination log group; and modify the retention settings of the destination CloudWatch Logs log group to expire log events after 90 days.
To configure VPC Flow Logs to deliver to CloudWatch Logs, the service requires an IAM role with a trust policy allowing vpc-flow-logs.amazonaws.com to assume it, along with a permissions policy to write to the destination log group. In addition, CloudWatch Logs log groups have a default retention of 'Never expire', so the retention period must be explicitly updated to 90 days to meet the storage requirements and manage costs.
Adım Adım Çözüm
Anahtar Kavram
VPC Flow Logs require an IAM role to publish to CloudWatch Logs, and CloudWatch Logs retention must be configured to manage log expiration.
Tahmini Süre:2m 0s