News for hackers. Stuff that matters.
Re:Investigating Multi-Account IAM Issues in S3 and CloudFront by kevinslin on Wednesday July 17, 2019 @04:14PM (#20463507)
author here - curious about interesting AWS issues you've encountered and lessons learned from them
Re:Investigating Multi-Account IAM Issues in S3 and CloudFront by jeffnappi on Wednesday July 17, 2019 @11:38PM (#20466477)
An issue I've encountered with static website hosting on CloudFront+S3 is that if you want `index.html` to be served at the root path of a URL - e.g. https://www.yoursite.com/folder/ vs https://www.yoursite.com/folder/index.html, you must use the s3 website endpoint rather than the S3 Origin. And in that case, unfortunately, it is not possible to use Origin Access Identity.
Re:Investigating Multi-Account IAM Issues in S3 and CloudFront by kevinslin on Thursday July 18, 2019 @01:23AM (#20466969)
good news is that you can remedy that now by using lambda@edge to rewrite requests - there's even an aws blog post about it: https://aws.amazon.com/blogs/compute/implementing-default-di...
Re:Investigating Multi-Account IAM Issues in S3 and CloudFront by fishtacos on Friday July 19, 2019 @08:49AM (#20478182)
From the blog post above:

"It does not work on any subdirectory (such as http://www.example.com/about/). If you were to attempt to request this URL through CloudFront, CloudFront would do a S3 GetObject API call against a key that does not exist."

Re:Investigating Multi-Account IAM Issues in S3 and CloudFront by time0ut on Wednesday July 17, 2019 @08:03PM (#20465337)
Not a lot of issues really. Lots of lessons learned and small features I wish existed.

Here's a classic: I had a lambda fed by an even stream hanging off a Dynamo table. The lambda would delete the record after doing a bit of stuff. I didn't realize on my first pass that this would trigger the lambda again... Wasn't a big deal as I noticed the behavior pretty quickly.

Re:Investigating Multi-Account IAM Issues in S3 and CloudFront by kevinslin on Thursday July 18, 2019 @12:16AM (#20466649)
yeah, that's the classic infinite lambda recursion gotcha: https://sourcebox.be/serverless-a-lesson-learned-the-hard-wa...
Re:Investigating Multi-Account IAM Issues in S3 and CloudFront by spaghetti-guy on Wednesday July 17, 2019 @07:14PM (#20464994)
Had a similar issue with CloudTrail logs. These are delivered to your S3 bucket but the objects are owned by AWS's 'CloudTrail account'. This means you can't drop the logs into your security account and then query them with Athena from another account. Took ages to figure that out.
Re:Investigating Multi-Account IAM Issues in S3 and CloudFront by jasonpeacock on Wednesday July 17, 2019 @07:38PM (#20465172)
I'm doing/fixing the same thing with the Cost Usage Reports.

It feels like a common pattern to consolidate your logs into a single account for analysis, I wish they made it more straightforward to setup.

Re:Investigating Multi-Account IAM Issues in S3 and CloudFront by spaghetti-guy on Wednesday July 17, 2019 @11:46PM (#20466517)
We haven't really dug in to analyzing those outside of cost explorer yet but that makes sense.

One workaround I've heard of is S3 replication. I've not tried it yet but apparently the replica has the 'correct' ownership.

Re:Investigating Multi-Account IAM Issues in S3 and CloudFront by spydum on Wednesday July 17, 2019 @08:55PM (#20465615)
Isn’t that one part of what control tower does now?
Re:Investigating Multi-Account IAM Issues in S3 and CloudFront by kevinslin on Thursday July 18, 2019 @12:25AM (#20466692)
yep. control tower creates centralized logging, scp rules and more. what used to take a dev a couple weeks to set up can now be done with a few clicks