chore(ibkr): harden the CP gateway docker harness#131
Conversation
Make the dev Client Portal Gateway self-sufficient so browser login works in a devcontainer without a manual patch, adopting hardening ideas from a reference gateway: - Bake a dev `conf.yaml` into the image whose `ips.allow` covers loopback + RFC-1918 private ranges — the distribution's shipped allowlist (192.*/131.216.*/127.0.0.1) rejects a Docker-forwarded login (source 172.*/10.*) with 403 "not allowed". - Add a container HEALTHCHECK (curl /iserver/auth/status -> 200|401); install curl for it. - Harden docker-compose: cap_drop ALL, no-new-privileges, mem/pids limits, and a bounded log size. - `just ibkr-capture` resolves the gateway's container IP (new docker/cpapi/gateway-base-url.sh helper) because localhost:5000 is not routable from inside a devcontainer; capture.sh is untouched. Verified: image builds, and a throwaway container serves 401 (source allowed, not 403) with no manual ips.allow patch. Allowlist `vertx` (the keystore filename) in _typos.toml. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Warning Review limit reached
Next review available in: 9 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (7)
✨ Finishing Touches🧪 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 |
# Conflicts: # _typos.toml
Closes #130
Follow-up to #129 (real fixtures) and #127 (the harness): make the dev CP gateway self-sufficient so browser login works in a devcontainer without a manual
ips.allowpatch, and adopt hardening ideas from a referenceoath-ibkr-v2gateway (harness only — OATH keeps its own net-http/net-ws client stacks).Changes (all under
docker/cpapi/+Justfile+_typos.toml)conf.yamlwith a widenedips.allow(loopback + RFC-1918 private ranges). The distribution's shipped allowlist (192.*/131.216.*/127.0.0.1) rejects a Docker-forwarded login (source172.*/10.*) with403 "not allowed".HEALTHCHECK—curl /iserver/auth/status→200|401;curladded to the image for it.cap_drop: ALL,no-new-privileges,mem_limit/pids_limit, bounded logs.just ibkr-captureresolves the gateway's bridge IP via a newgateway-base-url.sh(localhost:5000 isn't routable from inside a devcontainer).capture.shis untouched.Verification
just cigreen. Built the image and ran a throwaway container: it servesHTTP 401(source allowed, not 403) with no manual patch, and theHEALTHCHECKis configured.gitleaksclean (thesslPwdis the distribution's public keystore password).Scope: no crate or
capture.shchanges → independent of #129.🤖 Generated with Claude Code