Skip to content

Fix client_ip in logger http.handlers.waf#306

Open
thelogh wants to merge 1 commit into
corazawaf:mainfrom
thelogh:patch-1
Open

Fix client_ip in logger http.handlers.waf#306
thelogh wants to merge 1 commit into
corazawaf:mainfrom
thelogh:patch-1

Conversation

@thelogh

@thelogh thelogh commented May 13, 2026

Copy link
Copy Markdown

In addition to the pull request https://github.com/corazawaf/coraza-caddy/pull/184/changes for setting the correct client_ip IP via getClientAddress, the generation of the error log with the correct IP has been left out of the change.

Summary by CodeRabbit

  • Bug Fixes
    • Fixed client IP address capture in WAF rule violation logs to ensure accurate security event reporting.

Review Change Stack

In addition to the pull request https://github.com/corazawaf/coraza-caddy/pull/184/changes for setting the correct client_ip IP via getClientAddress, the generation of the error log with the correct IP has been left out of the change.
@coderabbitai

coderabbitai Bot commented May 13, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 0cfae586-16aa-4eef-9156-f18a459ab6ff

📥 Commits

Reviewing files that changed from the base of the PR and between 6f7b24b and c38810a.

📒 Files selected for processing (1)
  • coraza.go

📝 Walkthrough

Walkthrough

The PR updates error logging for WAF rule violations in ServeHTTP to derive client IP through the getClientAddress(r) function instead of using r.RemoteAddr directly.

Changes

WAF violation error logging

Layer / File(s) Summary
Client IP source in violation logging
coraza.go
The "WAF rule violation detected" error log now derives client_ip from getClientAddress(r) instead of r.RemoteAddr.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Fix client_ip in logger http.handlers.waf' directly and specifically describes the main change: correcting the client IP source in the WAF logger.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@fzipi

fzipi commented Jun 7, 2026

Copy link
Copy Markdown
Member

Can you add tests, please?

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