fix: tolerate quotes and host bits in HP_TRUSTED_PROXY_IPS and keep valid entries - #112
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughTrusted proxy parsing now tokenizes comma-separated environment values, strips surrounding quotes and whitespace, normalizes network entries with host bits, and logs ignored invalid entries. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
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. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
haproxy_agent.py (1)
78-114: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAdd regression tests for the trusted-proxy parser.
This security-sensitive path should cover quoted comma-separated values, host-bit normalization, mixed valid/invalid entries, and the no-valid-entry fallback that disables forwarded-header trust.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 66481226-e3a5-44b0-9292-a9c91ef104f7
📒 Files selected for processing (2)
README.mdhaproxy_agent.py
44eeb38 to
cd65ab7
Compare
…alid entries Signed-off-by: Oleksander Piskun <oleksandr2088@icloud.com>
cd65ab7 to
46bf45e
Compare
Values for
HP_TRUSTED_PROXY_IPSoften arrive with literal quotes (env files, compose list syntax, systemd units) and are then rejected, which silently disables client IP detection and lets bruteforce protection ban the reverse proxy for everyone behind it. Quotes are now stripped, ranges with host bits set are masked to their network the same way Nextcloud handlestrusted_proxies, and invalid entries are skipped individually instead of discarding the whole list. Fixes #108.