[PR #4290] [MERGED] Require auth for proxy-forwarded Docker traffic #6320

Closed
opened 2026-10-23 04:09:17 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/4290
Author: @SpicyMarinara
Created: 7/30/2026
Status: ✅ Merged
Merged: 7/30/2026
Merged by: @SpicyMarinara

Base: staging ← Head: security/docker-proxy-auth-default


📝 Commits (1)

  • 7558b2c security: require auth for proxied Docker traffic

📊 Changes

11 files changed (+198 additions, -18 deletions)

View changed files

📝 .env.example (+7 -5)
📝 CHANGELOG.md (+4 -0)
📝 README.md (+1 -1)
📝 docs/CONFIGURATION.md (+1 -1)
📝 docs/REMOTE_ACCESS.md (+5 -3)
📝 docs/TROUBLESHOOTING.md (+1 -1)
📝 package.json (+1 -1)
📝 packages/server/src/config/runtime-config.ts (+3 -2)
📝 packages/server/src/middleware/basic-auth.ts (+3 -3)
📝 packages/server/src/middleware/ip-allowlist.ts (+1 -1)
➕ scripts/regressions/docker-proxy-auth.regression.ts (+171 -0)

📄 Description

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

  • Make REQUIRE_AUTH_FOR_DOCKER_PROXY default to true while preserving an explicit false opt-out.
  • Treat all supported Forwarded and X-Forwarded-* / X-Real-IP headers as proxied for Basic-auth, IP-allowlist, and privileged-route enforcement.
  • Preserve the direct Docker-network bypass when no forwarding metadata is present.
  • Add focused regressions for password, IP, privileged-route, and forwarding-header behavior.
  • Update the environment example, README, configuration, remote-access, troubleshooting, and changelog guidance.
  • Track translated documentation separately in #4289.

Validation

  • pnpm check passes locally
  • Container (Docker / Podman) built and ran without issue
  • Ran the app, clicked through the changes manually
  • Checked edge cases (light + dark mode, mobile viewport, empty states, error paths)
  • Above manual verification completed (describe below)
  • Read and followed CONTRIBUTING.md

Automated proof completed before publication:

  • pnpm regression:request-security
  • pnpm check
  • pnpm version:check
  • git diff --check staging...HEAD

Manual verification notes

  • Manually verify a proxied Docker deployment with password protection.
  • Manually verify IP allowlisting and privileged-route protection through the reverse proxy.
  • Manually verify direct container-local access and the explicit REQUIRE_AUTH_FOR_DOCKER_PROXY=false compatibility override.
  • No Docker container was built or exercised manually in this agent run.

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed
  • Translated docs on the docs-i18n branch updated to match, or a [docs-i18n] follow-up issue opened (see CONTRIBUTING.md § Translated documentation)
  • Version/release files updated (only if this PR includes a version bump)

English documentation and CHANGELOG.md are updated. Translation follow-up: #4289.

UI evidence (if applicable)

Not applicable; the behavior is server middleware and deployment configuration.

Summary by CodeRabbit

  • Security

    • Docker traffic forwarded through a proxy now requires normal authentication and IP allowlist checks by default.
    • Direct Tailscale and same-host Docker bridge traffic remains trusted by default.
    • Legacy passwordless proxy behavior remains available through an explicit opt-out setting.
  • Documentation

    • Updated security, configuration, remote-access, and troubleshooting guidance to explain the new defaults and trust requirements.
  • Tests

    • Added regression coverage for proxy authentication, allowlists, Basic Auth, and privileged access.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Engine/pull/4290 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 7/30/2026 **Status:** ✅ Merged **Merged:** 7/30/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `security/docker-proxy-auth-default` --- ### 📝 Commits (1) - [`7558b2c`](https://github.com/Pasta-Devs/Marinara-Engine/commit/7558b2cd52666d93fc94d3d71186bc8c4d72be92) security: require auth for proxied Docker traffic ### 📊 Changes **11 files changed** (+198 additions, -18 deletions) <details> <summary>View changed files</summary> 📝 `.env.example` (+7 -5) 📝 `CHANGELOG.md` (+4 -0) 📝 `README.md` (+1 -1) 📝 `docs/CONFIGURATION.md` (+1 -1) 📝 `docs/REMOTE_ACCESS.md` (+5 -3) 📝 `docs/TROUBLESHOOTING.md` (+1 -1) 📝 `package.json` (+1 -1) 📝 `packages/server/src/config/runtime-config.ts` (+3 -2) 📝 `packages/server/src/middleware/basic-auth.ts` (+3 -3) 📝 `packages/server/src/middleware/ip-allowlist.ts` (+1 -1) ➕ `scripts/regressions/docker-proxy-auth.regression.ts` (+171 -0) </details> ### 📄 Description ## 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 - Make `REQUIRE_AUTH_FOR_DOCKER_PROXY` default to `true` while preserving an explicit `false` opt-out. - Treat all supported `Forwarded` and `X-Forwarded-*` / `X-Real-IP` headers as proxied for Basic-auth, IP-allowlist, and privileged-route enforcement. - Preserve the direct Docker-network bypass when no forwarding metadata is present. - Add focused regressions for password, IP, privileged-route, and forwarding-header behavior. - Update the environment example, README, configuration, remote-access, troubleshooting, and changelog guidance. - Track translated documentation separately in #4289. ## Validation - [ ] `pnpm check` passes locally - [ ] Container (Docker / Podman) built and ran without issue - [ ] Ran the app, clicked through the changes manually - [ ] Checked edge cases (light + dark mode, mobile viewport, empty states, error paths) - [ ] Above manual verification completed (describe below) - [ ] Read and followed `CONTRIBUTING.md` Automated proof completed before publication: - `pnpm regression:request-security` - `pnpm check` - `pnpm version:check` - `git diff --check staging...HEAD` ### Manual verification notes - Manually verify a proxied Docker deployment with password protection. - Manually verify IP allowlisting and privileged-route protection through the reverse proxy. - Manually verify direct container-local access and the explicit `REQUIRE_AUTH_FOR_DOCKER_PROXY=false` compatibility override. - No Docker container was built or exercised manually in this agent run. ## Docs and release impact - [ ] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed - [ ] Translated docs on the `docs-i18n` branch updated to match, or a `[docs-i18n]` follow-up issue opened (see CONTRIBUTING.md § Translated documentation) - [ ] Version/release files updated (only if this PR includes a version bump) English documentation and `CHANGELOG.md` are updated. Translation follow-up: #4289. ## UI evidence (if applicable) Not applicable; the behavior is server middleware and deployment configuration. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Security** * Docker traffic forwarded through a proxy now requires normal authentication and IP allowlist checks by default. * Direct Tailscale and same-host Docker bridge traffic remains trusted by default. * Legacy passwordless proxy behavior remains available through an explicit opt-out setting. * **Documentation** * Updated security, configuration, remote-access, and troubleshooting guidance to explain the new defaults and trust requirements. * **Tests** * Added regression coverage for proxy authentication, allowlists, Basic Auth, and privileged access. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-23 04:09:17 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#6320
No description provided.