- Newest
- Most votes
- Most comments
You could try enabling a WAF (Web Application Firewall) WebACL for your API Gateway and enabling logging for the WebACL. It doesn't need to block any traffic, but this should give you the detailed logs WAF produces that include HTTP headers. The list of fields included in WAF logs is here: https://docs.aws.amazon.com/waf/latest/developerguide/logging-fields.html
Instructions for using WAF with the API Gateway start on this documentation page: https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-control-access-aws-waf.html
You could also create a custom authorizer or use request mapping in API Gateway to extract the cf-connecting-ip or x-forwarded-for header and include it in a custom logging context. This can then be added to the access log.
answered 2 years ago
Relevant content
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 4 months ago
