-
Notifications
You must be signed in to change notification settings - Fork 364
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Honeypot doesn't detect correct IP address with CloudFront and recommended cache configuration. #250
Comments
Thanks for reporting the issue. We are investigating this. |
@aijunpeng
Yes. When we use CLOUDFRONT, I think our expect IP should be gotten from L149. |
Thanks for the information. We are able to replicate the issue. We have added it to our backlog and it will be addressed in the next release. Meanwhile I hope you have updated the code and have it fixed on your end. |
Describe the bug
When I configured "Cache policy and origin request policy (recommended)" is "CacheDisabled" and "AllViewerExceptHostHeader", this is recommended for API Gateway, Honeypot lambda doesn't work.
Because "requestContext.identity.userAgent" of event is not "Amazon Cloudfront" in case of this setting. So, honeypot doesn't detect correct IP address.
(But honeypot works in Legacy configuration of CloudFront.)
To Reproduce
In CloudFront management console, please configure above cache policy for your distribution's behavior of honeypot.
Expected behavior
This honeypot should detect this request is via CloudFront or not, correctly..
Please complete the following information about the solution:
Additional context
If you want to modify this issue, we will modify like below in BadBotParser lambda:
if event['requestContext']['identity']['userAgent'] == 'Amazon CloudFront':
if event['headers']['Via'] and event['headers']['Via'].find('cloudfront') > 0:
The text was updated successfully, but these errors were encountered: