Interview Prep/DevSecOps/Cloud IAM and Compliance

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 →

  1. Organization CloudTrail trail writing to an S3 bucket in a dedicated Log Archive account.
  2. S3 Object Lock in compliance mode with a retention period, plus versioning.
  3. Bucket policy allowing only CloudTrail to write; no human write or delete access.
  4. Also centralise VPC Flow Logs, Config, GuardDuty and Security Hub to the Security account via delegated admin.
  5. 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.

All DevSecOps questions Roadmap: Policy as code

More on Cloud IAM and Compliance