feat(gateway): trust forwarded IPs only from trusted proxies - #131
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
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)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthrough신뢰 프록시 CIDR을 크레덴셜 레지스트리에서 초기화합니다. 게이트웨이는 신뢰된 피어의 전달 헤더만 사용하고 오른쪽부터 첫 비신뢰 주소를 선택합니다. IPv4-mapped 주소와 종료 신호 오류 처리를 보강했습니다. Changes신뢰 클라이언트 IP 귀속
Estimated code review effort: 4 (Complex) | ~60 minutes Merge Risk: 🔵 Low · up to The gateway now trusts forwarded client addresses only from configured trusted proxies and otherwise uses the direct peer for rate limiting, DNSBL matching, and event attribution. The change is mergeable with owner follow-up because the client-attribution behavior still needs the required supporting research citations and source references. Sequence Diagram(s)sequenceDiagram
participant Client
participant Gateway
participant ConnectInfo
participant AppState
Client->>Gateway: 요청과 전달 헤더 전송
Gateway->>ConnectInfo: 피어 SocketAddr 추출
Gateway->>AppState: trusted_proxies 조회
AppState-->>Gateway: 신뢰 프록시 CIDR 반환
Gateway->>Gateway: 전달 체인을 오른쪽부터 검사
Gateway-->>Client: 판정된 클라이언트 IP로 요청 처리
🚥 Pre-merge checks | ✅ 2 | ❌ 3❌ Failed checks (3 warnings)
✅ Passed checks (2 passed)
Full details: Linked Issues checkExplanation 신뢰된 프록시 CIDR 확인, 오른쪽에서 왼쪽으로의 결정적 체인 처리, 비신뢰 피어의 스푸핑 방지, IPv4-mapped 주소 처리는 구현과 테스트에 반영되었습니다. 그러나 Full details: Out of Scope Changes checkExplanation 신뢰된 클라이언트 IP 처리와 관련된 코드, 문서, 퍼즈 테스트, 프로퍼티 테스트는 범위에 맞습니다. 그러나
✨ Finishing Touches 💡 2📝 Generate docstrings 💡
🛠️ Fix failing CI checks 💡
🧪 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 |
|
ced58fe
into
fix/pin-hosted-runner-20260902
Security outcome
X-Forwarded-ForandX-Real-IPonly when the direct peer is inside an explicitly configuredTRUSTED_PROXY_CIDRSrangeCurrent integration state
Exact current head is
72ac1a2a2902a10aabc6e20169b9ae89adb5f9c8, stacked on runner-acquisition prerequisite #145 at2d41c4079f9a4465c3142a0aa2dd5895cb11f793. The non-destructive merge preserves the trusted-proxy delta and #145's explicit hosted-runner contract. The only overlapping file,.github/workflows/fuzz.yml, was semantically combined:ubuntu-24.04is pinned whilefuzz_trusted_forwarded_client_ipremains in the matrix. The PR base is temporarily #145's branch so the effective review diff remains the trusted-proxy slice.All previously returned review threads are resolved on the predecessor lineage, including right-to-left forwarding-chain handling, malformed-chain fail-closed behavior, public serving with connection metadata, registry/bootstrap ownership, IPv4-mapped proxy normalization, fuzz-oracle parity, fuzz CI coverage, and admin-secret provenance. Their old check results do not transfer to this new exact head.
Fresh repository and central gates must be regenerated on
72ac1a2…. Queued, stale or predecessor evidence is non-passing. After #145 reaches protectedmain, retarget this PR to freshmainand reacquire the then-live exact-head gates.