Room: Cloud leak
Room scenario. There is a suspicion that data was taken from a confidential 'vault' bucket in the company's AWS account (region eu-central-1). The cloud team collected a copy of the incident: cloudtrail/*.json.gz (hourly CloudTrail files, Records array), github_leak.patch (a change that a developer accidentally pushed to GitHub), iam/*.json (users, role trust and permission policies), lambda_env_dump.json (the result of get-function-configuration) and s3_snapshot/ (the bucket objects and their .head.json metadata). The archive is cloud_ir.zip.
Be aware: the corporate egress network is 198.51.100.0/24. In the CloudTrail AssumeRole response, a temporary ASIA... accessKeyId is written (the secret parts are hidden), and in later calls userIdentity.accessKeyId is that value. The objects are encrypted on the client side with AES-256-CBC (PKCS#7): the key is the data key of a KMS CMK, and the IV is in the metadata (Metadata.iv, base64).
Stages (answers are not submitted):
- Task 1. The patch contains two
AKIA...keys. Look for them in CloudTrail: which one was used from an IP outside the corporate network? What was the fate of the other (the IAM files and theUpdateAccessKeyevent)? - Task 2. Follow the
AssumeRolechain with the leaked key: the newASIA...key in the response of each successful step appears in the following events. There are also denied (AccessDenied) attempts and dead-end branches — which role ultimately read the S3 object? - Task 3. Which object was read successfully (GetObject,
bytesTransferredOut) through that session? Legitimate users also read the same object — pay attention only to the session in the chain. Which KMS key ARN is shown in thekms:Decryptevent of that session? - Task 4. Find the
DATA_KEY_B64of the function linked to that ARN inlambda_env_dump.json, decrypt with AES-256-CBC using the IV in the object metadata, and get the flag.
Flag format: BAYROQ{...} (the last 16 characters are lowercase hex).