Security is layered. MCP authentication, exact operation authorization, capability visibility, query safety, transport policy, and Apache Doris RBAC each protect a different boundary. Enabling one layer does not remove the need for the others.
Network and proxy -> HTTP Host/Origin/TLS policy -> credential authentication -> MCP operation scope -> domain discovery scope -> exact child execution scope -> provider allowlist and capability gate -> SQL/identifier/result guard -> request-specific Doris identity and RBAC -> sanitized bounded response
The MCP Server is not an authorization proxy that can grant more data access than Doris. Doris remains the final authority for catalogs, databases, tables, columns, rows, UDFs, audit metadata, and system views.
Unauthenticated HTTP is permitted only on a loopback bind under the default policy. It is not a production mode. Non-loopback startup without an enabled authentication method fails unless the operator sets the explicit dangerous ALLOW_UNAUTHENTICATED_NON_LOOPBACK=true override.
stdio relies on the local process boundary and environment supplied by the Host. Protect local environment variables, config files, and process access.
Enable with ENABLE_TOKEN_AUTH=true. Static tokens are validated at the MCP boundary and can be bound to a dedicated Doris route. Persisted token records use self-describing SHA-256/SHA-512 digests and atomic owner-only writes; plaintext legacy records are migrated one way.
The optional HTTP token-management interface is disabled by default and must remain localhost-only, IP-restricted, and protected by a separate high-entropy admin credential. Admin credentials belong in headers, never query strings.
Enable with ENABLE_JWT_AUTH=true and configure the expected issuer/key/ algorithm boundary. Private signing keys and shared secrets must be injected from a secret manager or protected process environment. Do not store real keys in the repository.
Enable external access-token validation with ENABLE_OAUTH_AUTH=true. Tokens must pass trusted issuer, audience/resource, lifetime, active-state, and exact scope validation before optional user information is accepted. An invalid or insufficient token returns a standards-aligned Bearer challenge without exposing provider internals.
Email/domain-to-role mappings are normalized and validated. Domain elevation requires verified identity evidence; fallback mappings do not silently widen exact child scopes.
ENABLE_DORIS_OAUTH_AUTH=true provides an OAuth boundary whose resulting request identity owns a Doris user connection pool. It requires HTTP, a configured service account, a public resource/base URL, and WORKERS=1 in 1.0. External OAuth and Doris-backed OAuth are mutually exclusive.
Authorization codes, access tokens, clients, and user pool state are process-local. Access tokens are bound to the canonical MCP resource. Required RFC resource values, redirect policies, PKCE/client rules, and application type are validated. Raw Doris passwords are not persisted in the token store.
Database-backed child access is disabled by default and uses explicit feature-ID allowlists and exact scopes when enabled. A Doris OAuth token cannot silently fall back to the global service account for a protected data call.
Authorization is performed more than once:
list_tools, call_tool, read_resource.child:call:doris_query:execute_query.OAuth paths require exact domain/child scopes. Wildcard guesses and pre-1.0 tool scopes do not grant access. Discovery does not imply execution. Unauthorized children are filtered from manifests and execute as not found to avoid capability-name disclosure.
The route manager selects credentials in explicit order:
Pools are isolated by canonical route identity. Timeout, cancellation, credential mismatch, or unsafe owner/pool state fails closed rather than falling through to a more privileged pool. Query, metadata, FE HTTP, and capability evidence must remain aligned to the same request route.
Use a dedicated least-privileged Doris account for every trust boundary. See Doris fine-grained access control for grants, row policies, and token-bound examples.
The built-in 1.0 domains are read-only. doris_admin is not registered.
The shared query guard:
Structured Search never accepts arbitrary filter SQL or a raw search DSL. Allowlisted FE/BE HTTP clients validate configured destinations and prevent caller-controlled SSRF targets.
127.0.0.1, localhost, or ::1.Host and Origin to mitigate DNS rebinding.0.0.0.0 is not a public hostname allowlist.MCP_STATE_HANDLE_SECRET only when independent replicas share traffic; rotate it as a deployment secret..env, token files, OAuth client files, JWT keys, private Ossie binding manifests, and MetricFlow projects/provider commands require owner-only access and must not be committed when they contain private definitions.Only installed entry points named in MCP_TOOL_PROVIDERS load. Provider names, tool names, schemas, lifecycle, audit metadata, and bounded rate limits are validated. Startup fails closed on an invalid allowlisted provider. Provider tools cannot shadow built-in tools or silently inherit built-in authorization.
Review Custom tool providers before enabling an extension.
0.0.0.0./live and /ready separately.