stratus-red-team icon indicating copy to clipboard operation
stratus-red-team copied to clipboard

Backdoor an S3 Bucket via its Bucket Policy - use of an account ID linked to AWS

Open m4wk opened this issue 1 year ago • 4 comments

It appears the account ID used in this attack (193672423079) is used by AWS for RedShift logs. Some tools use lists like the one from Cloudmapper (https://github.com/duo-labs/cloudmapper/blob/main/vendor_accounts.yaml) to exclude known vendors which limits detections sourced from Stratus.

Is it possible to use a new randomly generated accountID?

m4wk avatar Jul 18 '22 17:07 m4wk

Thanks for reporting! That's a good point, we'll look into fixing it. I would need to check if the bucket policy requires specifying a valid AWS account - if yes, we'll need to use a "real AWS account" that's not listed in cloudmapper's list. If not, we can simply use 111111111111

christophetd avatar Jul 18 '22 19:07 christophetd

Yes it needs a valid principal unfortunately. Maybe Datadog can create an account used solely for external account testing for s3 bucket policies, IAM policies, etc. This can be used by the community (Cloudmapper, Cloud Custodian, etc.) for detection rule testing. Otherwise 111111111111 works fine.

m4wk avatar Jul 18 '22 20:07 m4wk

AWS uses the account ID 123456789012 throughout their documentation and code examples, so it may be a safe option. I can't find any definitive source stating that it is reserved for example use, however.

craSH avatar May 03 '23 05:05 craSH

same issue/question for implementation of #469 in #478

christophetd avatar Feb 05 '24 22:02 christophetd