Require auth for proxy-forwarded Docker traffic - #4290
Conversation
|
@coderabbitai review |
✅ Action performedReview finished.
|
|
Important Review skippedNo new commits to review since the last review. ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughProxy-forwarded Docker traffic now requires normal authorization by default. Direct Docker traffic retains its bypass behavior, while an explicit environment flag restores legacy compatibility. Regression coverage and documentation are updated accordingly. ChangesDocker proxy authentication
Estimated code review effort: 3 (Moderate) | ~20 minutes Suggested reviewers: Sequence Diagram(s)sequenceDiagram
participant DockerClient
participant MarinaraAuthPolicy
participant IPAllowlist
participant BasicAuth
participant PrivilegedGate
DockerClient->>MarinaraAuthPolicy: Send forwarded Docker request
MarinaraAuthPolicy->>IPAllowlist: Require normal allowlist checks
IPAllowlist->>BasicAuth: Continue authorization
BasicAuth->>PrivilegedGate: Provide authenticated context
PrivilegedGate-->>DockerClient: Allow or reject privileged request
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ 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 |
Linked issue
Closes #4284
Why this change
Docker's direct-container convenience bypass should not silently extend to proxy-forwarded traffic. A forwarding header marks a request as crossing a trust boundary, so the safer behavior is to enforce configured authentication and authorization gates unless the operator explicitly selects the legacy compatibility mode.
What changed
REQUIRE_AUTH_FOR_DOCKER_PROXYdefault totruewhile preserving an explicitfalseopt-out.ForwardedandX-Forwarded-*/X-Real-IPheaders as proxied for Basic-auth, IP-allowlist, and privileged-route enforcement.Validation
pnpm checkpasses locallyCONTRIBUTING.mdAutomated proof completed before publication:
pnpm regression:request-securitypnpm checkpnpm version:checkgit diff --check staging...HEADManual verification notes
REQUIRE_AUTH_FOR_DOCKER_PROXY=falsecompatibility override.Docs and release impact
docs-i18nbranch updated to match, or a[docs-i18n]follow-up issue opened (see CONTRIBUTING.md § Translated documentation)English documentation and
CHANGELOG.mdare updated. Translation follow-up: #4289.UI evidence (if applicable)
Not applicable; the behavior is server middleware and deployment configuration.
Summary by CodeRabbit
Security
Documentation
Tests