security(e2e): warn at startup when --env=e2e is set#732
Open
lakhansamani wants to merge 1 commit into
Open
Conversation
--env takes free text with no validation, and E2EEnv silently disables SSRF protection for the SSO broker and webhook registration/delivery, and routes OAuth/SMS to fixed e2e-playground mock addresses. The old per-feature flags (--test-allow-private-sso-hosts, etc.) were self-documenting as dangerous by name; a bare --env=e2e is not, and could be copy-pasted from docker-compose.yml into a real deployment with zero runtime signal. Match the existing AllowedOrigins wildcard warning's pattern.
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
Stacked on #729 — depends on
constants.E2EEnv, which only exists on that branch. GitHub will auto-retarget this tomainonce #729 merges.--env=e2eredesign:--envtakes free text with zero validation, andEnv == E2EEnvsilently disables SSRF protection (private/loopback-IP rejection) for the per-org SSO broker and webhook registration/delivery, and routes OAuth/SMS to fixed e2e-playground mock addresses.--test-allow-private-sso-hosts=true, etc.) were self-documenting as dangerous by name. A bare--env=e2eis not — it reads like an ordinary environment label and could be copy-pasted frome2e-playground/docker-compose.ymlinto a real deployment with no runtime signal.log.Warn()at startup whenEnv == constants.E2EEnv, mirroring the existingAllowedOriginswildcard warning already incmd/root.goright above it.Test plan
go build ./...,go vet ./...,gofmt -l cmd/root.go: clean.go test ./cmd/...: passing (no existing test covers the siblingAllowedOriginswarning either, so no new test was added for this one-line, same-shaped conditional — matches existing convention in this function).