Skip to content

Call PrepareRequest to populate computed request values #213

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

Stonework4292
Copy link

Ensure that the client_ip caddy variable value is set correctly when trusted_proxies are configured in the Caddyfile. In this case, the client_ip should be read from the X-Forwarded-For header so that the WAF block logs report the correct client_ip.

This fixes a bug where coraza-caddy always reported the remote_addr which in setup behind another proxy would hide the original source ip.

Copy link

sonarqubecloud bot commented May 9, 2025

@jcchavezs
Copy link
Member

Thanks for this @Stonework4292. Could you please cover this in https://github.com/corazawaf/coraza-caddy/blob/main/coraza_test.go?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants