[TIL] - CloudFront always passes X-* headers to the origin

At my company we use CF to cache/distribute dynamic content generated by 4 EC2 instances behind an ELB.

We were using an X- header to enable a feature we are working on. Since we didn’t select the header in the header whitelist of the distribution, we thought we were safe not to add any protection and just access the app by navigating directly to the ELB endpoint.

We were wrong!


Related discussions:

More details or link to documentation saying this is so?

All custom headers are forwarded. This is described in http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/RequestAndResponseBehaviorCustomOrigin.html#request-custom-headers-behavior

I posted a link in a reply to the story. I have to downvote you for laziness as you could have found and posted that document yourself.

A lesson learned the hard way…