fix(security): remediate review 08 findings - #1
Merged
Conversation
Docker container start/stop/restart fell through to the ROLE_GUEST tier because the security rules were never extended when the Docker dashboard shipped. Guest tokens are issued to anonymous callers, so any visitor could stop containers on the host. The only gate was a disabled button in the UI. Adds server-side authorization plus regression tests covering every mutating route.
… routes Guest tokens could read system and container logs, which expose IPs, upstream API responses and internal configuration. The authorization chain also ended in permitAll, making any future endpoint outside /api/** public by default.
…issing env docker-compose.yml supplied working defaults for ADMIN_PASSWORD, JWT_SECRET and AGENT_SECRET_KEY. Since the Compose migration this file is the production base, so a missing .env booted the platform with publicly-known credentials and a known JWT signing key. Removes the fallbacks and adds a deploy.sh preflight assertion.
…e limiter The login limiter is the only brute-force protection on the admin password and was bypassable by randomising the header.
…e platform services
…eserve k8s manifests
Commit 85e0f84 reverted OrchestratorSecurityTest to its baseline while adding path-parameter validation, silently deleting eleven regression tests covering C-1, H-1, H-2 and H-3. Without them nothing prevents the Docker authorization gap from reappearing. Restores the 17-test version from 02c70c7, adds the two M-3 validation tests that were never written, and renames the production-shaped test credentials.
The fallback removal appended duplicate environment entries rather than editing the originals, leaving the published default secrets in the file and making the authoritative value ambiguous.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Remediates the findings in
docs/reviews/review_08_workspace-engineering-review.md, followingdocs/implementation-plans/implementation_plan_15_review-08-remediation.mdand the correction pass in plan 16.Critical
POST /api/servers/docker/containers/{id}/{action}matched no ADMIN rule and fell through to theROLE_GUESTtier, and guest tokens are issued to anyone viaPOST /api/auth/guest. The only gate was a disabled button in the UI. Adds the server-side matcher plus regression tests on every mutating route.docker-compose.ymlis the production base, so a missing.envbooted with a published admin password and JWT signing key. Fallbacks removed;scripts/deploy.shnow loads.envand refuses to deploy withoutJWT_SECRET,ADMIN_PASSWORDandAGENT_SECRET_KEY.High
/api/servers/logsand the Docker log stream were readable with a guest token. NowROLE_ADMIN.permitAll(), making any future endpoint outside/api/**public by default. NowdenyAll().X-Forwarded-Forvalue, so the login limiter (the only brute-force protection on the admin password) was bypassable by randomising a header.Medium / Low
caddy-proxy,devops-orchestrator,devops-agentanddevops-frontend. A denylist rather than an allowlist, because the dashboard exists to manage arbitrary containers.npm audit fix, no--force).Validation
Notes
OrchestratorSecurityTestgrew from 6 to 19 tests. Eleven of those had been written and then silently deleted by85e0f84; they are restored here along with two new path-validation tests.App.jsx:285exhaustive-deps warning is pre-existing and untouched./opt/devops-control-center/.envexists on the VM with all three secrets. If production ever ran without it, rotateJWT_SECRET,ADMIN_PASSWORDandAGENT_SECRET_KEY.docs/adr/adr_01_compose-migration-and-cloud-split.mdand left as an open decision. No code change here.