feat(gateway): trust forwarded IPs only from trusted proxies - #151
feat(gateway): trust forwarded IPs only from trusted proxies#151seonghobae wants to merge 38 commits into
Conversation
📝 WalkthroughWalkthrough신뢰 프록시 CIDR credential과 환경 설정을 추가했습니다. Gateway는 피어 소켓 주소와 신뢰 목록을 사용해 forwarded client IP를 fail closed 방식으로 판별합니다. 서버 실행과 셧다운 오류 처리를 변경하고, 테스트와 fuzz 검증을 확장했습니다. Changes신뢰 프록시 클라이언트 IP 처리
Estimated code review effort: 4 (Complex) | ~60 minutes Merge Risk: 🟠 High · up to The change still allows malformed forwarded-IP input from an admitted proxy to influence client identity and downstream security controls, while direct router users can receive HTTP 500 when peer metadata is unavailable. These are concrete current-head security and availability risks that should be fixed before merge. Sequence Diagram(s)sequenceDiagram
participant Client
participant serve
participant gateway
participant effective_client_ip
participant RateLimiter
Client->>serve: TCP 요청과 SocketAddr 전달
serve->>gateway: ConnectInfo<SocketAddr>가 포함된 Request 전달
gateway->>effective_client_ip: peer_ip와 forwarded headers 전달
effective_client_ip-->>gateway: 유효한 client IP 반환
gateway->>RateLimiter: client IP로 rate limit 적용
🚥 Pre-merge checks | ✅ 2 | ❌ 3❌ Failed checks (3 warnings)
✅ Passed checks (2 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 79.28% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 111 functions across 7 files. (7 skipped: 7 unsupported.)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
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 |
|
@coderabbitai review |
|
|
@coderabbitai full review |
✅ Action performedFull review finished. |
Superseded by clean Draft replacement #157.
The reviewed trusted-proxy semantic head
65a2b7fbf2827f69ae1aa288696b6c5630af28c4is preserved unchanged in #157, but this PR's base branch #149 was later contaminated by an unrelated auth merge. #157 restores the intended stack on clean runner prerequisite #153 without transferring predecessor checks/reviews.