How do you collect logs from 40 accounts so an attacker in one account cannot delete them?
IntermediateScenarioCloud IAM and Compliance
Answer
Situation read → Logs in the same account as the attacker can be wiped. Centralise to a locked-down account.
What I'd do →
- Organization CloudTrail trail writing to an S3 bucket in a dedicated Log Archive account.
- S3 Object Lock in compliance mode with a retention period, plus versioning.
- Bucket policy allowing only CloudTrail to write; no human write or delete access.
- Also centralise VPC Flow Logs, Config, GuardDuty and Security Hub to the Security account via delegated admin.
- SCP denying changes to the trail from member accounts.
Why → Attackers delete logs to hide; immutability preserves evidence.
Interview tip → "Separate account, object lock, no human write" is the summary.
More on Cloud IAM and Compliance
You find an IAM policy with `"Action": "*", "Resource": "*"` attached to an application role. How do you right-size it?BeginnerYour company has 40 AWS accounts with no central controls. How do you set up preventive guardrails?IntermediateGuardDuty reports `UnauthorizedAccess:IAMUser/InstanceCredentialExfiltration.OutsideAWS`. What happened and what do you do?AdvancedYour company must pass SOC 2 Type II in six months. What does DevOps own, and how do you automate evidence?IntermediateA partner needs access to one S3 bucket in your account. How do you set up cross-account access safely?IntermediateSomeone logged in with the AWS root user last night. How do you react, and how should you have known?Beginner