Repository navigation
security: fail-closed legacy policy, trusted proxy and defensive defaults (Track B) - #513
Merged
Merged
Conversation
…it/IP and fail-closed refinements
Owner
Author
Review fixes at
|
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.
Summary
Defensive-only Track B hardening (plan reviewed READY_FOR_IMPLEMENTATION). No exploit code, no live probing, no deployment or release changes.
requireRequestObjecthelper ininternal/rpc/handlers/policy.go; metrics, streaming upload, mod browse, staged config and Packwiz management now deny on nil enforcer/auth. Staged-config apply/rollback/discard resolve the staged record's real owning server before authorizing (cross-server IDOR refusal). ADR 0012 compatibility routes and explicitallow_no_authremain supported.server.trust_proxy. Newproxy.trusted_proxy_cidrs(default empty) means inbound PROXY v2 headers are trusted only from configured load balancer ranges; untrusted headers stay in the byte stream with the peer address retained.cmd/statusbinds loopback by default. New opt-inserver.require_ws_originstrict mode (default false for CLI compatibility).roles:create/roles:updatecan no longer assign built-in admin or grant wildcard resource/action without the new non-defaultroles/manage_wildcardcapability.AUTHnow clears identity and drops log subscriptions; subscribe/command use RPC-parity object checks including subuser grants; command length and log-tail bounds.files.WithinReal.knowledge/decisions/adrs.mdedit - orchestrator owns the index).Verification
go test ./...- all packages green (including new negative fixtures ininternal/rpc/handlers/fail_closed_policy_test.go, proxy trusted-CIDR tests, RCON password tests, WS identity test, role escalation tests).go vet ./...- clean.go run ./cmd/knowledge-lint -root .before and after-fix: 38/38 queries, indexes current, no knowledge files changed.Compatibility / migration
server.trust_proxy: true; users with an upstream PROXY-protocol load balancer must setproxy.trusted_proxy_cidrs. Defaults fail closed for untrusted headers without breaking direct deployments.require_ws_originis opt-in to preserve CLI/native WebSocket clients.Deliberate limits / dependencies
auth.BootstrapAudit,auth.SessionValidator) remain Track A owned; no B-local auth hooks were created. First-admin claim atomicity across local+OIDC, API-token revocation on password change and open-socket session revocation are deferred to Track A.Draft PR: independent review and required CI must pass before merge; author will not merge.